-
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
Turtle Grammar: Collections and blank node property lists in triple terms #132
Comments
For reference, the same question was raised in https://github.com/w3c/rdf-tests/pull/144/files/0e7088f838bd130fab1792eb50cda9f21b86398b#diff-2393a6f31093e34f798eecfd5dc5b67a77238f1b8ee75e4a35a7c1d650320a68 |
Thank you, I missed that. |
The idea is that the syntax for triple terms is an RDF term without adding triples into the graph. RDF collections and predicateObjectLists generate triples.
does not assert It is possible to write out in full - but the shorthand syntax for keeps triple terms as terms. The odd case is In N-triples, the "one line, one triple" design means no side-effects; N-Triples is legal Turtle. |
Mmm, I am not convinced (yet :) ). I do not see a problem if I see the same for lists, If I write
As always, I dislike the syntactic restriction. I know that this does not influence the abstract syntax and that my usual argument that we are not able to express entailment results does not hold here, so I could be convinced, but currently this restriction feels random (and of course that restriction also causes difficulties for N3 as well, but that is a different story :) ). |
Indeed, N3 is different. In RDF:
would be
so (OWL) this holds:
That's different to the outcome I think is asked for in email The syntax can be widened later if/when a full multiple-triple form is worked out. As we have seen, there is a long road there. Update - from below - apparently the request is asserting the triples, attaching them to a reifier them. |
Fully agreed @doerthe and is also what I replied in https://lists.w3.org/Archives/Public/public-rdf-star-wg/2024Oct/0047.html |
As @afs said, I think having triples generated within << :s :p (1 2 3) >> .
# Generates
_:blank rdf:reifies
<<(:s :p _:b0)>>,
<<(_:b0 rdf:first 1)>>,
<<(_:b0 rdf:rest _:b1)>>,
<<(_:b1 rdf:first 2)>>,
<<(_:b1 rdf:rest _:b2)>>,
<<(_:b2 rdf:first 3)>>,
<<(_:b2 rdf:rest rdf:nil)>> . This, of course, get's much more complicated if there are embedded lists or blankNodePropertyLists. Alternatively, keep the productions narrow and omit collections and blankNodePropertyLists in a reifying triple as the current grammar already does. |
I do not see any harm nor counter-intuitiveness in asserting list triples on their own. |
would it not be less a problem if the grammar were extended by permitting an (unannotated) object list of the respective type in each of the statement reification forms.
|
Well, we must guarantee that the list of arguments is closed, hence the use of a collection. |
given some collection, what prevents a process from replacing whatever statement form comprises the rdf:nil with statements which expand the collection? |
See https://www.w3.org/TR/rdf11-mt/#rdf-collections
and you can't retract an asserted |
Really? I can't find anything that says I cannot do something like this — DELETE {} WHERE { _:bnl_i rdf:rest rdf:nil } .
INSERT { _:bnl_i rdf:rest _:bn2_x } .
# etc. |
I sympathize with that, but I'm with @afs and @gkellogg on this: having constructs inside the Note that the alternative, which is to generate more unasserted triple-terms, as suggested by @gkellogg here and by @lisp here, is also quite problematic, because it would not be consistent with the annotations syntax: << :functor log:isFunctorOf :argument1, :argument2 ~ :r >>. would expand to _:r rdf:reifies <<( :functor log:isFunctorOf :argument1 )>>.
_:r rdf:reifies <<( :functor log:isFunctorOf :argument2 )>>.
# :r reifies two triples while :functor log:isFunctorOf :argument1, :argument2 ~ :r. would expand to :functor log:isFunctorOf :argument1.
:functor log:isFunctorOf :argument2.
_:r rdf:reifies <<( :functor log:isFunctorOf :argument2 )>>.
# :r reifies one triple unless of course we radically change the way the annotation syntax works, but doing that would be far from trivial (to specify and to implement) IMO. So I would refrain from opening that pandora box, and keep the strict constraints on what can be used inside the |
(Some clarification for reading this issue later) Despite the issue title, this discussion mostly has been about reifier triples (occurrences) not triple terms. They are connected by the expansion of occurrence syntax. Turtle has rule The TriG grammar is a little out of date. |
why should that necessarily be the case? they are distinctly different constructs. |
Fair enough, I will continue with https://github.com/eyereasoner/rdfproof |
OK, I see that this discussion boils down to how to handle
I personally would expect that only the first triple is quoted, but I can see how intuitions differ (they always do) and I can see your "box of pandora" argument. Which of still leaves me unhappy with the syntactic restriction... |
As usual, I don't see the pandora box ;-) @pchampin 's example to illustrate a problem has a problem itself:
is equivalent to
If the example used reifiers after each logical statement, i.e.
everything would work as expected. I think this merely illustrates a possible pitfall of that specific syntax - namely that it seems to refer to multiple triples when in fact it doesn't -, and it should be discussed in a best practices section no matter how this issue here is resolved. Of course, better yet would be to introduce a syntax to group statements into graphs. @gkellogg 's example above IMO captures best what should be assumed from a construct like |
Motivated by the other discussion (#131), I had a closer look at our turtle and TriG grammar (https://www.w3.org/TR/rdf12-turtle/#sec-grammar https://www.w3.org/TR/rdf12-trig/) and was surprised, that collections and blankNodePropertyLists are not allowed in triple terms (see: https://www.w3.org/TR/rdf12-trig/#:~:text=%5B34%5D-,ttObject,-%3A%3A%3D).
We discussed about triple terms in only object position (and you know my opinion :) ), but I do not remember that we discussed that issue. To me, that choice feels random, but maybe there are good reasons for that?
I know that this does not influence our abstract syntax, as collections and blankNodePropertyLists are only syntactic sugar, but I would like to at least know why we do not allow them.
The text was updated successfully, but these errors were encountered: