Open labra opened 7 years ago
After entertaining ourselves with how to validate the RDF graph at sm:Focus, we settled on adding an sm:focus predicate:
[ a sm:ShapeMap ;
sm:associations (
[
sm:node [
sm:focus rdf:subject ;
rdf:predicate rdf:type ;
sm:object schema:Person
] ;
sm:shape :PersonShape
]
)
] .
This also uses rdf:{subject,predicate,object}.
More examples:
[]
a sm:ShapeMap ;
sm:associations (
[
sm:node [
a sm:TriplePattern ;
sm:focus rdf:subject ;
rdf:predicate <http://hl7.org/fhir/status> ;
] ;
sm:shape sx:Start
]
) .
This means that sx:Start ought not be a URL for a schema that labels some ShapeDecl as sx:Start a la
<http://bad.example/ns/Start>
sx:start sx:Schema ;
sx:shapes (
sx:Schema sx:Start
) .
sx:Schema a sx:ShapeDecl ; sx:shapeExpr [ ... ] .
sx:Start a sx:ShapeDecl ; sx:shapeExpr [ ... ] .
That's OK, we control that schema and are not so masochistic that we'll add such confusion right away.
It would be interesting to define an RDF/JSON-LD serialization of shape maps.
As an example, the following shapeMap:
could be represented in RDF as:
A use case would be to validate RDF graphs that contain a merge of the shapes, the data and the shapeMap.
Something like this: