Skip to content
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

RDF::Trine::Store::SPARQL->get_contexts() doesn't work with Virtuoso #140

Open
minusdavid opened this issue Nov 17, 2016 · 4 comments
Open
Assignees

Comments

@minusdavid
Copy link
Contributor

I tried RDF::Trine::Store::SPARQL->get_contexts() with Virtuoso 06.01.3127 on Debian 7 Wheezy but it didn't return any results despite there being 4 graphs there.

The query in the module is: 'SELECT DISTINCT ?g WHERE { GRAPH ?g {} }';
It produces this error when I try it by hand: Virtuoso 37000 Error SP030: SPARQL compiler, line 3: syntax error at ''SELECT DISTINCT ?g WHERE { GRAPH ?g {} }'' before ';'

However, the following query works:
"SELECT DISTINCT ?g {
GRAPH ?g { ?s ?p ?o . }
}"

I found the workable query via the following link:
https://issues.apache.org/jira/browse/MARMOTTA-597

@minusdavid minusdavid changed the title RDF::Trine::Store::SPARQL->get_contexts() doesn't work RDF::Trine::Store::SPARQL->get_contexts() doesn't work with Virtuoso Nov 17, 2016
@kasei
Copy link
Owner

kasei commented Nov 17, 2016

Hi @minusdavid. This is a known bug in Virtuoso that Openlink seems unwilling to fix. The workaround query you suggest would work, but can be VERY expensive to execute on various SPARQL implementations and so I've never been interested in changing get_contexts universally. That being said, if you (or someone else) would like to explore implementation approaches that would only perform that query conditionally (or automatically if it can be determined that the endpoint is running Virtuoso), I'd be happy to consider a PR.

@minusdavid
Copy link
Contributor Author

Cheers @kasei, and thanks for the quick reply. I've only started playing around with Virtuoso and I'm noticing other bugs and non-conformance with the SPARQL specs, so I'm thinking of abandoning it as a triplestore in any case.

I noticed I couldn't add triples via the SPARQL store work either, since Virtuoso uses "query" instead of "update" and requires "query" to be in the query string rather than in the request message body. It seems utterly bizarre...

But reassuring that RDF::Trine is doing things the right way! Now I just need to find a triplestore that also works correctly.

@minusdavid
Copy link
Contributor Author

Looks like maybe newer versions of Virtuoso don't have that SPARQL update problem (openlink/virtuoso-opensource#215), but that's unfortunate about get_contexts..

@minusdavid
Copy link
Contributor Author

That said, regarding the update problem, it looks like RDFLib made a workaround like you suggested (rancas/rdflib@09a275b).

@kasei kasei self-assigned this Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants