linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
566 stars 146 forks source link

Add standard JSONLD parser tests #391

Open timbl opened 4 years ago

timbl commented 4 years ago

JSON-LD tests for rdflib

https://w3c.github.io/json-ld-api/tests/

Points to manifest

https://w3c.github.io/json-ld-api/tests/manifest.jsonld

ericprud commented 4 years ago

Since rdflib doesn't have its own JSON-LD parser, it might not be worth mechanically including much of the json-ld test suite. Instead, I'd suggest a few to make sure the API is managed effectively: 1. embedded @context

  1. api-supplied context -- same as 1, but with the @context removed and supplied via API
  2. api-supplied base
  3. remote context with relative resolution
josephguillaume commented 4 years ago

It's possible fuller coverage might still be useful - rdflib now uses jsonld.flatten and then adds triples individually using kb.addStatement. This has already caused one regression #408 and it's not clear whether json-ld to RDF deserialisation is as yet fully implemented (https://w3c.github.io/json-ld-api/#deserialize-json-ld-to-rdf-algorithm)

https://github.com/linkeddata/rdflib.js/blob/d5000f58258ceb8bf3352be24e919b313cf66abd/src/jsonldparser.js#L87