digitalbazaar / pyld

JSON-LD processor written in Python
https://json-ld.org/
Other
603 stars 130 forks source link

issue with jsonld.normalize(). #99

Open amarts opened 5 years ago

amarts commented 5 years ago

I was trying to run sign/verify on the same jsonld samples from https://github.com/digitalbazaar/vc-demo/blob/master/credentials/alumni.jsonld in python.

While trying to run jsonld.normalize() I am getting errors.

Traceback (most recent call last):
  File "/home/amar/work/test/certapp-test/jsonld.py", line 1134, in to_rdf
    expanded = self.expand(input_, options)
  File "/home/amar/work/test/certapp-test/jsonld.py", line 835, in expand
    expanded = self._expand(active_ctx, None, document, options, False)
  File "/home/amar/work/test/certapp-test/jsonld.py", line 2090, in _expand
    active_ctx, element['@context'], options)
  File "/home/amar/work/test/certapp-test/jsonld.py", line 2833, in _process_context
    self._create_term_definition(rval, ctx, k, defined)
  File "/home/amar/work/test/certapp-test/jsonld.py", line 4345, in _create_term_definition
    {'context': local_ctx}, code='invalid term definition')
jsonld.JsonLdError: ('Invalid JSON-LD syntax; @context property values must be strings or objects.',)
Type: jsonld.SyntaxError
Code: invalid term definition
davidlehn commented 5 years ago

Those examples are not likely to work at the moment since PyLD doesn't yet support the latest 1.1 spec. Full 1.1 support is a work in progress.

amarts commented 5 years ago

Thanks for confirming.

davidlehn commented 4 years ago

PyLD 2.0.0 has been released. It should be able to handle those examples.