rudof-project / rudof

RDF data shapes implementation in Rust
https://rudof-project.github.io
Apache License 2.0
35 stars 3 forks source link

Error creating the Graph in-memory #147

Open acka47 opened 2 months ago

acka47 commented 2 months ago

When testing out rudof with the SkoHub shapes repo at https://github.com/skohub-io/skohub-shapes I ran into the follwoing problem:

~/git/skohub-shapes$ rudof shacl-validate -s skos.shacl.ttl tests/valid/skos.shacl.ttl/ex24.ttl 
Error: Error during the creation of the Graph: Error creating the Graph in-memory

It works fine when I do the same with Jena, though:

~/git/skohub-shapes$ shacl validate -s skos.shacl.ttl -d tests/valid/skos.shacl.ttl/ex24.ttl 
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sh:   <http://www.w3.org/ns/shacl#>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>

[ rdf:type     sh:ValidationReport;
  sh:conforms  true
] .

I am on Linux Mint Debian Edition (LMDE) 6 (faye).

labra commented 2 months ago

Thanks for the issue. I was trying to check if rudof can at least parse the Turtle files, and one issue is that the file tests/valid/skos.shacl.ttl/ex24.ttl contains a node with a relative URI: <Protein> which at this moment the rudof Turtle parser reports as an error.

You can check if rudof parses an RDF data just running:

rudof data tests/valid/skos.shacl.ttl/ex24.ttl

and the more descriptive error message:

Error: Parser error between at line 7 between columns 1 and column 10: No scheme found in an absolute IRI

One simple solution is to add a base declaration to the file with a line like the following after the prefix declaration:

@base <http://example.org/> .

Nevertheless another solution we did in Shaclex was to include a default base declaration so relative URIs resolve to that URI. I have just added a new issue to consider it: #149

If you add the base declaration, you can see that the SHACL validator works as expected:

rudof shacl-validate -s skos.shacl.ttl tests/valid/skos.shacl.ttl/ex24.ttl                                                     13:07:43
Result:
Validation Report: [
        conforms: true,
        result:
]

We can keep this issue open until we solve #149

acka47 commented 2 months ago

Thanks for the quick response! It's very good to know about rudof data ... to check for parsing problems.

labra commented 2 months ago

I have done some changes to the default configuration of the RDF data reader and now it takes a default base IRI (it can be customized through a config file) which allows to parse RDF files with relative IRIs.

A new release v0.1.24 is being published which I think solves your problem. If you try it and it works, let us know (you can just close this issue).

acka47 commented 2 months ago

Thanks, I will try it out tomorrow. Currently, I am sitting on a PC with Linux Mint 20.3 Cinnamon that has not the required libc6 version (2.31 and rudof requires >=2.34). Thus, I can not install it quickly on this machine.

labra commented 2 months ago

Thanks, I will try it out tomorrow. Currently, I am sitting on a PC with Linux Mint 20.3 Cinnamon that has not the required libc6 version (2.31 and rudof requires >=2.34). Thus, I can not install it quickly on this machine.

No problem...just out of curiosity, you need libc6 because you compile it yourself, right? or is it necessary when you run from the distributed binary package?

acka47 commented 2 months ago

just out of curiosity, you need libc6 because you compile it yourself, right? or is it necessary when you run from the distributed binary package?

The error comes when trying to install the binary package:

$ sudo dpkg -i rudof_v0.1.24_amd64.deb 
(Reading database ... 1020037 files and directories currently installed.)
Preparing to unpack rudof_v0.1.24_amd64.deb ...
Unpacking rudof-cli (0.1.24-1) over (0.1.24-1) ...
dpkg: dependency problems prevent configuration of rudof-cli:
 rudof-cli depends on libc6 (>= 2.34); however:
  Version of libc6:amd64 on system is 2.31-0ubuntu9.16.

dpkg: error processing package rudof-cli (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 rudof-cli
labra commented 2 months ago

Thanks for the info...I created an independent issue #154 to investigate about the issue.