w3c / rdf-star

RDF-star specification
https://w3c.github.io/rdf-star/
Other
119 stars 23 forks source link

Annotation syntax for SPARQL-star #106

Closed hartig closed 3 years ago

hartig commented 3 years ago

This PR is meant to address the SPARQL-star part of #9. That is, It adds the extension of the SPARQL-star grammar with the annotation syntax.

(the changes in this PR are copied over from #65 which was based on the old organization of files in the repo)


Preview | Diff

hartig commented 3 years ago

Open TODOs in this PR:

afs commented 3 years ago

There is one simplification that can be done. Rather than the ObjectList rules, and use the annotation production twice, it can go on Object...

ObjectPath  ::=  GraphNode AnnotationPatternPath?

Object  ::=  GraphNode AnnotationPattern?

which is mention once.

(Note that Collection uses GraphNodeetc ).

afs commented 3 years ago
  • adding the text note saying "If annotation, must be simple path"
  • perhaps another note to highlight that property path patterns can be used within the annotation part

To go with this, I've raised #107 to add tests to the SPARQL-star syntax test suite.

hartig commented 3 years ago

Great idea Andy! I have implemented these simplifications now.

hartig commented 3 years ago

I have addressed the remaining two TODOs now. The new parts are the additional paragraphs below the actual grammar in Section 4.2. Additionally, I have extended the example for the corresponding expansion rule in Section 4.3.2 (to highlight once more the possibility of having path expressions inside the annotation patterns).

@afs can you please take a look.

afs commented 3 years ago

Text looks good. I don't think it really needs to say as much about expanding prefixed name and triple forms, much too diligent! (bullets 2 and 3 in 4.3.2). But the text is there so it can stay.

afs commented 3 years ago

There are 3 syntax forms (some with variations) that have been discussed. While there has been some advocacy from a few people, there does not seem to be a leading candidate in the community as a whole.

We have

:s :p :o @{ :p :z } .
:s :p :o @[ :p :z ] .
:s :p :o {| :p :z |} .
gkellogg commented 3 years ago

I'm pretty used to {| ... |} now and definitely favor a symmetric beginning/ending such as this. That combination of characters is unlikely to be confused with anything else, as long as the token {| is examined before {, which is similar to other sequences where a pair of characters takes precedence over a single character (e.g., : <= vs <, != vs ! in SPARQL).

hartig commented 3 years ago

Based on the agreement in the telco today, I am merging this PR now.