Closed Mec-iS closed 2 years ago
By the way, Oxigraph does not pass all official SPARQL tests. This is mostly due to the fact that Oxigraph storage normalizes literals like numbers. For example "01"^^xsd:integer
and "1"^^xsd:integer
are considered to be the same. This leads to the failure of some tests taking care of duplicates. The list of failing test is here.
Is there any straightforward way of making rdflib
SPARQL query to return serialised data (ttl or xml) instead of the row iterator?
or what is the given way of testing the result of an rdflib query to a given ttl file? @ceteri
Is there any straightforward way of making
rdflib
SPARQL query to return serialised data (ttl or xml) instead of the row iterator?or what is the given way of testing the result of an rdflib query to a given ttl file? @ceteri
RDFlib provides a parser for SPARQL results encoded in RDF. Then it uses this function to check if results sets are compatible.
I tried in Oxigraph to compare results set encoded in RDF using the graph isomorphism algorithm. It was very slow because results sets encoded in RDF contains a lot of blank nodes only connected to other blank nodes, making the hash based alogirthms not very efficient...
In some tests kglab
fails, most of them are "Python recursion limit exceeded".
@Mec-iS this is excellent, and @Tpt thank you kindly!
In terms of graph isomorphism algorithms, I wish there was more open source available for graph sketch algorithms. That might help with the costs. I've only found one https://github.com/kenkoooo/graph-sketch-fractality although it's based on a CLI and not quite the similarity measures that we'd need.
From #248
This is the first draft for implementing automated RDF tests. The first batch of test from
RDF-tests
(basic) can be run withpytest tests/rdf_tests/test_rdf_basic.py -k test_rdf_runner -s
from the project directory; tests are intests/rdf_tests/dat
. For the moment the only assertion implemented is a check on the length of returned results. This is already interesting as some kg query outputs return more or less bindings compared to the expected ones.The script should work also on
oxigraph-tests
but it doesn't, it seems theread_manifest
file provided withrdflib
cannot parse the oxigraph manifest, maybe a discrepancy in the XML structure? @Tpt please provide some feedback.Currently the tests are cut-pasted.
Tests with anomalies:
The ones resulting in "False" mean length discrepancies between expected and actual output, the one with errors are exceptions raised.