metaphacts / semopenalex

42 stars 5 forks source link

return error message if query timeout is reached #119

Open VladimirAlexiev opened 2 months ago

VladimirAlexiev commented 2 months ago

This query returns "No results"

PREFIX soa: <https://semopenalex.org/ontology/>
select * {
#  {select ?typeOfPrice (count(*) as ?c1) {
#    ?x soa:hasPrice []; a ?typeOfPrice
#  } group by ?typeOfPrice}
  {select ?typeOfValue (count(*) as ?c2) {
    ?x soa:hasValue []; a ?typeOfValue
  } group by ?typeOfValue}
}

But if you query for a few instances, you get results

PREFIX soa: <https://semopenalex.org/ontology/>
select * {
  ?x soa:hasValue ?y; a ?type
} limit 10

So the big query has timed out. Saying that there are no results is misleading. Furthermore, if you uncomment the 3 lines, the first subquery is also spoliated and the total query returns no results. Instead, the timeout in the subquery should be marked as an error, propagated outwards, and return an error for the outer query

VladimirAlexiev commented 2 months ago

Another slow query that returns "No results" after 11.4s:

PREFIX soa: <https://semopenalex.org/ontology/>
select ?type (count(*) as ?c) {
  ?x soa:hasMesh ?mesh.
  ?mesh a ?type.
} group by ?type

I think the timeout should be increased to say 60s?

VladimirAlexiev commented 2 months ago

@davidlamprecht For the implicit query timeout, there is a checkbox in the repo creation form: image