Virtuoso 37000 Error TR...: Query contains a transitive derived table but neither end of it is bound by equality to other columns or parameters
In 616e55a4f8c14c124479594e743fed76062d313b
The following query gives this weird error:
Virtuoso 37000 Error TR...: Query contains a transitive derived table but neither end of it is bound by equality to other columns or parameters
SPARQL query:
define sql:big-data-const 0
#output-format:text/html
define sql:signal-void-variables 1 select ?super ?sub (count(?mid) as ?distance) {
?super (ares:spolecnici-s-vkladem/ares:spolecnictvi-s-vkladem/ares:spolecnik-s-vkladem)* ?mid .
?mid (ares:spolecnici-s-vkladem/ares:spolecnictvi-s-vkladem/ares:spolecnik-s-vkladem)+ ?sub .
}
group by ?super ?sub
order by ?super ?sub
I have been able to recreate against local database and reported to development to look into ...
Any updates on this?
@mommi84 @jakubklimek /cc @HughWilliams @iv-an-ru @IvanMikhailov
Unfortunately, this report is not self-contained. As reported, the query lacks a definition for the ares: prefix, and does not include a link to the relevant test dataset ... nor is it executable on a public endpoint/dataset, such as DBpedia, URIburner, demo.openlinksw.com, etc.
@jakubklimek - We would appreciate it if you could update this report with such details, especially if you can reproduce it with a current Virtuoso instance, whether public or private.
@mommi84 - If you've encountered this with your own dataset and query, those details would also be helpful, including the specific version of your Virtuoso instance.
@TallTed I googled the query above and found an answer from @kidehen in this thread: https://sourceforge.net/p/virtuoso/mailman/message/35829035/
It seems that a simple sub-query workaround solves the issue. Here is an example with rdfs:subClassOf on DBpedia.
Endpoint: http://dbpedia.org/sparql Graph: http://dbpedia.org/resource/classes# Query:
SELECT ?super ?sub (count(?mid) as ?distance)
WHERE {
{
SELECT distinct ?super
WHERE {
?x rdfs:subClassOf ?super
}
}
?mid rdfs:subClassOf* ?super.
?sub rdfs:subClassOf+ ?mid.
}
GROUP BY ?super ?sub
ORDER BY DESC(?distance) ?super ?sub
LIMIT 100
Link: https://bit.ly/2zNCI9u Version: 07.20.3229
@mommi84 - Excellent! I thought this looked familiar...
@jakubklimek - Would you concur that this issue may be considered Closed?
The issue seems to be closely related to a technique to gather paths in SPARQL (i.e. not only the start- and end point but the whole path) that I learned about on Stack Overflow here. I've tested a similar query on a number of RDF stores (namely Stardog, Oxigraph, rdf4j, GraphDB, RDFox, Allegrograph, Dydra, QLever and Jena-Fuseki), but only Virtuoso throws this error. You might consider to do something more about it, at least let the error message point to a description for the solution?
We are going to schedule to revise this issue ...