-
Notifications
You must be signed in to change notification settings - Fork 30
Support for RDF 1.2 triple terms (without asserted triple) #379
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
Comments
Here's a potential extension: Example 1: _:id rdf:reifies <<( ex:Bob ex:age 23 )>> .
_:id ex:date "2019-12-05"^^xsd:date .
_:id ex:author ex:Claire . ex:TripleTermValidationShape sh:targetObjectsOf rdf:reifies ;
sh:reifiedSubject [
sh:nodeKind sh:IRI ;
] ;
sh:reifiedPredicate [
sh:in ( ex:age ex:height ) ;
] ;
sh:reifiedObject [
sh:datatype xsd:integer ;
sh:minInclusive 0 ;
] . Example 2 with nested triple terms: << ex:Bob ex:age 23 >> ex:confidence 0.9 .
_:s rdf:reifies << << ex:Bob ex:age 23 >> ex:confidence 0.9 >> . ex:ConfidenceShape sh:targetObjectsOf rdf:reifies ;
sh:reifiedSubject ex:InnerTripleShape ;
sh:reifiedPredicate [
sh:hasValue ex:confidence ;
] ;
sh:reifiedObject [
sh:datatype xsd:decimal ;
sh:minInclusive 0.0 ;
sh:maxInclusive 1.0 ;
] .
ex:InnerTripleShape sh:reifiedSubject [
sh:nodeKind sh:IRI ;
] ;
sh:reifiedPredicate [
sh:hasValue ex:age ;
] ;
sh:reifiedObject [
sh:datatype xsd:integer ;
] . So Targeting via |
Here is a list of possible use cases for reification in SHACL with proposals on how SHACL could be extended to cover it. The following example data graph is used for all use cases: ex:age a rdf:Property ;
ex:version 1 .
_:id rdf:reifies <<( ex:Bob ex:age 23 )>> .
_:id ex:date "2019-12-05"^^xsd:date .
_:id ex:author ex:Claire .
# reifier refering to a reifier
# << << ex:Bob ex:age 23 >> ex:author ex:Claire >> .
_:id2 rdf:reifies <<( _:id ex:author ex:Claire )>> .
_:id2 ex:login "Claire321" . TargetsTriple termOne may want to define a target for a triple term to reach the reifier based on a pattern for the triple term. A new target ex:shape a sh:NodeShape ;
sh:targetTripleTerm [
# sh:subject ex:Bob
sh:predicate ex:age
# sh:object 23
];
sh:property [
sh:path ( [sh:inversePath rdf:reifies] ex:date );
]. Is reifierSelecting only subjects that are/aren't reifiers could be another requirement. The target filter would be extended with an additional property ex:shape a sh:NodeShape ;
sh:targetSubjectsOf ex:author ;
sh:targetReifier true;
sh:property [
sh:path ex:date ;
]. TraverseAll parts of a triple term could be useful for further traversing a path. This is not possible with the existing property path tools. Traverse out of a triple termThe ex:shape a sh:NodeShape ;
sh:targetTripleTerm [
sh:subject ex:Bob
];
sh:property [
sh:path ([sh:triplePartOut sh:Predicate] ex:version) ;
sh:in (1 2)
]. Traverse into a triple termThe ex:shape a sh:NodeShape ;
sh:targetObjectsOf ex:author ;
sh:property [
sh:path ([sh:triplePartIn sh:Object; sh:predicate ex:author] [sh:inverse rdf:reifies] ex:login) ;
sh:in ("Claire321")
]. Is reifier constraintThe count of ex:shape a sh:NodeShape ;
sh:targetSubjectsOf ex:author ;
sh:isReifier true. @recalcitrantsupplant My proposal for traversing covers your use case. I favor the |
PR #368 covers the use case with asserted triples. But we haven't decided yet how to deal with targets for reifiers that don't have an asserted triple. SPARQL and Node Expressions could be used, but we may want to support these use cases in the core specification out-of-the-box. Examples and use cases should be collected for further discussions.
Example data without asserted triple:
The text was updated successfully, but these errors were encountered: