Note that there are some explanatory texts on larger screens.

plurals
  1. POOptimization of SPARQL query. [ Estimated execution time exceeds the limit of 1500 (sec) ]
    primarykey
    data
    text
    <p>I am trying to run this query on <a href="http://dbpedia.org/sparql" rel="nofollow">http://dbpedia.org/sparql</a> but I get an error that my query is too expensive. When I run the query trough <a href="http://dbpedia.org/snorql/" rel="nofollow">http://dbpedia.org/snorql/</a> I get: </p> <pre><code>The estimated execution time 25012730 (sec) exceeds the limit of 1500 (sec) ... </code></pre> <p>When running the query through my python script using SPARQLWrapper I simply get an HTTP 500.</p> <p>I figure I need to do something to optimize my SPARQL query. I need the data for iterating over educational institutions and importing it in to a local database, maybe I am using SPARQL wrong and should do this in a fundamentally different way.</p> <p>Hope someone can help me!</p> <h1>The query</h1> <pre><code>PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt; PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt; PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt; PREFIX : &lt;http://dbpedia.org/resource/&gt; PREFIX dbpedia2: &lt;http://dbpedia.org/property/&gt; PREFIX dbpedia: &lt;http://dbpedia.org/&gt; PREFIX skos: &lt;http://www.w3.org/2004/02/skos/core#&gt; SELECT DISTINCT ?uri ?name ?homepage ?student_count ?native_name ?city ?country ?type ?lat ?long ?image WHERE { ?uri rdf:type dbpedia-owl:EducationalInstitution . ?uri foaf:name ?name . OPTIONAL { ?uri foaf:homepage ?homepage } . OPTIONAL { ?uri dbpedia-owl:numberOfStudents ?student_count } . OPTIONAL { ?uri dbpprop:nativeName ?native_name } . OPTIONAL { ?uri dbpprop:city ?city } . OPTIONAL { ?uri dbpprop:country ?country } . OPTIONAL { ?uri dbpprop:type ?type } . OPTIONAL { ?uri geo:lat ?lat . ?uri geo:long ?long } . OPTIONAL { ?uri foaf:depiction ?image } . } ORDER BY ?uri LIMIT 20 OFFSET 10 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload