-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON-LD as constraind by grammar is limiting #120
Comments
@gkellogg , have you tried to frame ShExR->ShExJ using JSON-LD 1.1? @JervenBolleman , I recall it not being quite possible with JSON-LD 1.0 because ShExJ wants e.g. (YAML for terseness): type: Schema
shapes:
- type: ShapeDecl
id: http://a.example/Commuter
shapeExpr:
type: Shape
expression:
type: TripleConstraint
predicate: http://a.example/rides
valueExpr: http://a.example/Vehicle
- type: ShapeDecl
id: http://a.example/Vehicle
shapeExpr:
type: Shape
expression:
type: TripleConstraint
predicate: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
valueExpr:
type: NodeConstraint
values:
- http://a.example/Bike
- http://a.example/Bicycle
- http://a.example/Unicycle and not: type: Schema
shapes:
- type: ShapeDecl
id: http://a.example/Commuter
shapeExpr:
type: Shape
expression:
type: TripleConstraint
predicate: http://a.example/rides
valueExpr: http://a.example/Vehicle
- type: ShapeDecl
id: http://a.example/Vehicle
shapeExpr:
type: Shape
expression:
type: TripleConstraint
predicate: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
valueExpr:
type: NodeConstraint
values:
- http://a.example/Bike
- http://a.example/Bicycle
- http://a.example/Unicycle which tends to fall out of framing (at least when you have corefs to So far, we've defined ShExR as ShExJ's JSON-LD interpretation. If we want to specify the return, we need to either specify that post-processing or define it in terms of e.g. JSG with an algorithm that starts with a typed node N, validates it according to Thoughts? |
@ericprud IIRC, JSON-LD 1.0 didn't have That said, you may be interested in YAML-LD, which may have a future as a recommendation. |
There are many ways to write JSON-LD documents that could express Shape Expressions. However, many of these reasonable serializations are not valid ShexJ files. e.g.
This is a small adaptation of one of the primer examples but is not a valid ShexJ file.
The example here and the JSON-LD in the primer are equivalent RDF wise.
A solution could be to add a standard JSON-LD framing to generate JSON-LD that fits into the grammar.
Other option is to use ShexR as the basis for defining ShexJ.
Why is this important, it is quite normal to generate some Shex shapes based on the output of some existing RDF dataset, and the fact that we can't directly sparql construct the shapes is unfortunate.
The text was updated successfully, but these errors were encountered: