shexSpec / shex

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

No way to say "any language-tagged string" #74

Closed ericprud closed 5 years ago

ericprud commented 6 years ago

We don't have a way to specify any literal with a language tag. The closest we have is rather arcane by ruling out only unlikely language tags:

<S> { :p [. - @notalanguage] }

which would not match <s> in <s> :p "asdf"@en . but not any of these graphs:

Correction: one could also used a rdf:langString

<S> { :p rdf:langString }

Exclusions become awkward:

<S> { :p (rdf:langString AND NOT [@en @fr]) }
ericprud commented 6 years ago

(response moved from #78)

I had an action item to draft a proposal for an intuitive token for "any language-tagged string". I ended up using @~ instead of @* (see shex.js example). This worked in shex.js with fewer than 10 changed lines.

<#LangString> rdf:langString

<#LangStem> [@en~]

<#Empty> [@~]

<#EmptyExclEN> [@~ - @en] # rejects "ab"@en

<#EmptyExclFR> [@~ - @fr]

# <#EmptyExclEmpty> [@~ - @~] <-- not valid in grammar

# <#DotExclEmpty> [. - @~] <-- not valid in grammar

PROPOSE: add this to grammar, add appropriate explanatory text to spec, and close accepting the langString-ATstar proposal:

ericprud commented 6 years ago

PRs:

TODO: someone should look at 5.4.6 Values Constraint and decide whether there needs to be more explanatory text for an empty stem.