Skip to content

Enable rdf validate compare graph names with blank nodes #99

@adanilenka

Description

@adanilenka

So currently, rdf validate command with --compare-to-rdf-file cannot properly validate quads where the name of the graph is a blank node in certain cases.

Example input:

<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/B> .
<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/C> <http://example.org/graph/G>.
<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/D> _:bn1.

Encoding and decoding these n-quads with:

jelly-cli rdf to-jelly ./in_001.nq --to ./out.jelly --opt.generalized-statements=false --opt.rdf-star=false --opt.max-name-table-size=8 --opt.max-prefix-table-size=0 --opt.max-datatype-table-size=4

jelly-cli rdf from-jelly ./out.jelly --to ./deserialized_001.nq

Gives the output of:

<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/B> .
<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/C> <http://example.org/graph/G> .
<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/D> _:B66a3e1ec00fdd8c0072f62662a2f5b2a .

So the only difference really is the ID of the blank node. For triples, rdf validate handles BNs, but running
jelly-cli rdf validate ./out.jelly --compare-to-rdf-file ./in_001.nq

Gives the following error:

Image

What is interesting is that adding --compare-ordered=true removes the error, and validation goes okay.

Also, the ID of the dataset in the error changes each run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions