shex icon indicating copy to clipboard operation
shex copied to clipboard

ShapeMap specification candidate draft

Open jimkont opened this issue 8 years ago • 5 comments

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

jimkont avatar Jun 30 '17 10:06 jimkont

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

labra avatar Jun 30 '17 11:06 labra

Some grammar comments:

  • shapeMap ends with a ';' which is not quoted; does this have some significance?
  • The triplePattern production has a First/First conflict on '{' (a concern for context-free parsing), I rewrite as follows:
    [6]     triplePattern         ::= '{' (
                                          ("FOCUS" iri (objectTerm | '_'))
                                        | ((subjectTerm | '_') iri "FOCUS")
                                      ) '}'
    

gkellogg avatar Jun 30 '17 19:06 gkellogg

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.

ericprud avatar Jul 01 '17 07:07 ericprud

Some grammar comments:

  • shapeSelector (production 7) references ATSTART, but Terminals defines AT_START (production 17).
  • The terminals reference two terminals that are not defined: PNAME_NS (production 71 and 15) and PNAME_LN (production 16).
  • The anchor for the PNAME_NS href in production 71 is #term-PNAME_NS, while the anchor for the same terminal in production in production 15 is #term-PN_PNAME_NS (extra PN_). (The anchor for the PNAME_LN href in production 16 also has the extra PN_, but PNAME_LN is not referenced anywhere else.)
  • AT_PNAME_NS and AT_PNAME_LN (production 15 and 16) appear unused. Are they unintentional duplicates of ATPNAME_NS and ATPNAME_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 avatar Jul 01 '17 11:07 lucaswerkmeister

@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).

ericprud avatar Jul 03 '17 15:07 ericprud