shexSpec / shex

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

Context doesn't work for "max" #49

Closed gkellogg closed 7 years ago

gkellogg commented 7 years ago

Trying to be clever, I defined the "max" term as {"@id": "shex:max", "@type": "@vocab"}, thinking that an integer, such as 2 is a native value, and not a string, so the @vocab would not come into play. Unfortunately, this seems to not be the case in JSON-LD 1.1 (I filed json-ld/json-ld.org#470 to address in JSON-LD 1.1, but that doesn't help us now). Consequently, I think we can't simply use "max": "unbounded", but will need to use "max": {"@id": "shex:unbounded"}, and change the term definition for "max" back to {"@id": "shex:max", "@type": "xsd;integer"}, so that a JSON-LD processor will handle it properly.

Alternatively, we could make the term change and continue to use "max": "unbounded", which would result in an invalid literal "unbounded"^^xsd:integer.

We could also consider using something like a negative number, to indicate unbounded: "max": -1, which would at least result in a valid literal.

gkellogg commented 7 years ago

PROPOSAL: JSON/RDF representation for "unbounded" will be -1 REASON: JSON-LD 1.0 value processing doesn't properly expand numbers when @type: @vocab (or @id). Proposed fix for JSON-LD 1.1, but target for ShEx is 1.0. PARTICIPANTS: @gkellogg, @ericprud

gkellogg commented 7 years ago

Resolved to accept the use of -1 for unbounded on 3/24/2017 telecon.