Skip to content

Add SPARQL syntax sections on triple terms, reifiers, and annotations - #400

Open
rubensworks wants to merge 10 commits into
mainfrom
feature/syntax-tripleterms-reifiers
Open

Add SPARQL syntax sections on triple terms, reifiers, and annotations#400
rubensworks wants to merge 10 commits into
mainfrom
feature/syntax-tripleterms-reifiers

Conversation

@rubensworks

@rubensworks rubensworks commented Jun 24, 2026

Copy link
Copy Markdown
Member

The text and structure of these new sections are mostly based on the text in the Turtle 1.2 spec, with the necessary changes to the interpretation, grammar, and examples.

Closes #176
Closes #398

One discussion point I want to raise here (which I did not incorporate yet into this PR), is the following:
Similar to how a "Triple Term" is a "Triple" that can be placed in the object position, do we need a concept "Triple Term Pattern" to refer to a "Triple Pattern" that can be placed in the object position? IMO, the text in this PR works without such a concept, but perhaps someone else has a different view on it. If we do this, we may also have to do this for Reifying Triple (Patterns). We may also consider grammar renames for this.


Preview | Diff

The text and structure of these new sections are mostly based on the
text in the Turtle 1.2 spec, with the necessary changes to the
interpretation, grammar, and examples.

Closes #176
Closes #398
@rubensworks
rubensworks requested review from Tpt, afs, hartig and kasei June 24, 2026 09:30
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
@afs

afs commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The commit b31c2ce has changed every line in the document from NL to CRNL.

(The diff is 26k lines - the doc itself is 13k lines long.)

@afs afs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about commenting on a commit but "File Changes" isn't showing PR diffs due to the size.

Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated

<section id="syntaxAnnotation">
<h3>Annotation Syntax</h3>
<p>SPARQL also defines an <dfn data-lt="annotation-syntax">annotation syntax</dfn>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a <dfn> in this document - it's a pattern.

Turtle defines "annotation-syntax" - it's data.

Maybe this could be "annotation pattern syntax" or we accept that triple/triplepattern is often a bit losoe and use "annotation syntax" with a definition.

Prior to this PR the only use of "annotation syntax" is in a grammar note (link to the syntax production) and the changes.

  1. A reifier or annotation syntax is only permitted after a triple when the property position is a simple path (an IRI, the keyword a, or a variable), and not for other path expressions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these definitions are in the scope of the spec they are defined in (?), it might be ok to have a separate Turtle Annotation Syntax and SPARQL Annotation Syntax.

Annotation Pattern Syntax feels a bit clunky, but I don't have a strong opinion on this.

@rubensworks
rubensworks force-pushed the feature/syntax-tripleterms-reifiers branch from b31c2ce to 8950c95 Compare July 7, 2026 07:47
@rubensworks

Copy link
Copy Markdown
Member Author

The commit b31c2ce has changed every line in the document from NL to CRNL.

Hmm, something went wrong there.
I've reverted the commit, and applied @TallTed's suggestions manually.

I will look into processing the remaining comments soon.

Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
@TallTed

TallTed commented Jul 14, 2026

Copy link
Copy Markdown
Member

The commit b31c2ce has changed every line in the document from NL to CRNL.

(The diff is 26k lines - the doc itself is 13k lines long.)

Holy carp... Sorry, all, as with similar previous occurrences, I have no idea what I can do differently to prevent such weirdness. I certainly didn't do it on purpose!

I've reverted the commit, and applied @TallTed's suggestions manually.

Thanks for the cleanup! I'm glad it was a small indended change, which was entirely reviewable by hiding whitespace changes.

Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
Comment thread spec/index.html Outdated
@rubensworks
rubensworks force-pushed the feature/syntax-tripleterms-reifiers branch from 0b0fad6 to b48e12d Compare August 13, 2026 11:13
@rubensworks
rubensworks requested review from Tpt, afs, hartig and kasei August 13, 2026 11:34
Comment thread spec/index.html
</section>
<section id="syntaxReifyingTriples">
<h3>Reifying Triples</h3>
<p><a data-cite="RDF12-CONCEPTS#dfn-triple-term">Triple terms</a> are mostly used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p><a data-cite="RDF12-CONCEPTS#dfn-triple-term">Triple terms</a> are mostly used
<p><a data-cite="RDF12-CONCEPTS#dfn-triple-term">Triple terms</a> are used

In the case of rdf:reifies, it is the object position.

Comment thread spec/index.html
&lt;&lt; ?person :jobTitle "Designer" &gt;&gt; :accordingTo ?authority .
}
</pre>
<p>The example below matches reifying triples with an explicit reifier.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>The example below matches reifying triples with an explicit reifier.</p>
<p>The example below matches reifying triples with a
variable to match the reifier.</p>

Comment thread spec/index.html
<br/>`&lt;&lt; ?subject1 :predicate1 &lt;&lt; :subject2 :predicate2 :object2 &gt;&gt; ~ :IRIREF1 &gt;&gt;`<br/>
or <br/>`&lt;&lt; :subject4 :predicate4 &lt;&lt; :subject3 :predicate3 ?object3 ~ :IRIREF3 &gt;&gt; &gt;&gt;`.
</p>
<p>The example below matches reifying triples with an implicit reifier.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>The example below matches reifying triples with an implicit reifier.</p>
<p>The example below matches reifying triples without regard to the reifier.</p>

The data does have a reifier - the query does not capture it in a variable.

@afs

afs commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

A few minor improvements suggested but good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a subsection about annotations, reified triples and triple terms Explain meaning of Reifier

7 participants