ShapeMap specification candidate draft
As decided in the last teleconference, all CG members are kindly requested to review and vote on the ShapeMap specification that Eric drafted here: https://shexspec.github.io/ShapeMap/
if no issues are identified we will publish it along with the rest documents we published in our community page https://www.w3.org/community/shex/
Please review by Monday evening US time
It would be nice if we could add some convention to include also prefixed names in shape maps. Something like:
{ FOCUS rdf:type schema:Person }@START
which would be equivalent to
{ FOCUS <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> }@START
whenever there is some convention to find those prefix declarations in the data or the schema
Some grammar comments:
shapeMapends with a ';' which is not quoted; does this have some significance?- The
triplePatternproduction has a First/First conflict on '{' (a concern for context-free parsing), I rewrite as follows:[6] triplePattern ::= '{' ( ("FOCUS" iri (objectTerm | '_')) | ((subjectTerm | '_') iri "FOCUS") ) '}'
I added a triplePatternLL production which folks can compare with triplePattern (just above it). My pref is to favor the readability of triplePattern but can go either way.
Some grammar comments:
shapeSelector(production 7) referencesATSTART, but Terminals definesAT_START(production 17).- The terminals reference two terminals that are not defined:
PNAME_NS(production 71 and 15) andPNAME_LN(production 16). - The anchor for the
PNAME_NShref in production 71 is#term-PNAME_NS, while the anchor for the same terminal in production in production 15 is#term-PN_PNAME_NS(extraPN_). (The anchor for thePNAME_LNhref in production 16 also has the extraPN_, butPNAME_LNis not referenced anywhere else.) AT_PNAME_NSandAT_PNAME_LN(production 15 and 16) appear unused. Are they unintentional duplicates ofATPNAME_NSandATPNAME_LN(production 70 and 71)?
Also, the “ShapeMap usage” section feels incomplete to me. It describes how to convert a triple pattern to a SPARQL triple pattern, but not how to derive a fixed ShapeMap from it. To turn the SPARQL triple pattern into a full SPARQL query, I would think that you’d have to define the variable name used for a focus selector more specifically (instead of just a fresh variable), so that it can be SELECTed.
@lucaswerkmeister , The terminals you pointed out were indeed vestiges of a larger language with support for prefixed names. I've commented them out in the editor's draft.
Re the usage section, I had failed to complete the thought. I added this to the section on fixing triple patterns:
For each triple T in G which matches P, the fixed ShapeMap has a shape association F where F.shape = A.shape and • If A's subject is a focus selector, F.node is T's subject. • If A's object is a focus selector, F.node is T's object.
I also changed
If A.node is an RDF graph, A is in the fixed ShapeMap.
to
If A.node is an RDF node, A is in the fixed ShapeMap.
You can add a laugh icon to your comment to signify that the above two commits address your comments. Tx for the careful review!
P.S. I'm happy to adopt another convention to indicate that a comment had been satisfied. I picked the laugh icon because it's kind of like a smiley face indicating contentment; also+1 would imply support for the issue itself rather than indicating that it has been addressed (I guess).