TopQuadrant / shacl-js

SHACL API in JavaScript
Apache License 2.0
70 stars 18 forks source link

Playground Data Graph Error with "@base" #23

Closed michaelcpuckett closed 4 years ago

michaelcpuckett commented 4 years ago

The following works on the JSON-LD Playground (1) but yields this error when entered as the Data Graph on the SHACL Playground: jsonld.RdfError: Could not expand input before serialization to RDF

{
  "@context": {
    "@base": "http://schema.org",
    "@vocab": "/"
  },
  "@type": "InteractionCounter",
  "interactionType": {
    "@id": "CommentAction"
  }
}

I'm not familiar enough with rdflib to know the issue off hand, but I assume there may be an overriding configuration for @base.

(1): https://json-ld.org/playground/

HolgerKnublauch commented 4 years ago

We may simply use an older version of rdflib that didn't include the latest JSON-LD features.

michaelcpuckett commented 4 years ago

@HolgerKnublauch Thanks, I tried upgrading to latest rdflib:

  "dependencies": {
    "rdflib": "^1.0.6"
  },

There are tests that fail in these files:

complex-test-personexample.test.ttl property-test-nodeKind-001.test.ttl

I wasn't able to determine a fix, but I noticed some differences before and after with blank nodes (Comparing e.g. http://test.com/example#_g_L69C2380 vs _g_L69C2380)

I think I see why this wasn't upgraded sooner. Many more tests fail on 0.x versions after 0.15. But after 1.x they all pass besides these two, so I think upgrading should be relatively straightforward now.

This may be related to #21 as well

michaelcpuckett commented 4 years ago

This is already addressed in:

https://github.com/zazuko/shacl-js

Closing here