Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHACL: remove superfluous pattern for nodeKind IRI #412

Open
VladimirAlexiev opened this issue Mar 29, 2022 · 0 comments
Open

SHACL: remove superfluous pattern for nodeKind IRI #412

VladimirAlexiev opened this issue Mar 29, 2022 · 0 comments

Comments

@VladimirAlexiev
Copy link
Contributor

@mgh128 https://github.com/gs1/EPCIS/blob/master/Ontology/EPCIS-SHACL.ttl now has a number of patterns like this:

    sh:nodeKind sh:IRI ;
    sh:pattern "^(.+?):(.+)$" ;

This pattern is superfluous since it's part of URI syntax: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax.
You cannot have a URI without a colon preceded and followed by something (I can't imagine a URI with "empty path" as mentioned at that link).
In ntriples you can't use relative URIs:

$ echo "<foo> <bar> <baz>." | riot.bat --validate -syntax ntriples -
20:19:46 ERROR riot            :: [line: 1, col: 1 ] Relative IRI: foo
20:19:46 ERROR riot            :: [line: 1, col: 7 ] Relative IRI: bar
20:19:46 ERROR riot            :: [line: 1, col: 13] Relative IRI: baz

In Turtle you can use relative URIs, but they are always resolved to some base (even if random), which includes a scheme:

$ echo "<foo> <bar> <baz>." | riot.bat -syntax turtle -
<http://base/foo> <http://base/bar> <http://base/baz> .

You cannot set an empty base. @base can be relative, but it's again resolved to that default random base:

$ echo "@base <>. <foo> <bar> <baz>." | riot.bat -syntax turtle -
<http://base/foo> <http://base/bar> <http://base/baz> .

JSONLD fields declared of type @id or @vocab are expanded to full URIs by the time they get to SHACL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant