From 7eab9fe5c755fd186c8cb8a7c14c16df40e9d25b Mon Sep 17 00:00:00 2001 From: Gabriel De La Parra Date: Sun, 24 Oct 2021 16:48:07 +0200 Subject: [PATCH] Set QueryTimeout to 10s. --- SparqlForHumans.Lucene/Queries/Graph/QueryGraphResults.cs | 6 +++--- SparqlForHumans.Wikidata/Services/GraphApiQueries.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SparqlForHumans.Lucene/Queries/Graph/QueryGraphResults.cs b/SparqlForHumans.Lucene/Queries/Graph/QueryGraphResults.cs index 7c2d399a..39cd64f2 100644 --- a/SparqlForHumans.Lucene/Queries/Graph/QueryGraphResults.cs +++ b/SparqlForHumans.Lucene/Queries/Graph/QueryGraphResults.cs @@ -34,7 +34,8 @@ public void GetGraphQueryResults(QueryGraph graph, string entitiesIndexPath, str var tasks = runOnEndpoint ? RunWikidataEndpointQueries(graph, 1000) : new List>(); - if (runNodeQueries) RunNodeQueries(graph); + if (runNodeQueries) + RunNodeQueries(graph); RunEdgeQueries(graph); @@ -231,8 +232,7 @@ private void RunNodeQueries(QueryGraph graph) if (node.IsInstanceOf) { //Intersect (Not if any, we want only the results of that instance, even if there are none): - var instanceOfResults = - new BatchIdEntityInstanceQuery(graph.EntitiesIndexPath, node.ParentTypes, 200).Query(20).ToList(); + var instanceOfResults = new BatchIdEntityInstanceQuery(graph.EntitiesIndexPath, node.ParentTypes, 200).Query(20).ToList(); node.Results = instanceOfResults; //TODO: Not sure if the previous run should consider this: //node.Results = node.Results.Intersect(instanceOfResults).ToList(); diff --git a/SparqlForHumans.Wikidata/Services/GraphApiQueries.cs b/SparqlForHumans.Wikidata/Services/GraphApiQueries.cs index 38accb87..c43be144 100644 --- a/SparqlForHumans.Wikidata/Services/GraphApiQueries.cs +++ b/SparqlForHumans.Wikidata/Services/GraphApiQueries.cs @@ -8,7 +8,7 @@ namespace SparqlForHumans.Wikidata.Services { public static class GraphApiQueries { - public static int QueryTimeoutMs { get; set; } = 3000; + public static int QueryTimeoutMs { get; set; } = 10000; public static SparqlResultSet RunQuery(string sparqlQuery, bool runOnEndpoint = true) { if (!runOnEndpoint)