[31.08.2014] 3837 lignes si on enlève le limit
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX dbpprop: <http://dbpedia.org/property/> SELECT * WHERE { SELECT DISTINCT ?s (strafter(str(?s), "http://dbpedia.org/resource/") AS ?id_name) ?name (xsd:float(strbefore(?point, " ")) AS ?lat) (xsd:float(strafter(?point, " ")) AS ?long) (max(?nombre_etudiants) AS ?nombre) WHERE { SERVICE <http://dbpedia-live.openlinksw.com/sparql> { ?s dbpprop:type dbpedia:Public_university . ?s <http://www.georss.org/georss/point> ?point OPTIONAL { ?s dbpprop:name ?name } OPTIONAL { { SELECT * WHERE { ?s dbpprop:students ?nombre_etudiants } } } } } GROUP BY ?s ?point ?name LIMIT 10 }
Fichier nettoyé, utilisable dans QGIS (séparateur |)
Point d'accès SPARQL : http://dbpedia-live.openlinksw.com/sparql
Chercher toutes les univesités
select count(*) where{ select distinct * where {?s dbpprop:type dbpedia:Public_university; georss:point ?localisation} #limit 10 }
[31.08.2014} Résultat: 4303
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX dbpprop: <http://dbpedia.org/property/> SELECT (count(*) AS ?nombre) WHERE { SELECT DISTINCT * WHERE { SERVICE <http://dbpedia-live.openlinksw.com/sparql> { ?s dbpprop:type dbpedia:Public_university} } }
[31.08.2014} Résultat: 4317 – vérifier pourquoi il y en a plus
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX dbpprop: <http://dbpedia.org/property/> SELECT (count(*) AS ?nombre) WHERE { SELECT DISTINCT * WHERE { SERVICE <http://dbpedia-live.openlinksw.com/sparql> { ?s dbpprop:type dbpedia:Public_university OPTIONAL { ?s dbpprop:city ?city { ?city dbpedia-owl:type dbpedia:City } } } } }
En cours de test
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX dbpprop: <http://dbpedia.org/property/> SELECT * # (count(*) AS ?nombre) WHERE { SELECT DISTINCT * WHERE { SERVICE <http://dbpedia-live.openlinksw.com/sparql> {SELECT * WHERE { ?s dbpprop:type dbpedia:Public_university . ?s dbpprop:city ?city . ?city dbpedia-owl:type dbpedia:City . ?city <http://www.w3.org/2002/07/owl#sameAs> ?geonames } limit 100} SERVICE <http://factforge.net/sparql> { SELECT * WHERE { ?geonames geo:lat ?lat . ?geonames geo:long ?lon} limit 1 } } }
La fonction de filtre ne semble pas être activée :
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX dbpprop: <http://dbpedia.org/property/> SELECT DISTINCT * WHERE { ?s dbpprop:type dbpedia:Public_university . ?s dbpprop:city ?city . ?city dbpedia-owl:type dbpedia:City . OPTIONAL {?city <http://www.w3.org/2002/07/owl#sameAs> ?geonames . # FILTER (substr(xsd:str(?geonames), 1, 15) = "http://sws.geon") } } LIMIT 10