-
Notifications
You must be signed in to change notification settings - Fork 61
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
Blank prefixes in SHACL property paths error out #112
Comments
I believe this is due to standard Jena behavior. RuleUtil will wrap the data graph into a MultiUnion together with the inferred triples. That MultiUnion uses this prefix mapping, which only looks for the empty (default) prefix in the base graph, see the prefix.length() > 0 in PolyadicPrefixMappingImpl in Jena:
The philosophical issue behind this is that the default namespace should only apply to the base graph of a MultiUnion. In general, I would strongly discourage the use of default prefixes as some tools or users will mix them up across graphs. As seen above :) I guess the change that I could make is to add
to RuleUtil, right after the upper unionGraph is created (line 96 in my version). Are you able to try this out in your environment to confirm this improves things? I have run this locally and it seems to parse OK afterwards. As stated on #111 I will put this into our local copy before applying the same change to the open source repo in the future. |
ARQFactory removes "":
|
That's correct, but the next line pm.setNsPrefixes(map); does not delete the "" prefix from the underlying PrefixMapping, if that already defines one. The fix mentioned above does resolve the issue for me though, by setting the base graph. |
Thank you, can confirm, after adding the example as a resource file, adapting the
On current master efc9fcc |
I have put this on master, and noticed it should have been shapesModel, not dataModel. The latter only worked if both graphs were the same. I believe this closes the ticket. |
I think I have an expansion upon this issue, that may warrant re-opening it: running on latest version (1.4.2) in windows 10. Shapes:
data:
Running the shacl validate command returns an error:
I generally try to avoid using the default prefix, but this is not a sustainable solution - given the fact that empty prefix is a valid component of rdf/ttl serialization. If there is no fix, I have to switch to using Jena shacl for some clients which use the empty prefix, which I would love to avoid since I really like this CLI version. |
@rmfranken - your example needs a triple-backtick to box it. It also means whoever has GH handle 'prefix' doesn't get notifications! |
Sorry for the delay. Fix is on master (hopefully). |
For the following minimum reproducible example:
Running
$ ./shaclinfer.sh -datafile data_shapes_file.ttl
produces the following exception:This seems like a bug, since I would expect the blank prefix to work like in all other constructs.
For reference and as a control test, changing this to a non-blank prefix:
fixes the issue
$ ./shaclinfer.sh -datafile data_shapes_file.ttl
:I am running the latest SHACL API v1.3.2 on x64 linux.
The text was updated successfully, but these errors were encountered: