Re: [shape-map] Can't single column result SPARQL queries be used as node selectors? (#22)

The challenge is that we'd like the power of SPARQL without the requirement of SPARQL. Two or three implementations support a keyword-switched extension language, [e.g.](http://shex.io/webapps/shex.js/doc/shex-simple?schema=PREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0APREFIX%20prov%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Fprov%23%3E%0APREFIX%20p%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2F%3E%0APREFIX%20pr%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Freference%2F%3E%0APREFIX%20ps%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fstatement%2F%3E%0A%0Astart%20%3D%20%40%3Cwikidata_item%3E%0A%0A%3Cwikidata_item%3E%20%7B%0A%20%20p%3AP1748%20%7B%0A%20%20%20%20ps%3AP1748%20LITERAL%20%3B%0A%20%20%20%20prov%3AwasDerivedFrom%20%40%3Creference%3E%2B%0A%20%20%7D%2B%0A%7D%0A%0A%3Creference%3E%20%7B%0A%20%20pr%3AP248%20%20IRI%20%3B%0A%20%20pr%3AP813%20%20xsd%3AdateTime%20%3B%0A%20%20%23%20pr%3AP699%20%20LITERAL%0A%7D%0A&data=%0A%0A%20%20Endpoint%3A%20https%3A%2F%2Fquery.wikidata.org%2Fbigdata%2Fnamespace%2Fwdq%2Fsparql%0A&manifestURL=http%3A%2F%2Fshex.io%2Fwebapps%2Fshex.js%2Fexamples%2Fmanifest.json&shape-map=SPARQL%20%27%27%27SELECT%20%3Fitem%20%3FitemLabel%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP279*%20wd%3AQ12078%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%0A%20%20%7D%0A%7D%20LIMIT%2010%27%27%27%40START&interface=human&success=proof&regexpEngine=eval-threaded-nerr)

``` js
SPARQL '''SELECT ?item ?itemLabel WHERE {
  ?item wdt:P279* wd:Q12078 .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en"
  }
} LIMIT 10'''@START
```

This could be defined by expanding nodeSpec to take a PREFIX (using PREFIX as a reasonable terminal for the identifier) and a string:

[3 ] | [nodeSpec](https://shexspec.github.io/shape-map/#prod-nodeSpec) | ::= | [objectTerm](https://shexspec.github.io/shape-map/#prod-objectTerm) \| [triplePattern](https://shexspec.github.io/shape-map/#prod-triplePattern) \| [\<PREFIX>](https://shexspec.github.io/shape-map/#term-PN_PREFIX) [string](https://shexspec.github.io/shape-map/#prod-STRING)
-- | -- | -- | --

This kinda skips the question of governance of the extension namespace. We could have a registry, but then folks have to register to avoid collision. Another approach is to say that it's a URL relative to some registry, which would enable unregistered extensions a la:

``` js
http://example.org/shapeMapExt123 'something magic here'@START
```

The delimiter here would be first whitespace (normal lexing rules), but we could tweak it (not backward-compatible) to have '<' '>' delimiters around the URL, though I guess the URL grammar prohibits ' ' just as '>'.

-- 
GitHub Notification of comment by ericprud
Please view or discuss this issue at https://github.com/shexSpec/shape-map/issues/22#issuecomment-1043599759 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 17 February 2022 23:12:46 UTC