Outils pour utilisateurs

Outils du site


thatcamp_2014:requete_dbpedia

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
thatcamp_2014:requete_dbpedia [2014/08/31 09:29]
Francesco Beretta
thatcamp_2014:requete_dbpedia [2014/10/29 12:03] (Version actuelle)
Ligne 1: Ligne 1:
 +
 +====== Données exploitables ======
 +
 +
 +===== Production de données =====
 +
 +[31.08.2014] 3837 lignes si on enlève le limit
 +
 +
 +<​code>​
 +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
 +  }
 +</​code>​
 +
 +{{:​thatcamp_2014:​resultat_corrige.csv.zip|Fichier nettoyé}}, utilisable dans QGIS (séparateur |)
 +
 +
 +
 +====== Exploration ======
 + 
 +
 +Point d'​accès SPARQL : http://​dbpedia-live.openlinksw.com/​sparql
 +
 +
 +
 +
 +===== Nombre d'​universités dans dbpedia live =====
 +
 +
 +
 Chercher toutes les univesités Chercher toutes les univesités
  
Ligne 12: Ligne 67:
 </​code>​ </​code>​
  
 +
 +
 +
 +
 +[31.08.2014} Résultat: 4303
 +<​code>​
 +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}
 +      }
 +  }
 +
 +</​code>​
 +
 +
 +[31.08.2014} Résultat: 4317 – vérifier pourquoi il y en a plus
  
 <​code>​ <​code>​
Ligne 32: Ligne 110:
   }   }
  
 +</​code>​
 +
 +
 +
 +===== Jointure avec GEONAMES =====
 +En cours de test
 +<​code>​
 +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
 +          }
 +      }
 +  }</​code>​
 +  ​
 +  ​
 +  ​
 +La fonction de filtre ne semble pas être activée :
 +  ​
 + 
 +  ​
 +<​code>​
 +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
 </​code>​ </​code>​
thatcamp_2014/requete_dbpedia.1409470181.txt.gz · Dernière modification: 2014/10/29 12:03 (modification externe)