-
Notifications
You must be signed in to change notification settings - Fork 9
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
rdflib_hdt.optimize_sparql() produces incorrect results #14
Comments
It looks like the focus for this issue is https://github.com/RDFLib/rdflib-hdt/blob/master/rdflib_hdt/sparql_op.py. At only 43 lines, it seems to be an innocent enough function. Nothing jumps out at me as trigging this issue. A next step might be stepping through the execution of the test case. |
I was able to confirm that within
Using URIRef('http://purl.org/acoli/open-ie/types:entity') gives 794 results. So, it looks like the problem is inside |
Execution seems to be picking up a debugging statement from https://github.com/rdfhdt/hdt-cpp/blob/develop/libhdt/src/sparql/QueryProcessor.cpp#L117 |
Using the command line
Therefore, my current guess is that something weird is happening when Python hands off the pattern to the C++ QueryProcessor::searchJoin() function. |
The hdtSearch CLI tool is calling hdt::search(). QueryProcessor::searchJoin() has odd semantics and a different code path. It is not calling hdt::search(). Some reconciliation is needed to align rdflib's BGP approach and how individual patterns should be handled in the SPARQL optimization function. The hdt-cpp QueryProcessor::searchJoin() is either fundamentally broken, which could be the case given the print lines in there, or hdt::search() is a better fit and multiple patterns should be ANDed together in a different way. |
Describe the bug
When querying in SPARQL mode, a query statement for which no variable binding can be found will bind to all triples in the graph. It should bind to none. This behavior appears after calling
rdflib_hdt.optimize_sparql()
To Reproduce
Steps to reproduce the behavior:
python3 hdt-test.py
Expected behavior
The last query should not return any results
System:
The text was updated successfully, but these errors were encountered: