-
Notifications
You must be signed in to change notification settings - Fork 30
#300: Added support for RDF 1.2 triple terms #368
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
Conversation
shacl12-core/index.html
Outdated
<h4>sh:reifiableBy, sh:reificationRequired</h4> | ||
<p> | ||
<code>sh:reifiableBy</code> can be used to link a <a>property shape</a> with one or more <a>node shapes</a>. | ||
Any reified statement must conform to these node shapes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{| |}
is surface syntax for the triples.
I think SHACL needs to define validation for the basic forms then work up from there. This PR seems to be for an annotation usage pattern but that isn't the only way to use RDF 1.2.
Starting with:
ex:ValidResource1
ex:propertyA "valid" {|
ex:propertyB true ;
|} .
{| |}
is syntax to both reify a triple and provide triple about the reification. It is only syntax and is not retained in the RDF graph.
ex:ValidResource1 ex:propertyA "valid" .
<< ex:ValidResource1 ex:propertyA "valid" >> ex:propertyB true .
and << >>
(an occurence - a use of a triple term) is in turn surface syntax for rdf:reifies
so the whole thing three triples:
ex:ValidResource1 ex:propertyA "valid" .
_:b0 rdf:reifies <<( ex:ValidResource1 ex:propertyA "valid" )>>;
ex:propertyB true .
<<( ... )>>
is a triple term.
I think the intent is to apply a shape to the structure and also the triples insided {| |}
.
Is that right?
Only Turtle/TriG have this annotation syntax.
Data does not have to use {| |}
and it does not exist graph / triple store.
Sometimes, there may not be an asserted triple:
<< :s :p :o ~ _:reif1 >> :added "2025-04-01" .
<< :s :p :o ~ _:reif1 >> :deleted "2025-05-01" .
which is 3 triples:
_:b0 rdf:reifies <<( :s :p :o )>>;
:added "2025-04-01" .
rdf:reifies <<( :s :p :o )>>; ## Duplicate - same as the first triple.
:deleted "2025-05-01" .
Note the shared blank node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's for the use case where an asserted triple can be used to traverse into the triple term. The text definition says that the reifier will become the focus node for that validation.
Based on the discussion in #300, I thought we don't need to cover the use case without asserted triples. Node Expressions, or SPARQL-based targets can be used for that use case.
Co-authored-by: Andy Seaborne <[email protected]>
shacl12-core/index.html
Outdated
<div class="def def-text"> | ||
<div class="def-header">TEXTUAL DEFINITION of sh:reificationRequired</div> | ||
<div class="def-text-body" data-validator="ReificationRequired"> | ||
If <code>$reificationRequired</code> is set to <code>true</code>, a failure MUST be produced when there is no reified statement for the <a>triple term</a> <code>t</code> in the <a>data graph</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can be zero or more groups of triples
## Reifier, no triple with that as subject
:s :p :o1 ~:r .
## Same as :s :p :o1 ~:r {} .
## Two reifiers, each with triples.
:s :p :o2 {| ex:signedOffBy "A" |}
{| ex:signedOffBy "B" |} .
In this example, reificationRequired
is more count-like. This includes 0 -- the first example above -- here the reifier is allocated for later use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node Expressions, or SPARQL-based targets can be used for that use case.
How? SPARQL-based constraints can do many things but what would node expressions look like?
General observation: Pushing things onto node expressions may work technically but they aren't necessarily a friendly way to express things. If the WG decides to publish core as a REC ASAP, then core is then fixed and unchangeable. The WG needs to be certain that pushing out things out to phase2 actually ends up with the best outcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can handle that change in a separate PR. That's why I've moved the discussion back to the issue.
Co-authored-by: Andy Seaborne <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes, which I hope improve clarity and readability.
Co-authored-by: Ted Thibodeau Jr <[email protected]>
This PR is motivated to the annotation pattern/syntax in RDF 1.2 Turtle. Annotation hides the reifier although the reifier can be explicitly given. The property shape object of
With explicit reifier:
then the name |
I must be missing something somewhere. Why not |
@TallTed the name probably was copied from dash:reifiableBy. The reason is that reifiedBy would mean that reification is required, while reifableBy means that if a reification exists then it must have the given shape. |
Fair enough. |
I think Ted has a point. To get to the focus node for the annotations (data graph traversal), there must be a connection between the reifier (blank node or the The annotation syntax checking resides in The focus node of Suggestion: rename
There can be multiple reifiers, each with an annotation blocks in the syntax. I'm not sure what that is going to look like. |
I've renamed @afs ex:ProvenanceShape
sh:property [
sh:path rdf:reifies ; # inverse?
sh:nodeKind sh:IRI ; ## e.g. requires the reifier to be an IRI
]
] . |
@afs @TallTed @HolgerKnublauch Can you please review the latest changes? |
I have approved this for now, but I expect further changes will happen in follow-up tickets. It is important though to get this into the main branch to have a starting point. |
…h constrain to parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough for merge. Iterate for further improvement.
This PR adds support for RDF 1.2 triple terms, as discussed in #300.
Since this is the first RDF 1.2 feature PR, I want to discuss in the next meeting how to handle RDF 1.2 features before merging it.
Closes #300