shexSpec / shex

ShEx language issues, including new features for e.g. ShEx2.1
24 stars 8 forks source link

Define the semantics of qualified names in shape maps #95

Open labra opened 4 years ago

labra commented 4 years ago

At this moment shapemap implementations allow qualified names without prefix declarations and inherit the alias from the ShEx schemas or RDF data. For example, a shapemap like:

foo:Node@bar:Shape

is accepted whenever the RDF data contains a prefix declaration for foo and the ShEx schema contains a prefix declaration for bar.

This behaviour works well in practice and has been implemented by Shex.js and SHaclEX, but is hasn't been docomented yet in the shape map spec.

Apart from that, users may want to define their own prefix declarations in their shapemaps. So a shape map could be:

prefix foo: <http://example.org/foo/>
prefix bar: <http://example.org/bar/>

foo:Node@bar:Shape

and would try to check node <http://example.org/foo/Node> with the shape <http://example.org/bar/Shape>

andrawaag commented 4 years ago

This isssue will be reviewed in the ShEx CG meeting on January 8th: https://github.com/shexSpec/shex/blob/master/meetings/2020/20200108-agenda.md

ericprud commented 4 years ago

I think the easiest path forward is to have a normative behavior with regard to a pair of resolvers (prefixes+base) for the shape label and node/triplePattern respectively. We could then have a non-normative section that says the the resolvers are SHOULD come from the loaded schema and data, but exactly how is application-dependent (iirc, XPath does something similar, but I'm not finding evidence of that).

If we want to be normative throughout, we have to specify lots of details like what happens if you load two docs into your graph and they conflict on prefix or base. Or even if a single doc re-assigns a prefix or base after it has been used to resolve some terms (turtle allows that).