-
Notifications
You must be signed in to change notification settings - Fork 30
Support for RDF 1.2 triple terms #300
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
@HolgerKnublauch added support for reification for SHACL to DASH a while ago. It's described in the DASH Reification Support for SHACL document. Two new properties are introduced: dash:reifiableBy is similar to sh:node. It points to one or more node shapes. The reified statements must conform to these node shapes. dash:reificationRequired marks the shapes for the reified statements as required. I adapted the example of the document a little bit, covering the handling of the identifier (reifier): Data graph with asserted triple and triple term: # asserted triple
ex:Bob ex:age 23 .
# reified triples with syntactic sugar
<<ex:Bob ex:age 23>>
ex:date "2019-12-05"^^xsd:date ;
ex:author ex:Claire . The data graph without syntactic sugar shows how the identifier (reifier) is linked to the triple term: # asserted triple
ex:Bob ex:age 23 .
# reified triples expanded to triple term
_:id rdf:reifies <<( ex:Bob ex:age 23 )>> .
_:id ex:date "2019-12-05"^^xsd:date .
_:id ex:author ex:Claire . Here is the part of the shape graph that links from the ex:PersonShape-age a sh:PropertyShape ;
sh:path ex:age ;
dash:reifiableBy ex:ProvenanceShape .
ex:ProvenanceShape a sh:NodeShape .
SELECT ?reifier WHERE {
?focusNode sh:path ?p.
?focusNode ?p ?o.
BIND(tripleTerm(?focusNode, ?p, ?o) AS ?tt)
?reifier rdf:reifies ?tt.
} We start with A missing piece is a way to navigate into a triple term when the triple is not asserted. There is no starting point to traverse to Are there other existing implementations or proposals for reification in SHACL? I'm using the DASH reification support regularly. I would support adding reification support as defined in DASH. |
While the DASH Reification Support for SHACL is from the time of the RDF-star CG, it shows the "Triple terms" are triples. They are called "triple terms" because of their role as RDF terms. It is possible to give a name to the reifier (blank node or IRI): <<ex:Bob ex:age 23 ~:refiier123>> . is shorthand for the triple: :refiier123 rdf:reifies <<( ex:Bob ex:age 23 )>> . It is possible to assert a triple and have a reifying triple for it: ex:Bob ex:age 23 ~_:MyLabel . which is ex:Bob ex:age 23 .
_:MyLabel rdf:reifies <<( ex:Bob ex:age 23 )>> . "Annotation Syntax" which both asserts a triple and has data about that triple is carried over into RDF 1.2: ex:Bob ex:age 23 {|
ex:date "2019-12-05"^^xsd:date .
ex:author ex:Claire
|}. which is in triples:
An annotation block can have a explicit reifier and there can be several annotation blocks for the same triple. (None of this is completely finalized in RDF 1.2 yet - the WG welcomes comments.)
SPARQL has the same syntax forms as Turtle. In addition, there are SPARQL functions
What might be of interest to SHACL users is the section in RDF Concepts: "Full" is all RDF 1.2, "Classic" is RDF 1.2 without triple terms and probably will be renamed "Basic". |
There should be a Adding the |
More precisely, what I meant by that:
SELECT * WHERE {
<<?this ex:age ?other>> ?p ?o
} Even |
I am cautious about adding new kinds of targets because (1) we now have node expressions and (2) when do we stop adding use case targets but it might be necessary here.
SPARQL-based targets could be used - presumably these will become It is as if we have a two parts here - find all triple terms (new target), then efficiently filter that list down.
where |
Data Shapes WG needs to liaise with the RDF and SPARQL WG because RDF 1.2 isn't published yet so timing w.r.t data-shapes phase 1 needs clarifying. |
@afs can you give an example of how such a That's how a Node Expression for [
sh:targetNode [
sh:reifierMatch [
sh:subject ex:Bob;
sh:predicate ex:age
]
]
] |
Reifiers can be found:
Wider point: the Is there a way to have additional conditions (for any target selection) for better selection? Jumping to SPARQL is a big jump and is a replacement of any existing target selection. A sort of dynamic |
From the telecon 2025-04-28: Turtle has syntax:
this looks like the RDF-star CG proposal but isn't - this is intentional because many uses of RDF-star CG are in fact about what RDF.1.2 calls occurences - uses of the triple, not the triple itself. In RDF 1.2, it is the two triples:
See #368 (comment) |
Triples used as RDF terms:
https://www.w3.org/TR/rdf12-concepts/#section-triple-terms
Reifiying triples - also known as "occurences" have syntactic support in Turtle and wil have in JSON-LD and RDF/XML.
https://www.w3.org/TR/rdf12-turtle/#reifying-triples
Annotation support (syntactic support)
https://www.w3.org/TR/rdf12-turtle/#annotation-syntax
N-Triples does not have syntactic support
https://www.w3.org/TR/rdf12-n-triples/#triple-terms
The text was updated successfully, but these errors were encountered: