Skip to content
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

Reified triples and compound triple form syntax. #71

Open
afs opened this issue Sep 16, 2024 · 2 comments · May be fixed by #70
Open

Reified triples and compound triple form syntax. #71

afs opened this issue Sep 16, 2024 · 2 comments · May be fixed by #70
Labels
spec:enhancement Issue or proposed change to enhance the spec without changing the normative content substantively

Comments

@afs
Copy link
Contributor

afs commented Sep 16, 2024

Turtle 1.1 has two syntax forms that generate multiple triples on parsing, blankNodePropertyList (e.g. [ :p 123 ; :q "abc" ]) and collection (e.g. ("A" "B" "X")).

The grammar productions subject and object allow collections, the object production also allows blankNodePropertyList (a blankNodePropertyList in the subject position is handled in production triples.

The syntax for reified triples in Turtle 1.2 uses subject and object (editors working draft of 12 September 2024).

    reifiedTriple         ::= '<<' (subject | reifiedTriple) verb object reifier? '>>'

allows collections in the subject position, and allows collections and blankNodePropertyList in the object position.

A reified triple declaration such as:

    << :s :p [ :q1 "A" ; :q2 "B" ] >> .

generates

    _:b0    :q1     "A";
            :q2     "B" .
    _:b1    rdf:reifies  <<( :s :p _:b0 )>> .

The triples from the blankNodePropertyList structure are in the set of triples of the graph. They are not reified. The blank node for the [ ...] is in the reified triple.

PR #70 address this by having productions rtSubject and rtObject for subject and object position in reified triples, and defines them to include only "single triple" possibilities (c.f. the existing ttSubject and ttObject`).

A similar situation exists for annotation syntax except that blankNodePropertyList triples are meant to be in the set of triples of the graph, so there is no effect.

The only confusing factor is that the reification of the annotation only includes the blank node subject of the blankNodePropertyList or collection, not the compound form triples.This is not fixable in any practical way but does not add make additional assertions into the graph.

@afs afs linked a pull request Sep 16, 2024 that will close this issue
@afs afs added the spec:enhancement Issue or proposed change to enhance the spec without changing the normative content substantively label Sep 16, 2024
@gkellogg
Copy link
Member

By that logic, it would seem you'd need to restrict reifiedTriple from being included as well, as it also can generate a blank node.

<< :s :p << :s1 :p1 :o1 >> >> .

generates

_:b0 rdf:reifies <<(:s1 :p1 :o1)>> .
_:b1 rdf:reifies <<( :s :p _:b0)>> .

Similar for a reifiedTriple in the subject position.

@afs
Copy link
Contributor Author

afs commented Sep 16, 2024

Suppose for illustration, :name is an inverse functional property:

    << :s1 :p1 [ :name "Finley" ; :DoB "2024-05-01" ] >> .
    << :s2 :p2 [ :name "Finley" ; :DoB "2024-03-09" ] >> .

gives:

    _:b0   rdf:reifies   <<( :s1 :p1 _:b1 )>> .
    _:b2   rdf:reifies   <<( :s2 :p2 _:b3 )>> .
    _:b1   :name "Finley" ;  :DoB "2024-05-01" .
    _:b2   :name "Finley" ;  :DoB "2024-03-09" .

In the case of nested reifiedTriple, yes, there is some extra naming. It is safe in the sense that it does not assert ":s1 :p1 :o1".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:enhancement Issue or proposed change to enhance the spec without changing the normative content substantively
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants