Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Forget it. You won't be able to get that query back from dbpedia with just one SPARQL. Those optionals are very expensive.</p> <p>To work it around you need to first run something like:</p> <pre><code> SELECT DISTINCT ?uri WHERE { ?uri rdf:type dbpedia-owl:EducationalInstitution . ?uri foaf:name ?name . } ORDER BY ?uri LIMIT 20 OFFSET 10 </code></pre> <p>Then iterate over the resultset of this query to form single queries for each <code>dbpedia-owl:EducationalInstitution</code> such as ... (notice the filter at the end of the query):</p> <pre><code> 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 } . FILTER (?uri = &lt;http://dbpedia.org/resource/%C3%89cole_%C3%A9l%C3%A9mentaire_Marie-Curie&gt;) } </code></pre> <p>Where <code>&lt;http://dbpedia.org/resource/%C3%89cole_%C3%A9l%C3%A9mentaire_Marie-Curie&gt;</code> has been obtained from the first query.</p> <p>... and yes it will be slow and you might not be able to run this for an online application. Advice: try to work out some sort of caching mechanism to sit between your app and the dbpedia SPARQL endpoint. </p>
 

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