-
Notifications
You must be signed in to change notification settings - Fork 52
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
Failed to parse the Service result as JSON #1427
Comments
"the Service result" probably means what You could use QLever's Wikidata endpoint instead, if you change the |
If I switch from WDQS to QLever Wikidata, the error is different: Finally, after I added the |
Thanks for the quick reply and support! I am really impressed with the performance of Qlever demos. I have changed the service request to your SPARQL endpoint, and I had the following error after more than 1 minute of execution. However, the subquery in the service query has only projections without blank nodes as values. {
"exception": "Blank nodes in the result of a SERVICE are currently not supported. For now, consider filtering them out using the ISBLANK function or converting them via the STR function.",
"query": "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX wdt: <http://www.wikidata.org/prop/direct/>\nPREFIX wd: <http://www.wikidata.org/entity/>\nPREFIX emi: <https://purl.org/emi#>\nPREFIX sosa: <http://www.w3.org/ns/sosa/>\nPREFIX prov: <http://www.w3.org/ns/prov#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\nSELECT ?extract ?organe ?species_name ?genus_name ?family_name ?count_of_selected_class\nWHERE\n { \n ?material sosa:hasSample ?extract .\n ?material sosa:isSampleOf ?organe .\n ?organe emi:inTaxon ?wd_sp .\n OPTIONAL\n {\n SERVICE <https://qlever.cs.uni-freiburg.de/api/wikidata> {\n ?wd_sp wdt:P225 ?species_name .\n ?family wdt:P31 wd:Q16521 ;\n wdt:P105 wd:Q35409 ;\n wdt:P225 ?family_name ;\n ^wdt:P171* ?wd_sp .\n ?genus wdt:P31 wd:Q16521 ;\n wdt:P105 wd:Q34740 ;\n wdt:P225 ?genus_name ;\n ^wdt:P171* ?wd_sp \n }\n }\n {\n SELECT ?extract (COUNT(DISTINCT ?feature) AS ?count_of_selected_class)\n WHERE\n { \n ?extract rdf:type emi:ExtractSample .\n ?extract sosa:isFeatureOfInterestOf ?lcms .\n ?lcms rdf:type emi:LCMSAnalysis .\n ?lcms emi:hasLCMSFeatureSet ?feature_list .\n ?feature_list emi:hasLCMSFeature ?feature .\n ?feature emi:hasAnnotation ?canopus .\n \t?canopus rdf:type emi:ChemicalTaxonAnnotation . \n ?canopus emi:hasClass ?np_class .\n \t?np_class rdfs:label \"Aspidosperma type\" .\n ?canopus emi:hasClassProbability ?class_prob .\n FILTER((?class_prob > 0.5)) .\n } GROUP BY ?extract ORDER BY DESC(?count_of_selected_class)\n }\n } \n",
"resultsize": 0, The second issue to rely on your Wikidata endpoint, it may result on not having access to the latest Wikidata data. Moreover, the no JSON response from Wikidata is due to an error in Wikidata (out of memory). After a quick test, if we try to run the Wikidata part of the query without considering the results from the outer query (qlever BGP processing), we get either a timeout or out of memory error because Qlever is not considering the results of the outer query to filter the results from the inner query (service subquery - query plan related issue?).
|
Here's an example of a taxon whose taxon name is an "unknown value" in Wikidata, and this is represented as a blank node in RDF: https://www.wikidata.org/wiki/Q21362983 If the top-level query result shouldn't have any such results, it may be a signal that the query plan is indeed non-optimal regarding this subquery.
I believe there's work in progress to implement rolling updates in QLever's Wikidata endpoint. [I'm not a member of the QLever developer team but a Wikidata contributor.]
Right - WDQS is known to have scaling issues, but this could also be because of QLever making a non-optimal query plan?
Just to clarify, are you saying that QLever is not sending the values of If you have a QLever UI for your endpoint, you can click the button "Analysis" to view the query plan. (Otherwise, it's included in the JSON response which may be difficult to read.) I don't know if the heuristics can be tweaked, but by reorganising the subqueries, I'm indeed getting the query to complete (with one result - is that the correct result?): https://qlever.cs.uni-freiburg.de/wikidata/uAxDnP |
Thanks, please see below my replies:
Yes, I think so.
Sorry, I don't have it but I have provided the query and dataset to replicate the issue.
Yes, thanks. You can verify it with the link I provided when I opened this issue. When executing the same query in graphdb (that is also faster for this query) at the sparql endpoint: https://biosoda.unil.ch/graphdb/repositories/emi-dbgi) : |
@hannahbast Could you have a brief look at this issue? Basically, are the statements within a |
Hi @tuukka and @tarcisiotmf , Thanks for your interest in QLever. I found the time to look at your issue, and I can say the following:
You current workarounds thus are:
In general: Nice that you have set up a local SPARQL endpoint for your data. I would highly recommend to also set up the qlever ui, as its analysis capabilities are really really useful, especially when sharing the results. |
Nice! With this approach, I'm seeing times a bit below 3s when the cache is clean. With the better query plan, you can also go back to federating to |
By the way, I think this is something that a lot of queries currently suffer from and it seems it's not easy to work around. @joka921 Could a solution to this be prioritized? For example, we add optional labels and other supplementary information as an afterthought with the intuition that for a reasonable number of results, it shouldn't be a lot of additional computation. I see #314 is related but this one should be much easier - more or less the same as sending |
@joka921 Thank you very much for the clarification about the current Qlever limitations. Thanks, @tuukka, for your interest in this issue, it has been really helpful ! Please, do as you think it is more appropriate (closing this issue, and opening new issues). In my opinion, there are 3 different issues resulted from this one:
|
Hi, |
When executing the query below with qlever the error below is raised. I have executed the same query in graphdb and it worked as expected. You can replicate the error with the following links:
Executing query with qlever
Executing query with graphdb, select emi-dbgi repository
The dataset used in our test is available here.
exception": "Failed to parse the Service result as JSON. First 100 bytes: SPARQL-QUERY: queryStr=
...The text was updated successfully, but these errors were encountered: