VDS.RDF.Query.RdfQueryTimeoutException on dotnetRDF

0

I am running the SPARQL query in dotNetRDF C#, and getting this error:

VDS.RDF.Query.RdfQueryTimeoutException
HResult=0x80131500
Message=Query Execution Time exceeded the Timeout of 180000ms; query aborted after 366471ms
Source=dotNetRDF

Whereas the same query performance on Apache Jena and Python(rdflib) is 25.60 sec and 179.94 sec, respectively.

So, is there any way to increase the timeout of the query on dotNetRDF, here I am enclosing query fetched from LinkedMovie dataset.

PREFIX linkedmdb: <http://data.linkedmdb.org/movie/>
PREFIX dc: <http://purl.org/dc/terms/>

SELECT ?movie1 ?actor1 ?movie2 ?actor2 ?movie3 ?actor3 ?movie4 ?actor4 ?movie5
WHERE {
    # select the source and target nodes
    ?s linkedmdb:actor_name "Hugh Jackman" .
    ?t linkedmdb:actor_name "Kevin Bacon" .

    # find the five movies and the connecting actors between (make sure to filter out dupes)
    ?m1 dc:title ?movie1 ; linkedmdb:actor ?s ; linkedmdb:actor ?a1 .
    FILTER(?s != ?a1 && ?t != ?a1)

    ?m2 dc:title ?movie2 ; linkedmdb:actor ?a1 ; linkedmdb:actor ?a2 .
    FILTER(?m1 != ?m2)
    FILTER(?a1 != ?a2)
    FILTER(?s != ?a2 && ?t != ?a2)

    ?m3 dc:title ?movie3 ; linkedmdb:actor ?a2 ; linkedmdb:actor ?a3 .
    FILTER(?m1 != ?m3 && ?m2 != ?m3)
    FILTER(?a1 != ?a3 && ?a2 != ?a3)
    FILTER(?s != ?a3 && ?t != ?a3)

    ?m4 dc:title ?movie4 ; linkedmdb:actor ?a3 ; linkedmdb:actor ?a4 .
    FILTER(?m1 != ?m4 && ?m2 != ?m4 && ?m3 != ?m4)
    FILTER(?a1 != ?a4 && ?a2 != ?a4 && ?a3 != ?a4)
    FILTER(?s != ?a4 && ?t != ?a4)

    ?m5 dc:title ?movie5 ; linkedmdb:actor ?a4 ; linkedmdb:actor ?t .
    FILTER(?m1 != ?m5 && ?m2 != ?m5 && ?m3 != ?m5 && ?m4 != ?m5)

    # grab the actor names - much friendlier than the URIs
    ?a1 linkedmdb:actor_name ?actor1 .
    ?a2 linkedmdb:actor_name ?actor2 .
    ?a3 linkedmdb:actor_name ?actor3 .
    ?a4 linkedmdb:actor_name ?actor4 .
    }
    LIMIT 1
dotnetrdf
asked on Stack Overflow Sep 16, 2020 by bamboat_3

1 Answer

0

Query timeout settings are controlled through the static VDS.RDF.Options.QueryExecutionTimeout property, as well as through the Timeout property of individual SparqlQuery instances. However the global timeout set through VDS.RDF.Options always provides an upper-bound (unless it is set to 0 indicating no global timeout). As the default global timeout is 3 minutes (180,000ms) you will need to increase this global setting to execute a query for longer than that.

Please see the User Guide page on Global Options for details about changing the timeout values for queries (in the section on Query Options).

For details about what optimisations are applied during query please see the Developer Guide page on SPARQL optimisation.

answered on Stack Overflow Sep 16, 2020 by Kal • edited Sep 17, 2020 by Kal

User contributions licensed under CC BY-SA 3.0