Wikidata:SPARQL query service/queries/examples/fr

From Wikidata
Jump to navigation Jump to search
This page is a translated version of the page Wikidata:SPARQL query service/queries/examples and the translation is 97% complete.

Other languages:
català • ‎čeština • ‎Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎lietuvių • ‎Bahasa Melayu • ‎Nederlands • ‎polski • ‎русский • ‎svenska • ‎українська
Warning: Modifier cette page changera les exemples affichés sur query.wikidata.org

Cette page est analysée par l'interface web du Query Service pour remplir la liste d'exemples de requêtes.

Merci d'ajouter un commentaire dans la requête pour indiquer ce qu'elle illustre, quand et par qui elle a été écrite, et quelles sont ses limitations au regard des données actuelles et de l'usage des propriétés dans Wikidata.

Contents

Voir aussi

Requêtes simples

Ces requêtes simples aident à comprendre SPARQL et le format RDF de Wikibase.

Chats

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID
    1 SELECT ?item ?itemLabel 
    2 WHERE 
    3 {
    4   ?item wdt:P31 wd:Q146.
    5   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    6 }
    

Chèvre

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID
    1 SELECT ?item ?itemLabel 
    2 WHERE 
    3 {
    4   ?item wdt:P31 wd:Q2934.
    5   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    6 }
    


Chevaux (montrant quelques informations à leur sujet)

#Illustrates optional fields, instances of subclasses, language fallback on label service, date to year conversion
#Horses on Wikidata
SELECT DISTINCT ?horse ?horseLabel ?mother ?father (year(?birthdate) as ?birthyear) (year(?deathdate) as ?deathyear) ?genderLabel
WHERE
{
	?horse wdt:P31/wdt:P279* wd:Q726 .     # Instance et sous-classes de Q726-Cheval
	 
	OPTIONAL{?horse wdt:P25 ?mother .}       # P25  : Mère
	OPTIONAL{?horse wdt:P22 ?father .}       # P22  : Père
	OPTIONAL{?horse wdt:P569 ?birthdate .} # P569 : Date de naissance
	OPTIONAL{?horse wdt:P570 ?deathdate .}     # P570 : Date de décès
	OPTIONAL{?horse wdt:P21 ?gender .}       # P21  : Sexe
 
	SERVICE wikibase:label { #BabelRainbow
		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,ar,be,bg,bn,ca,cs,da,de,el,en,es,et,fa,fi,he,hi,hu,hy,id,it,ja,jv,ko,nb,nl,eo,pa,pl,pt,ro,ru,sh,sk,sr,sv,sw,te,th,tr,uk,yue,vec,vi,zh"
	}
}
ORDER BY ?horse

Try it!

Chats, avec des images

The following query uses these:

Features: ImageGrid (Q24515278) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:ImageGrid
 4 SELECT ?item ?itemLabel ?pic
 5 WHERE
 6 {
 7 ?item wdt:P31 wd:Q146 .
 8 ?item wdt:P18 ?pic
 9 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
10 }

Carte des hôpitaux

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

1 #added 2017-08
2 #defaultView:Map
3 SELECT * WHERE {
4   ?item wdt:P31*/wdt:P279* wd:Q16917;
5         wdt:P625 ?geo .
6 }

Nombres d’humains avec un élément Wikidata

Using the count function

SELECT (COUNT(?item) AS ?count)
WHERE {
	?item wdt:P31/wdt:P279* wd:Q5 .
}

Try it!

Humains sans enfants

In the simplest form:

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, child (P40) View with Reasonator View with SQID
    1 #added before 2016-10
    2 #Demonstrates "no value" handling
    3 SELECT ?human ?humanLabel
    4 WHERE
    5 {
    6 	?human wdt:P31 wd:Q5 .       #find humans
    7 	?human rdf:type wdno:P40 .   #with at least one P40 (child) statement defined to be "no value"
    8 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    9 }
    

An equivalent query (slightly more verbose):

SELECT ?human ?humanLabel 
WHERE
{
  ?human wdt:P31 wd:Q5 .         #find humans
  ?human p:P40 ?childStatement . #with at least one P40 (child) statement
  ?childStatement rdf:type wdno:P40 .   #where the P40 (child) statement is defined to be "no value"
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}

Try it!

Éléments avec un lien de site Wikispecies

#added before 2016-10
#illustrates sitelink selection, ";" notation
SELECT ?item ?itemLabel ?article
WHERE
{
	?article 	schema:about ?item ;
			schema:isPartOf <https://species.wikimedia.org/> .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
LIMIT 200

Try it!

Éléments à propos d'auteurs disposant d’une page Wikispecies

SELECT ?author ?authorLabel (COUNT(?paper) AS ?count)
WHERE
{
	?article 	schema:about ?author ;
			schema:isPartOf <https://species.wikimedia.org/> .
    ?author wdt:P31 wd:Q5.
    ?paper wdt:P50 ?author.
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
GROUP BY ?author ?authorLabel
ORDER BY DESC(?count)
LIMIT 200

Try it!

Événements récents

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, point in time (P585) View with Reasonator View with SQID, start time (P580) View with Reasonator View with SQID
     1 SELECT ?event ?eventLabel ?date
     2 WHERE
     3 {
     4 	# find events
     5 	?event wdt:P31/wdt:P279* wd:Q1190554.
     6 	# with a point in time or start date
     7 	OPTIONAL { ?event wdt:P585 ?date. }
     8 	OPTIONAL { ?event wdt:P580 ?date. }
     9 	# but at least one of those
    10 	FILTER(BOUND(?date) && DATATYPE(?date) = xsd:dateTime).
    11 	# not in the future, and not more than 31 days ago
    12 	BIND(NOW() - ?date AS ?distance).
    13 	FILTER(0 <= ?distance && ?distance < 31).
    14 	# and get a label as well
    15 	OPTIONAL {
    16 		?event rdfs:label ?eventLabel.
    17 		FILTER(LANG(?eventLabel) = "en").
    18 	}
    19 }
    20 # limit to 10 results so we don't timeout
    21 LIMIT 10
    

Couleurs d'yeux populaires

The following query uses these:

Features: BubbleChart (Q24515280) View with Reasonator View with SQID

 1 #added before 2016-10
 2 #illustrates bubblechart view, count
 3 
 4 #defaultView:BubbleChart
 5 SELECT ?eyeColorLabel (COUNT(?human) AS ?count)
 6 WHERE
 7 {
 8 	?human wdt:P31 wd:Q5.
 9 	?human wdt:P1340 ?eyeColor.
10 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
11 }
12 GROUP BY ?eyeColorLabel

Personnes dont on sait qu'on ne connaît pas le genre

The following query uses these:

  • Properties: sex or gender (P21) View with Reasonator View with SQID
    1 #added before 2016-10
    2 # Demonstrates filtering for "unknown value"
    3 SELECT ?human ?humanLabel
    4 WHERE
    5 {
    6 	?human wdt:P21 ?gender
    7 	FILTER isBLANK(?gender) .
    8 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    9 }
    

Liens vers Wikipédia dans toutes les langues

This query provides an alternative to scraping the Wikipedia.org portal page and various lists/tables of Wikipedias that are out there.

PREFIX schema: <http://schema.org/>

SELECT ?sitelink
WHERE 
{
  BIND(wd:Q52 AS ?wikipedia)
  ?sitelink schema:about ?wikipedia .
  FILTER REGEX(STR(?sitelink), ".wikipedia.org/wiki/") .
}

Try it!

Noms des articles de Wikipédia en plusieurs langues

The query retrieves Wikipedia article names (in the main namespace) in various languages for the given Q identity.

SELECT DISTINCT ?lang ?name WHERE {
  ?article schema:about wd:Q5; schema:inLanguage ?lang; schema:name ?name .
  FILTER(?lang in ('en', 'uz', 'ru', 'ko')) .
  FILTER (!CONTAINS(?name, ':')) .
}

Try it!

Tous les éléments avec une déclaration

# Sample to query all values of a property
# Property talk pages on Wikidata include basic queries adapted to each property
SELECT
  ?item ?itemLabel
  ?value ?valueLabel
# valueLabel is only useful for properties with item-datatype
WHERE 
{
  ?item wdt:P1800 ?value
  # change P1800 to another property        
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
# remove or change limit for more results
LIMIT 10

Try it!

Requêtes de démonstration

Ces requêtes montrent la puissance et les fonctionnalités de SPARQL.

Les plus grosses villes avec une femme maire

#added before 2016-10
#TEMPLATE={"template":"Largest ?c with ?sex head of government","variables":{"?sex":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q48264 .  } "},"?c":{"query":"SELECT DISTINCT ?id WHERE {  ?c wdt:P31 ?id.  ?c p:P6 ?mayor. }"} } }
SELECT DISTINCT ?city ?cityLabel ?mayor ?mayorLabel
WHERE
{
  BIND(wd:Q6581072 AS ?sex)
  BIND(wd:Q515 AS ?c)

	?city wdt:P31/wdt:P279* ?c .  # find instances of subclasses of city
	?city p:P6 ?statement .            # with a P6 (head of goverment) statement
	?statement ps:P6 ?mayor .          # ... that has the value ?mayor
	?mayor wdt:P21 ?sex .       # ... where the ?mayor has P21 (sex or gender) female
	FILTER NOT EXISTS { ?statement pq:P582 ?x }  # ... but the statement has no P582 (end date) qualifier
	
	# Now select the population value of the ?city
	# (wdt: properties use only statements of "preferred" rank if any, usually meaning "current population")
	?city wdt:P1082 ?population .
	# Optionally, find English labels for city and mayor:
	SERVICE wikibase:label {
		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
	}
}
ORDER BY DESC(?population)
LIMIT 10

Try it!

Liste de pays triés par le nombre de leurs villes avec une femme maire

#added before 2016-10
SELECT ?country ?countryLabel (count(*) AS ?count)
WHERE
{
	?city wdt:P31/wdt:P279* wd:Q515 . # find instances of subclasses of city
	?city p:P6 ?statement .           # with a P6 (head of goverment) statement
	?statement ps:P6 ?mayor .         # ... that has the value ?mayor
	?mayor wdt:P21 wd:Q6581072 .      # ... where the ?mayor has P21 (sex or gender) female
	FILTER NOT EXISTS { ?statement pq:P582 ?x }  # ... but the statement has no P582 (end date) qualifier
	?city wdt:P17 ?country .          # Also find the country of the city
 	
	# If available, get the "ru" label of the country, use "en" as fallback:
	SERVICE wikibase:label {
		bd:serviceParam wikibase:language "ru,en" .
	}
}
GROUP BY ?country ?countryLabel
ORDER BY DESC(?count)
LIMIT 100

Try it!

Noms de famille populaires parmi les humains

#added before 2016-10

#defaultView:BubbleChart
SELECT ?surname ?surnameLabel ?count
WHERE
{
  {
    SELECT ?surname (COUNT(?human) AS ?count) WHERE {
      ?human wdt:P31 wd:Q5.
      ?human wdt:P734 ?surname.
    }
    GROUP BY ?surname
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)
LIMIT 100

Try it!

Prénoms avec le plus de variations

#added before 2016-10

SELECT ?name (COUNT(?otherName) AS ?count)
WHERE
{
  ?name wdt:P31 wd:Q202444;
        wdt:P460 ?otherName.
}
GROUP BY ?name
ORDER BY DESC(?count)
LIMIT 10

Try it!

Noms de famille populaires parmi les personnages de fiction

#added before 2016-10

#defaultView:BubbleChart
SELECT ?surname ?surnameLabel ?count
WHERE
{
  {
    SELECT ?surname (COUNT(?person) AS ?count) WHERE {
      ?person (wdt:P31/wdt:P279*) wd:Q95074.
      ?person wdt:P734 ?surname.
    }
    GROUP BY ?surname
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)
LIMIT 100

Try it!

Femmes avec le plus de sitelinks et pas d'image, nées en 1921 ou après

SELECT ?s ?desc ?linkcount
WHERE
{
  ?s wdt:P31 wd:Q5 ;   # human
     wdt:P21 wd:Q6581072 ;  # gender: female
     wdt:P569 ?born .
  FILTER (?born >= "1921-01-01T00:00:00Z"^^xsd:dateTime) .
  ?s wikibase:sitelinks ?linkcount .
  MINUS {
    ?s wdt:P18 []  # exclude if there is an image
  }
?s rdfs:label ?desc FILTER(lang(?desc)="en").
}
GROUP BY ?s ?desc ?linkcount
ORDER BY DESC(?linkcount)
LIMIT 50

Try it!

Qui fête son anniversaire aujourd'hui ?

The following query uses these:

  • Properties: date of birth (P569) View with Reasonator View with SQID
     1 #Whose birthday is today?
     2 SELECT ?entityLabel (YEAR(?date) as ?year)
     3 WHERE
     4 {
     5     BIND(MONTH(NOW()) AS ?nowMonth)
     6     BIND(DAY(NOW()) AS ?nowDay)
     7 
     8     ?entity wdt:P569 ?date .
     9     FILTER (MONTH(?date) = ?nowMonth && DAY(?date) = ?nowDay)
    10     SERVICE wikibase:label {
    11         bd:serviceParam wikibase:language "en" .
    12     }
    13 }
    14 LIMIT 10
    

Trouver John et Sarah Connor

#added before 2016-10
 SELECT * WHERE {
  ?p wdt:P1080 wd:Q620588 . # from fictional universe: Terminator
  ?p rdfs:label ?pl .
  FILTER (lang(?pl) = "en")
  ?p wdt:P25 ?m .  # ?m is mother of ?p
  ?m rdfs:label ?ml .
  FILTER (lang(?ml) = "en")
}

Try it!

Données sur Douglas Adams

#added before 2016-10

PREFIX entity: <http://www.wikidata.org/entity/>
#partial results

SELECT ?propUrl ?propLabel ?valUrl ?valLabel ?picture
WHERE
{
	hint:Query hint:optimizer 'None' .
	{	BIND(entity:Q42 AS ?valUrl) .
		BIND("N/A" AS ?propUrl ) .
		BIND("identity"@en AS ?propLabel ) .
	}
	UNION
	{	entity:Q42 ?propUrl ?valUrl .
		?property ?ref ?propUrl .
		?property rdf:type wikibase:Property .
		?property rdfs:label ?propLabel
	}
	
  	?valUrl rdfs:label ?valLabel
	FILTER (LANG(?valLabel) = 'en') .
	OPTIONAL{ ?valUrl wdt:P18 ?picture .}
	FILTER (lang(?propLabel) = 'en' )
}
ORDER BY ?propUrl ?valUrl
LIMIT 200

Try it!



Données sur Douglas Adams (version modifiée)

PREFIX entity: <http://www.wikidata.org/entity/>

#  In addition to the original query this one comes with some advantages:
#  - You will get only literals as results, (even if the values are stored as IRI in wikibase)
#  - That means you will also get properties as birth date, alphanumeric identifier and so on.
#  - The list is ordered numerically by property number. (So P19 comes before P100) 
#  - All label, altLabel and description in a given Language are included.
#  You may open a separate column ?valUrl if you need also the IRI
#
#  Please advise, if there is an option to put the Q-Number  and/or the Language 
#  code into a runtime variable. 

SELECT ?propNumber ?propLabel ?val
WHERE
{
	hint:Query hint:optimizer 'None' .
	{	BIND(entity:Q42 AS ?valUrl) .
		BIND("N/A" AS ?propUrl ) .
		BIND("Name"@de AS ?propLabel ) .
       entity:Q42 rdfs:label ?val .
      
        FILTER (LANG(?val) = "de") 
	}
    UNION
    {   BIND(entity:Q42 AS ?valUrl) .
      
        BIND("AltLabel"@de AS ?propLabel ) .
        optional{entity:Q42 skos:altLabel ?val}.
        FILTER (LANG(?val) = "de") 
    }
    UNION
    {   BIND(entity:Q42 AS ?valUrl) .
      
        BIND("Beschreibung"@de AS ?propLabel ) .
        optional{entity:Q42 schema:description ?val}.
        FILTER (LANG(?val) = "de") 
    }
   	UNION
	{	entity:Q42 ?propUrl ?valUrl .
		?property ?ref ?propUrl .
		?property rdf:type wikibase:Property .
		?property rdfs:label ?propLabel.
     	FILTER (lang(?propLabel) = 'de' )
        filter  isliteral(?valUrl) 
        BIND(?valUrl AS ?val)
	}
	UNION
	{	entity:Q42 ?propUrl ?valUrl .
		?property ?ref ?propUrl .
		?property rdf:type wikibase:Property .
		?property rdfs:label ?propLabel.
     	FILTER (lang(?propLabel) = 'de' ) 
        filter  isIRI(?valUrl) 
        ?valUrl rdfs:label ?valLabel 
		FILTER (LANG(?valLabel) = "de") 
         BIND(CONCAT(?valLabel) AS ?val)
	}
        BIND( SUBSTR(str(?propUrl),38, 250) AS ?propNumber)
}
ORDER BY xsd:integer(?propNumber)

Try it!


Diagramme à bulles

Classement général des causes de décès

#defaultView:BubbleChart
#TEMPLATE={"template":"Overall causes of death ranking of ?thing ","variables":{"?thing": {"query":"SELECT ?id  (COUNT(?id) AS ?count) WHERE {  ?sub wdt:P509 ?y.  ?sub wdt:P31 ?id. } GROUP BY ?id "} } }
SELECT ?cid ?cause (COUNT(*) AS ?count) WHERE {
  BIND(wd:Q5 AS ?thing)
  ?pid wdt:P31 ?thing;
      wdt:P509 ?cid.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?cid rdfs:label ?cause}
}
GROUP BY ?cid ?cause
ORDER BY DESC(?count) ?cause

Try it!

Durée des batailles de la Seconde Guerre mondiale

#defaultView:BubbleChart
SELECT DISTINCT ?item ?itemLabel (?end - ?start AS ?duration)
WHERE
{
	?item wdt:P361* wd:Q362 ;
          wdt:P31/wdt:P279* wd:Q178561 ;
          wdt:P580 ?start ;
          wdt:P582 ?end .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

Les dix êtres humains les plus lourds

The following query uses these:

Features: BubbleChart (Q24515280) View with Reasonator View with SQID

 1 #defaultView:BubbleChart
 2 #TEMPLATE={ "template": "The top 10 heaviest ?type ", "variables": { "?type": { "query": "SELECT DISTINCT ?id WHERE { ?i wdt:P2067 ?v. ?i wdt:P31 ?id}" } } }
 3 SELECT ?item ?itemLabel ?mass ?image WHERE {
 4   BIND(wd:Q5 AS ?type)
 5   ?item wdt:P31 ?type;
 6         p:P2067/psn:P2067/wikibase:quantityAmount ?mass.
 7   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,es,fr,de" }
 8 }
 9 ORDER BY DESC(?mass)
10 LIMIT 10

Frise chronologique

Chronologie des sondes spatiales

#defaultView:Timeline
SELECT ?item ?itemLabel ?launchdate (SAMPLE(?image) AS ?image)
WHERE
{
	?item wdt:P31 wd:Q26529 .
    ?item wdt:P619 ?launchdate .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    OPTIONAL { ?item wdt:P18 ?image }
}
GROUP BY ?item ?itemLabel ?launchdate

Try it!

Chronologie des compositions de Wolfgang Amadeus Mozart

#defaultView:Timeline
SELECT DISTINCT ?item ?itemLabel ?catalog_code ?publication_date
WHERE {
	?item wdt:P86 wd:Q254 ; # composer: W. A. Mozart
          wdt:P528 ?catalog_code ;
          wdt:P577 ?publication_date .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

Dimensions

Dimensions d'éléments

#defaultView:Dimensions
SELECT ?elementLabel ?boiling_point ?melting_point ?electronegativity ?density ?mass WHERE {
?element wdt:P31 wd:Q11344;
   wdt:P2102 ?boiling_point;
   wdt:P2101 ?melting_point;
   wdt:P1108 ?electronegativity;
   wdt:P2054 ?density;
   wdt:P2067 ?mass.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
LIMIT 100

Try it!

Graphe

Enfants de Genghis Khan

#defaultView:Graph
PREFIX gas: <http://www.bigdata.com/rdf/gas#>

SELECT ?item ?itemLabel ?pic ?linkTo
WHERE {
  SERVICE gas:service {
    gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
                gas:in wd:Q720 ;
                gas:traversalDirection "Forward" ;
                gas:out ?item ;
                gas:out1 ?depth ;

                gas:maxIterations 4 ;
                gas:linkType wdt:P40 .
  }
  OPTIONAL { ?item wdt:P40 ?linkTo }
  OPTIONAL { ?item wdt:P18 ?pic }
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

Cartouches d'armes à feu et sur quoi elles sont basées

The following query uses these:

Features: Graph (Q24515287) View with Reasonator View with SQID

 1 #Show firearms cartridges and which they are based on
 2 #defaultView:Graph
 3 SELECT 
 4 ?item ?itemLabel ?image 
 5 ?other ?otherLabel ?image2
 6 WHERE
 7 {
 8     ?item  wdt:P279+ wd:Q37144 .   # cartridges
 9     ?item  wdt:P144    ?other  .   # if the cartridge is based on another
10     OPTIONAL {
11       ?item  wdt:P18     ?image  .   # grab image
12       ?other wdt:P18     ?image2 .   # grab image
13     }
14     SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
15 }

Genres musicaux

#graph rendering could be slow due to large number of results

#defaultView:Graph
SELECT ?item ?itemLabel ?_image ?_subclass_of ?_subclass_ofLabel
WHERE {
  ?item wdt:P31 wd:Q188451;
        wdt:P279 ?_subclass_of.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P18 ?_image. }
}

Try it!

Les groupes de personnage de l’univers Marvel

#defaultView:Graph
SELECT ?char ?charLabel ?group ?groupLabel ("7FFF00" as ?rgb)
WHERE {
	?group wdt:P31 wd:Q14514600 ;  # group of fictional characters
          wdt:P1080 wd:Q931597.  # from Marvel universe
 ?char wdt:P463 ?group # member of group
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}

Try it!

Diagramme linéaire

Nombre moyen d'enfants par an

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, number of children (P1971) View with Reasonator View with SQID, date of birth (P569) View with Reasonator View with SQID
     1 #defaultView:LineChart
     2 SELECT  (str(?year) AS ?year) (AVG( ?_number_of_children ) AS ?count) WHERE {
     3   ?item wdt:P31 wd:Q5.
     4   ?item wdt:P1971 ?_number_of_children.
     5   ?item wdt:P569 ?_date_of_birth.
     6   BIND( year(?_date_of_birth) as ?year ).
     7   FILTER( ?year > 1900)
     8 }
     9 
    10 GROUP BY ?year
    

Population des pays frontaliers avec l'Allemagne

#defaultView:LineChart
SELECT ?country ?year ?population ?countryLabel WHERE {
  {
    SELECT ?country ?year (AVG(?population) AS ?population) WHERE {
      {
        SELECT ?country (str(YEAR(?date)) AS ?year) ?population WHERE {
          ?country wdt:P47 wd:Q183;   # shares border with Germany
                   p:P1082 ?populationStatement.
          ?populationStatement ps:P1082 ?population;
                               pq:P585 ?date.
        }
      }
    }
    GROUP BY ?country ?year
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Population des pays frontaliers avec le Cameroun

#defaultView:LineChart
SELECT ?country ?year ?population ?countryLabel WHERE {
  {
    SELECT ?country ?year (AVG(?population) AS ?population) WHERE {
      {
        SELECT ?country (str(YEAR(?date)) AS ?year) ?population WHERE {
          ?country wdt:P47 wd:Q1009;  # shares border with Cameroon
                   p:P1082 ?populationStatement.
          ?populationStatement ps:P1082 ?population;
                               pq:P585 ?date.
        }
      }
    }
    GROUP BY ?country ?year
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Liste de tous les lacs du Cameroun

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

1 #defaultView:Map
2 SELECT ?itemLabel ?itemDescription ?image ?coord WHERE {
3   ?item (wdt:P31/wdt:P279*) wd:Q23397.
4   ?item wdt:P17 wd:Q1009.
5   ?item wdt:P625 ?coord.
6   OPTIONAL {?item wdt:P18 ?image.}
7   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
8 }

Nombre de livres par an et par genre

#defaultView:LineChart
SELECT ?year (COUNT(?_genre) AS ?count ) (SAMPLE(?_genreLabel) AS ?genreLabel )  WHERE {
  ?item wdt:P31 wd:Q571;
        wdt:P577 ?_publication_date;
        wdt:P136 ?_genre.
  BIND(str(YEAR(?_publication_date)) AS ?year)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
                         ?_genre rdfs:label ?genreLabel.}
 FILTER (?_publication_date >= "2000-00-00T00:00:00Z"^^xsd:dateTime)
}
GROUP BY ?_genreLabel ?year
HAVING (?count > 10)

Try it!

Nombre de groupes musicaux par an et par genre

#defaultView:LineChart
SELECT ?year (COUNT(?_genre) AS ?count) (SAMPLE(?_genreLabel) AS ?_genreLabel) WHERE {
  ?item wdt:P31 wd:Q215380; # instance of: band
        wdt:P571 ?_date;   # inception
        wdt:P136 ?_genre.
  BIND(str(YEAR(?_date)) AS ?year)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                          ?_genre rdfs:label ?_genreLabel.}
  FILTER(?_date >= "1960-00-00T00:00:00Z"^^xsd:dateTime)
}
GROUP BY ?_genreLabel ?year
HAVING (?count > 10)

Try it!

Diagramme en barres

Batailles par an et par pays au cours des quatre-vingt dernières années

#defaultView:BarChart

SELECT(SAMPLE(?year) AS ?year) (COUNT(?_country) AS ?battles) (SAMPLE(?_countryLabel) AS ?_countryLabel)  WHERE {
  ?subj wdt:P31 wd:Q178561.  # instance of battle
  OPTIONAL { ?subj wdt:P580 ?d1. }  # start time
  OPTIONAL { ?subj wdt:P585 ?d2. }  # point in time
  OPTIONAL { ?subj wdt:P582 ?d3. }  # end time
  BIND(IF(!BOUND(?d1), IF(!BOUND(?d2), ?d3, ?d2), ?d1) AS ?date)
  BIND(STR(YEAR(?date)) AS ?year)
  FILTER(BOUND(?year))
  ?subj wdt:P276/wdt:P17 ?_country.  # country of location of battle
  BIND((NOW()) - ?date AS ?distance)
  FILTER((0 <= ?distance) && (?distance < 31 * 12 * 80))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                          ?_country rdfs:label ?_countryLabel.}
}
GROUP BY ?year ?_country
ORDER BY ?_countryLabel

Try it!

Batailles par an et par pays au cours des 80 dernières annéesBatailles par an et par pays au cours des quatre-vingt dernières années (animé)

#defaultView:BarChart
SELECT (SAMPLE(?_continentLabel) AS ?continent) (COUNT(?_country) AS ?battles) (SAMPLE(?_countryLabel) AS ?_countryLabel) (SAMPLE(?year) AS ?year)  WHERE {
  ?subj wdt:P31 wd:Q178561.        # instance of battle
  OPTIONAL { ?subj wdt:P580 ?d1. } # start date
  OPTIONAL { ?subj wdt:P585 ?d2. } # point in time
  OPTIONAL { ?subj wdt:P582 ?d3. } # end date
  BIND(IF(!BOUND(?d1), IF(!BOUND(?d2), ?d3, ?d2), ?d1) AS ?date)
  BIND(str(YEAR(?date)) AS ?year)
  FILTER(BOUND(?year))
  ?subj wdt:P276/wdt:P17 ?_country.
  ?_country wdt:P30 ?_continent.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
       ?_country rdfs:label ?_countryLabel.
       ?_continent rdfs:label ?_continentLabel.}
  BIND((NOW()) - ?date AS ?distance)
  FILTER((0 <= ?distance) && (?distance < 31 * 12 * 80))
}
GROUP BY ?year ?_country

Try it!

Populations annuelles regroupées par pays

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, population (P1082) View with Reasonator View with SQID, point in time (P585) View with Reasonator View with SQID, determination method (P459) View with Reasonator View with SQID
     1 #defaultView:BarChart
     2 # male/female population _must_ not be added unqualified as total population (!)
     3 # this is an error and should be fixed at the item using P1540 and P1539 instead
     4 # (wrong query result may be a manifestation of such)
     5 SELECT ?year (AVG(?pop) AS ?population) ?countryLabel
     6        (COUNT(*) AS ?number_of_chosen_sources) (SAMPLE(?method) AS ?a_source_of_those_chosen)
     7 WHERE
     8 {
     9   ?country wdt:P31 wd:Q6256;
    10            p:P1082 ?popStatement .
    11   ?popStatement ps:P1082 ?pop;
    12                 pq:P585 ?date .
    13   BIND(STR(YEAR(?date)) AS ?year)
    14   
    15   # IF multiple ?pop values per country per year exist, we prioritize by source
    16   #       census 1st, others 2nd, estimation(s) 3rd, unknown sources (none supplies P459) last
    17   # note: wikibase:rank won't help here: each year may have multiple statements for ?pop value
    18   #       rank:prefered is used for the best value (or values) of the latest or current year
    19   #       rank:normal may be justified for all of multiple ?pop values for a given year
    20   OPTIONAL { ?popStatement pq:P459 ?method. }
    21   OPTIONAL { ?country p:P1082 [ pq:P585 ?d; pq:P459 ?estimate ].
    22              FILTER(STR(YEAR(?d)) = ?year). FILTER(?estimate = wd:Q791801). }
    23   OPTIONAL { ?country p:P1082 [ pq:P585 ?e; pq:P459 ?census ].
    24              FILTER(STR(YEAR(?e)) = ?year). FILTER(?census = wd:Q39825). }
    25   OPTIONAL { ?country p:P1082 [ pq:P585 ?f; pq:P459 ?other ].
    26              FILTER(STR(YEAR(?f)) = ?year). FILTER(?other != wd:Q39825 && ?other != wd:Q791801). }
    27   BIND(COALESCE( 
    28     IF(BOUND(?census), ?census, 1/0),
    29     IF(BOUND(?other), ?other, 1/0),
    30     IF(BOUND(?estimate), ?estimate, 1/0) ) AS ?pref_method).
    31   FILTER(IF(BOUND(?pref_method),?method = ?pref_method,true))
    32   # .. still need to group if multiple values per country per year exist and
    33   # - none is qualified with P459
    34   # - multiple ?estimate or multiple ?census (>1 value from same source)
    35   # - ?other yields more than one source (>1 values are better than optionally
    36   #                         supplied estimate, but no census source available)
    37 
    38   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }               
    39 }
    40 GROUP BY ?year ?countryLabel
    41 ORDER BY ?year ?countryLabel
    

Centrales électriques construites par an et par pays

#defaultView:BarChart
SELECT (SAMPLE(?year) AS ?year) (COUNT(?_country) AS ?count) (SAMPLE(?_countryLabel) AS ?_countryLabel) WHERE {
  ?object wdt:P31/wdt:P279* wd:Q134447. # Power stations or subtypes
  BIND(STR(YEAR(?_inception)) AS ?year)
  ?object wdt:P571 ?_inception;
          wdt:P17 ?_country.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                        ?_country rdfs:label ?_countryLabel. }
}
GROUP BY ?year ?_country
ORDER BY ?_countryLabel

Try it!

Bar chart of paintings produced per year by Piet Mondrian

#defaultView:BarChart
SELECT ?year (COUNT(?year) as ?count) WHERE {
  ?painting wdt:P31 wd:Q3305213.
  ?painting wdt:P170 wd:Q151803.
  ?painting wdt:P571 ?inception.
  BIND(str(year(?inception)) AS ?year)
  OPTIONAL { ?painting wdt:P18 ?image. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl". }
} GROUP BY ?year ?count ORDER BY ?year

Try it!

Graphique en aires

Décès dus au cancer par année et type de cancer

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, cause of death (P509) View with Reasonator View with SQID, date of death (P570) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID
     1 #defaultView:AreaChart
     2 SELECT ?cid (STR(SAMPLE(?year)) AS ?year) (COUNT(*) AS ?count) ?cause WHERE {
     3   ?pid wdt:P31 wd:Q5;  # instance of human
     4        wdt:P509 ?cid;  # cause of death
     5        wdt:P570 ?_date_of_death.
     6   ?cid wdt:P279* wd:Q12078.  # type of cancer
     7  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
     8                          ?cid rdfs:label ?cause. }
     9   BIND ( YEAR(?_date_of_death) AS ?year )
    10   FILTER( ?year > 1960 )
    11 }
    12 GROUP BY ?cid ?cause ?year
    

Arbre

Continents, pays, régions et capitales

The following query uses these:

Compositeurs viennois et leurs compositions par tonalité

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, place of birth (P19) View with Reasonator View with SQID, place of death (P20) View with Reasonator View with SQID, residence (P551) View with Reasonator View with SQID, image (P18) View with Reasonator View with SQID, composer (P86) View with Reasonator View with SQID, tonality (P826) View with Reasonator View with SQID
     1 #defaultView:Tree
     2 SELECT ?composer ?composerLabel ?composerImage ?tonality ?tonalityLabel ?composition ?compositionLabel WHERE {
     3   ?composer wdt:P31 wd:Q5;
     4             wdt:P19|wdt:P20|wdt:P551 wd:Q1741.
     5   OPTIONAL { ?composer wdt:P18 ?composerImage. }
     6   ?composition wdt:P86 ?composer;
     7                wdt:P826 ?tonality.
     8   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de-at,de". }
     9 }
    10 ORDER BY ?composerLabel ?tonalityLabel
    

diagramme en arbre

Séries de télévision populaires

#added before 2016-10

#defaultView:TreeMap
SELECT ?show ?showLabel  ?season ?cleanSeasonLabel ?episode ?episodeLabel
WHERE
{
	{
		BIND(wd:Q886 as ?show) .
		?season wdt:P361 ?show .
		?season rdfs:label ?_seasonLabel.
		FILTER((LANG(?_seasonLabel)) = "en")
		BIND(SUBSTR(?_seasonLabel, 0, STRLEN(?_seasonLabel)-23) AS ?cleanSeasonLabel)
		?episode wdt:P361 ?season .
	} 
	UNION
	{
		BIND(wd:Q16538 as ?show) .
		?season wdt:P361 ?show .
		?season rdfs:label ?_seasonLabel.
		FILTER((LANG(?_seasonLabel)) = "en")
		BIND(SUBSTR(?_seasonLabel, 0, STRLEN(?_seasonLabel)-20) AS ?cleanSeasonLabel)
		?episode wdt:P361 ?season .
	}  
	UNION
	{
		BIND(wd:Q147235 as ?show) .
		?season wdt:P361 ?show .
		?season rdfs:label ?_seasonLabel.
		FILTER((LANG(?_seasonLabel)) = "en")
		BIND(CONCAT("S", SUBSTR(?_seasonLabel, 25)) AS ?cleanSeasonLabel)
		?episode wdt:P361 ?season .
	}

	SERVICE wikibase:label {  bd:serviceParam wikibase:language "en" }
}

Try it!

Personnes célèbres classées selon la couleur des yeux et des cheveux

#defaultView:TreeMap
SELECT ?eyes ?hairColorLabel (COUNT(?person) as ?count)
WHERE
{
	?person wdt:P1340 ?eyeColor.
    ?person wdt:P1884 ?hairColor.
    ?person wdt:P2048 ?height.
    ?eyeColor rdfs:label ?_eyeColorLabel.
    FILTER((LANG(?_eyeColorLabel)) = "en")
    BIND(CONCAT(?_eyeColorLabel, " eyes") AS ?eyes)
   
	SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?eyes ?hairColorLabel

Try it!

Diagramme de dispersion

Nombre de films par an et par genre

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID, genre (P136) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 SELECT   ?year  (COUNT(?_genre) AS ?count ) (SAMPLE(?_genreLabel) AS ?label )  (?year as ?year_shown) WHERE {
     3   ?item wdt:P31 wd:Q11424.
     4   ?item wdt:P577 ?_publication_date.
     5   ?item wdt:P136 ?_genre.
     6   ?_genre rdfs:label ?_genreLabel.
     7   BIND(str(YEAR(?_publication_date)) AS ?year)
     8   FILTER((LANG(?_genreLabel)) = "en")
     9  
    10  FILTER (?_publication_date >= "2000-00-00T00:00:00Z"^^xsd:dateTime)
    11 }
    12 GROUP BY ?_genreLabel ?year
    13 HAVING (?count > 30)
    

Exemples avec coordonnées pour illustrer des cartes

Les éléments situés autour de votre localisation

#defaultView:Map{"layer":"?instance_ofLabel"}
SELECT ?place ?placeLabel ?image ?coordinate_location ?dist ?instance_of ?instance_ofLabel WHERE {
  SERVICE wikibase:around {
    ?place wdt:P625 ?coordinate_location.
    bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
    bd:serviceParam wikibase:radius "1".
    bd:serviceParam wikibase:distance ?dist.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?place wdt:P18 ?image. }
  OPTIONAL { ?place wdt:P31 ?instance_of. }
}

Try it!

Emplacements des parcs nationaux

#defaultView:Map
SELECT ?objectLabel ?objectDescription ?link ?coord
WHERE {
  ?object wdt:P31/wdt:P279? wd:Q46169 .
          OPTIONAL { ?object wdt:P856 ?link. } 
          OPTIONAL { ?object wdt:P625 ?coord . }
          SERVICE wikibase:label {
               bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr"
          }
}

Try it!

Aéroports à moins de 100 km de Berlin

#added before 2016-10

#defaultView:Map
SELECT ?place ?placeLabel ?location
WHERE
{
  # Berlin coordinates
  wd:Q64 wdt:P625 ?berlinLoc .
  SERVICE wikibase:around {
    ?place wdt:P625 ?location .
    bd:serviceParam wikibase:center ?berlinLoc .
    bd:serviceParam wikibase:radius "100" .
  } .
  # Is an airport
  FILTER EXISTS { ?place wdt:P31/wdt:P279* wd:Q1248784 } .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  } 
}

Try it!

Aéroports en Belgique

#List of airports in Belgium
#defaultView:Map
SELECT DISTINCT ?airport ?airportLabel ?coor
WHERE {
  ?airport wdt:P31 wd:Q1248784 ;
          ?range wd:Q31;
          wdt:P625 ?coor.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Écoles entre San José et Sacramento

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID, wikibase:box (Q26211169) View with Reasonator View with SQID, wikibase:box with West and East corners (Q26211177) View with Reasonator View with SQID

 1 #added before 2016-10
 2  # Schools between San Jose, CA and Sacramento, CA
 3 #defaultView:Map
 4 SELECT *
 5 WHERE
 6 {
 7   wd:Q16553 wdt:P625 ?SJloc .
 8   wd:Q18013 wdt:P625 ?SCloc .
 9   SERVICE wikibase:box {
10       ?place wdt:P625 ?location .
11       bd:serviceParam wikibase:cornerWest ?SJloc .
12       bd:serviceParam wikibase:cornerEast ?SCloc .
13     }
14   ?place wdt:P31/wdt:P279* wd:Q3914 .
15 }

Grandes villes groupées en couches cartographiques par population

#defaultView:Map
SELECT DISTINCT ?city ?cityLabel (SAMPLE(?location) AS ?location) (MAX(?population) AS ?population) (SAMPLE(?layer) AS ?layer)
WHERE
{
  ?city wdt:P31/wdt:P279* wd:Q515;
        wdt:P625 ?location;
        wdt:P1082 ?population.
  FILTER(?population >= 500000).
  BIND(
    IF(?population < 1000000, "<1M",
    IF(?population < 2000000, "1M-2M",
    IF(?population < 5000000, "2M-5M",
    IF(?population < 10000000, "5M-10M",
    IF(?population < 20000000, "10M-20M",
    ">20M")))))
    AS ?layer).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?city ?cityLabel

Try it!

Lieux géolocalisés avec wifi gratuit

#defaultView:Map
# Places with free wi-fi
SELECT ?item ?itemLabel (SAMPLE(?coord) AS ?coord)
WHERE {
	?item wdt:P2848 wd:Q1543615 ;  # wi-fi gratis
	      wdt:P625 ?coord .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?item ?itemLabel

Try it!

Carte des stations de métro U1 à Berlin

#added before 2016-10
#defaultView:Map
SELECT ?stationLabel ?coord
WHERE {
	?station wdt:P81 wd:Q99691 ;
		 wdt:P625 ?coord .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de" }
}

Try it!

Emplacements des universités du Cameroun

#added before 2016-10
#defaultView:Map
SELECT ?universityLabel ?universityDescription ?website ?coord
WHERE {
	?university wdt:P31/wdt:P279* wd:Q3918 ;
		wdt:P17 wd:Q1009 ;
		wdt:P625 ?coord .
	OPTIONAL {
		?university wdt:P856 ?website
	}
	SERVICE wikibase:label {
		bd:serviceParam wikibase:language "en,de" .
	}
}

Try it!

Distribution des noms d'établissements humains se terminant par « ow » ou « itz » en Allemagne

#added before 2016-10
 #defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE
{
	?item wdt:P31/wdt:P279* wd:Q486972;
    	      wdt:P17 wd:Q183;
    	      rdfs:label ?itemLabel;
    	      wdt:P625 ?coord;
    	 FILTER (lang(?itemLabel) = "de") .
    	 FILTER regex (?itemLabel, "(ow|itz)$").
}

Try it!

Emplacements des centrales électriques

#defaultView:Map
SELECT DISTINCT ?objectLabel ?coord ?layer
WHERE
{
  ?object wdt:P31/wdt:P279* wd:Q159719;
     wdt:P625 ?coord.
  ?object wdt:P31 ?type. ?type wdt:P279* wd:Q159719.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?type rdfs:label ?layer }
}

Try it!

Emplacements des ponts de pierre en arc

#defaultView:Map
SELECT ?label ?coord ?place ?image
WHERE {
	?place wdt:P31 wd:Q14276458 ;  # instance of deck arch bridge
            wdt:P186 wd:Q22731 ;  # made of stone
            wdt:P625 ?coord .
	OPTIONAL { ?place wdt:P18 ?image }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                        ?place rdfs:label ?label }
}

Try it!

Emplacements des aqueducs

#defaultView:Map
SELECT ?place ?placeLabel ?coord ?layer
WHERE {
   ?place wdt:P31/wdt:P279? wd:Q474 ; # instance of aqueduct
          wdt:P625 ?coord ;
          wdt:P31 ?type.
  ?type wdt:P279* wd:Q474
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
                       ?type rdfs:label ?layer}
}

Try it!

Emplacements des sites archéologiques, et leur illustration

#defaultView:Map
SELECT ?siteLabel ?coord ?image ?site
WHERE {
   ?site wdt:P31/wdt:P279* wd:Q839954 ;
      wdt:P625 ?coord ;
      wdt:P18 ?image .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}

Try it!

Emplacements des châteaux qui sont aussi des sites archéologiques

#defaultView:Map
SELECT ?label ?coord ?subj
WHERE {
   ?subj wdt:P31 wd:Q839954 ; # instance of archaeological site
         wdt:P31/wdt:P279* wd:Q23413 ;  # instance or subclass of castle
         wdt:P625 ?coord .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
                         ?subj rdfs:label ?label}
}

Try it!

Emplacements des batailles

#added before 2016-10
#defaultView:Map
SELECT ?label ?coord ?subj ?year
WHERE
{
	?subj wdt:P31 wd:Q178561 .
	?subj wdt:P625 ?coord .
	OPTIONAL {?subj wdt:P580 ?d1}
	OPTIONAL {?subj wdt:P585 ?d2}
  	OPTIONAL {?subj wdt:P582 ?d3}
	BIND(IF(!BOUND(?d1),(IF(!BOUND(?d2),?d3,?d2)),?d1) as ?date)
	BIND(YEAR(?date) as ?year)
	?subj rdfs:label ?label filter (lang(?label) = "en")
}

Try it!

Lieux de culte

#added before 2016-10

#defaultView:Map
SELECT ?item ?itemLabel ?_coordinate_location ?_image WHERE {
  ?item wdt:P31/wdt:P279* wd:Q1370598.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
   ?item wdt:P625 ?_coordinate_location.
  ?item wdt:P18 ?_image.
}

Try it!

Tous les musées (en incluant les sous-classes de musée) à Washington avec leurs coordonnées

#added before 2016-10
#defaultView:Map
SELECT DISTINCT ?item ?name ?coord ?lat ?lon
WHERE {
   ?item wdt:P131* wd:Q61 .
   ?item wdt:P31/wdt:P279* wd:Q33506 .
   ?item wdt:P625 ?coord .
   ?item p:P625 ?coordinate .
   ?coordinate psv:P625 ?coordinate_node .
   ?coordinate_node wikibase:geoLatitude ?lat .
   ?coordinate_node wikibase:geoLongitude ?lon .
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
    ?item rdfs:label ?name
   }
}
ORDER BY ASC (?name)

Try it!

Toutes les stations de ski avec des coordonnées

#defaultView:Map
SELECT ?item ?itemLabel ?coord #?lat ?lon
WHERE
{
   ?item               wdt:P31        wd:Q130003.
   ?item               wdt:P625         ?coord.

#  ?item                 p:P625         ?statementnode.
#  ?statementnode      psv:P625         ?valuenode.
#  ?valuenode     wikibase:geoLatitude  ?lat.
#  ?valuenode     wikibase:geoLongitude ?lon.

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Phares en Norvège

#added before 2016-10
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?coords ?image
WHERE {
	?item wdt:P31 wd:Q39715 ;
          wdt:P17 wd:Q20 ;
          wdt:P625 ?coords
	OPTIONAL { ?item wdt:P18 ?image } 
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nb,nn,en,fi"  } 
}
ORDER BY ?itemLabel

Try it!

Les plus beaux villages de France

#defaultView:Map
SELECT ?item ?itemLabel ?geoLocation ?image
WHERE {
    ?item wdt:P463 wd:Q1010307 ;  # member of Les Plus Beaux Villages de France (organisation)
          wdt:P625 ?geoLocation .
    OPTIONAL { ?item wdt:P18 ?image }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr" }
}

Try it!

Emplacements aux Fidji

This query shows a way of mapping locations which span the 180th meridian, without the points being split between the left and right edges of the map.

#defaultView:Map
select ?item ?coords_ where {
  ?item wdt:P17 wd:Q712 .
  ?item p:P625/psv:P625 ?coords .
  ?coords wikibase:geoLatitude ?lat ;
          wikibase:geoLongitude ?lon .
  bind(strdt(concat("Point(", if((?lon < 0), str(?lon + 360), str(?lon)), " ", str(?lat), ")"), geo:wktLiteral) as ?coords_) .
}

Try it!

Map of disasters, color-coded by disaster type

Map of disasters color-coded by disaster type
#defaultView:Map{"layer":"?typeLabel"}
SELECT ?item ?itemLabel ?geo ?type ?typeLabel (SAMPLE(?_image) AS ?image) WHERE {
  ?type wdt:P279* wd:Q3839081 .
  ?item wdt:P31 ?type ;
        wdt:P625 ?geo .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P18 ?_image }
}
GROUP BY ?item ?itemLabel ?geo ?type ?typeLabel

Try it!

Monuments and other heritage items located 1 km around the users location

#defaultView:Map
select distinct ?monument ?monumentLabel ?heritageLabel (sample(?distance) as ?distance) (sample(?location) as ?location) (sample(?image) as ?image) where {
  ?monument wdt:P1435 ?heritage.
  
  service wikibase:around {   
    ?monument wdt:P625 ?location.
    bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
    bd:serviceParam wikibase:radius "1" . 
    bd:serviceParam wikibase:distance ?distance .
  }
  
  optional {
    ?monument wdt:P18 ?image.
  }
  
  service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,de,es,nl". }
} group by ?monument ?monumentLabel ?heritageLabel order by ?distance

Try it!

Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article

Map of newspapers in the United States by presence of the template Infobox newspaper in their English Wikipedia article
  • integrates a text search for the template's name using the MediaWiki API into a SPARQL query
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?place ?placeLabel ?id ?coords ?article ?mapflags ?rgb WHERE {
 ?c wdt:P279* wd:Q11032 .
  ?item wdt:P31 ?c .
 ?item wdt:P17|wdt:P495 wd:Q30 .
 OPTIONAL{?item wdt:P5454 ?id .}
 ?item wdt:P291 ?place .
 ?place wdt:P625 ?coords.
 OPTIONAL {   
   SELECT ?item ?pageid ?ns WHERE {
    SERVICE wikibase:mwapi {
      bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
      bd:serviceParam wikibase:api "Generator" .
      bd:serviceParam mwapi:generator "search" .
      bd:serviceParam mwapi:gsrsearch "insource:\"infobox newspaper\"" .
      bd:serviceParam mwapi:gsrlimit "max" .
      ?item wikibase:apiOutputItem mwapi:item .
      ?pageid wikibase:apiOutput "@pageid" .
      ?ns wikibase:apiOutput "@ns" .
    }
  } LIMIT 15000
 }
    
  OPTIONAL {
      ?article schema:about ?item .
      ?article schema:inLanguage "en" .
      FILTER (SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/")
  }

  BIND(IF(BOUND(?ns),"_infobox","_noinfobox") AS ?infobox).
  BIND(IF(BOUND(?article),"enwiki","noenwiki") AS ?onwiki).  
  BIND(CONCAT(?onwiki,?infobox) as ?layer) .

  BIND( IF(BOUND(?article),   IF(BOUND(?ns), "009500" , "FFF000" )  ,  "FF0000"   )  AS ?rgb).  
  
 #hint:Prior hint:runFirst "true".
 #OPTIONAL{ ?item wdt:P5454 ?id . }
  
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Try it!

Listeria

Samples suitable for Listeria. Generally only include ?item as output. Listeria will add more information from that item. Additional variables from the query could also be used in the lists.

Femmes nées au Pays de Galles sans article en gallois selon Listeria

#added before 2016-10
 #sample from cywiki:Wicipedia:Merched_a_anwyd_yng_Nghymru
SELECT ?item
WHERE
{
	# gender = female
  	?item wdt:P21 wd:Q6581072 .

  	# place of birth = Wales (Q25)
  	{ ?item wdt:P19 wd:Q25 }
	# OR place of birth within Wales. This relies on places using P131 with Q25 ("Wales") as value (or with a value that has Q25 in P131)
	UNION  { ?item wdt:P19 ?pob . ?pob wdt:P131* wd:Q25 }

	# look for articles (sitelinks) in Welsh ("cy")
  	OPTIONAL { ?sitelink schema:about ?item . ?sitelink schema:inLanguage "cy" }
	# but select items with no such article
	FILTER (!BOUND(?sitelink))

	# humans only
  	?item wdt:P31 wd:Q5 .
}
#Listeria can only handle up to 5000
LIMIT 1000

Try it!

Personnes nées en Occitanie selon Listeria

#added before 2016-10
 #Definition for Occitania (Q104285) is the one defined by P527 on item Q104285
SELECT ?item ?yob ?yod
WHERE
{
	# items with property place of birth
	?item wdt:P19 ?pob .
	#place of birth must be using P131 with one of the "?parts" (or -- note the "*" -- a value that uses one of the parts in P131, etc.)
	?pob wdt:P131* ?parts .

	# ?parts are those listed on item Q104285 with property P527
	wd:Q104285 wdt:P527 ?parts . 

	# humans only
  	?item wdt:P31 wd:Q5 .

	#for display in the list, extract yob/yod. Could also be done by using P569 and P570 in "columns=" of Listeria's template
	OPTIONAL { ?item wdt:P569 ?dob . BIND(YEAR(?dob) as ?yob) }
	OPTIONAL { ?item wdt:P570 ?dod . BIND(YEAR(?dod) as ?yod) }
}
#LIMIT to 2000 as Listeria can only handle up to 5000
LIMIT 2000

Try it!

Personnes nées en Écosse selon Listeria

#added before 2016-10
SELECT ?item ?dob
WHERE
{
  	# place of birth = Scotland (Q22)
  	{ ?item wdt:P19 wd:Q22 }
	# OR place of birth within Scotland.
	UNION  { ?item wdt:P19 ?pob . ?pob wdt:P131* wd:Q22 }

	# humans only
  	?item wdt:P31 wd:Q5 .

	# get DOB for ordering.
	OPTIONAL { ?item wdt:P569 ?dob  }
}
#Order by date of birth, avoid overriding this in the template with sort=
ORDER BY ?dob
#Listeria can only handle up to 5000
LIMIT 4000
#start at the first item
OFFSET 0 #change to OFFSET 4000 to start at the 4001th item

Try it!

Prédicats Wikibase

Propriétés

Propriétés regroupées par leur propriété mère

The following query uses these:

  • Properties: subproperty of (P1647) View with Reasonator View with SQID
    1 #Properties grouped by their parent property
    2 #TODO: should display links and numeric ids
    3 #defaultView:Tree
    4 SELECT ?property2 ?property2Label ?property1 ?property1Label WHERE {
    5   ?property1 rdf:type wikibase:Property. #not replaceable with wikibase:Item, wikibase:Statement, wikibase:Reference at WDQS
    6                                          #https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#WDQS_data_differences
    7   ?property1 wdt:P1647 ?property2.
    8   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    9 }
    

sous-propriétés de location (P276)

The following query uses these:

  • Properties: subproperty of (P1647) View with Reasonator View with SQID
    1 #Subproperties of location (P276)
    2 SELECT DISTINCT ?subProperties ?subPropertiesLabel WHERE {
    3   ?subProperties wdt:P1647* wd:P276.
    4   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    5 }
    

Propriétés regroupées par leur Wikibase datatype (Q19798645) avec le nombre de propriétés

The following query uses these:

1 #Properties grouped by their type with number of properties
2 SELECT (COUNT(?property) as ?pcount ) ?wbtype WHERE {
3   ?property rdf:type               wikibase:Property.
4   ?property wikibase:propertyType  ?wbtype.
5   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
6 }
7 GROUP BY ?wbtype
8 ORDER BY DESC(?pcount)

Les propriétés Wikidata, avec leurs descriptions, leurs types et leurs alias

The following query uses these:

1 SELECT ?property ?propertyType ?propertyLabel ?propertyDescription ?propertyAltLabel WHERE {
2   ?property wikibase:propertyType ?propertyType .
3   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
4 }
5 ORDER BY ASC(xsd:integer(STRAFTER(STR(?property), 'P')))

References

Content of a reference for a specific statement

The following query uses these:

  • Properties: described by source (P1343) View with Reasonator View with SQID, section, verse, or paragraph (P958) View with Reasonator View with SQID
     1 # See also the SPARQL manual
     2 # https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Qualifiers,_References_and_Ranks
     3 # In this example we look for statements which assign a specific value (Q51955019)
     4 # to the property P1343 and then look for references of that property, specifically
     5 # the string associated to P958 for the reference. May actually bring up references
     6 # for other P1343 statements; uses the shortened expression syntax with brackets.
     7 SELECT ?item ?reference
     8 WHERE
     9 {
    10 ?item wdt:P1343 wd:Q51955019 .
    11 ?item p:P1343 [ prov:wasDerivedFrom [ pr:P958 ?reference ] ] .
    12 }
    

Projets Wikimédia

Liens de sites

Pays qui ont un lien de sites vers Wikipédia en anglais

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID
     1 SELECT ?country ?countryLabel ?article WHERE {
     2 
     3     ?country wdt:P31 wd:Q3624078 . # sovereign state
     4     ?article schema:about ?country .
     5     ?article schema:isPartOf <https://en.wikipedia.org/>.
     6 
     7     SERVICE wikibase:label {
     8        bd:serviceParam wikibase:language "en"
     9     }
    10 }
    

Pays qui ont un article de qualité sur Wikipédia en russe

SELECT ?sitelink ?itemLabel WHERE {
  ?item wdt:P31 wd:Q6256.
  ?sitelink schema:isPartOf <https://ru.wikipedia.org/>;
     schema:about ?item;
     wikibase:badge wd:Q17437796 . # Sitelink is badged as a Featured Article
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } .
} ORDER BY ?itemLabel

Try it!

Nombre de liens de sites des éléments avec Art UK artist ID (P1367) pour chaque langue

The following query uses these:

  • Properties: Art UK artist ID (P1367) View with Reasonator View with SQID
    1 SELECT ?lang (COUNT(DISTINCT ?article) AS ?count) WHERE {
    2   ?article schema:about/wdt:P1367 ?yp_id .  # find articles about things with a BBC 'Your paintings' artist identifier
    3   FILTER (SUBSTR(str(?article), 11, 15) = ".wikipedia.org/") .
    4   ?article schema:inLanguage ?lang .
    5 } GROUP BY ?lang
    6 ORDER BY DESC (?count)
    

Titres des articles à propos des villages ukrainiens sur Wikipédia en roumain

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, country (P17) View with Reasonator View with SQID
     1 #Show titles of articles about Ukrainian villages on Romanian Wikipedia, plus English and Ukrainian labels in Wikidata items
     2 #added in 2017-05
     3 SELECT DISTINCT ?item ?LabelEN ?LabelUK ?page_titleRO WHERE {
     4   ?item wdt:P31 wd:Q532 .  
     5   ?item wdt:P17 wd:Q212 .
     6   ?article schema:about ?item ; schema:isPartOf <https://ro.wikipedia.org/> ;  schema:name ?page_titleRO .
     7   ?item rdfs:label ?LabelEN filter (lang(?LabelEN) = "en") .
     8   ?item rdfs:label ?LabelUK filter (lang(?LabelUK) = "uk") .
     9 }
    10 LIMIT 300
    

Pages Wikisource des auteurs d’articles scientifiques

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID
     1 #Wikisource pages for authors of scientific articles, ordered by Wikisource language
     2 #added in 2017-09
     3 SELECT DISTINCT ?item ?wikisourceSitelink ?wikisourceLanguage WHERE {
     4   ?wikisourceSitelink schema:isPartOf [ wikibase:wikiGroup "wikisource" ];
     5                       schema:inLanguage ?wikisourceLanguage;
     6                       schema:about ?item.
     7   ?paper wdt:P31 wd:Q13442814;
     8          wdt:P50 ?item.
     9 }
    10 ORDER BY ?wikisourceLanguage
    11 LIMIT 300
    

Items with a GTAA id and their articles on the Dutch and English Wikipedia

select ?item ?itemLabel ?gtaa ?articleEn ?articleNl where {
  ?item wdt:P1741 ?gtaa .
  optional {
    ?articleEn schema:about ?item.
    ?articleNl schema:about ?item.
    ?articleEn schema:isPartOf <https://en.wikipedia.org/>.
    ?articleNl schema:isPartOf <https://nl.wikipedia.org/>.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl". }
}

Try it!

People deceased in 2018 ordered by the number of sitelinks

select ?person ?personLabel ?died ?sitelinks where {
  ?person wdt:P31 wd:Q5;
          wdt:P570 ?died.
  filter (?died >= "2018-01-01T00:00:00Z"^^xsd:dateTime && ?died < "2019-01-01T00:00:00Z"^^xsd:dateTime)
  ?person wikibase:sitelinks ?sitelinks.
  service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}  order by desc(?sitelinks) limit 100

Try it!

Divertissement

Groupes de rock dont le nom commence par « M »

SELECT DISTINCT ?band ?bandLabel
WHERE
{
	?band  wdt:P31 wd:Q5741069 .
        ?band rdfs:label ?bandLabel .
	FILTER(STRSTARTS(?bandLabel, 'M')) .
}

Try it!

Gagnant des Oscars par prix et date

SELECT DISTINCT ?item ?itemLabel ?awardLabel ?time
{
    ?item wdt:P106/wdt:P279* wd:Q3455803 ; # Items with the Occupation(P106) of Director(Q3455803) or a subclass(P279)
          p:P166 ?awardStat .              # ... with an awarded(P166) statement
    ?awardStat pq:P805 ?award ;            # Get the award (which is "subject of" XXth Academy Awards)
               ps:P166 wd:Q103360 .        # ... that has the value Academy Award for Best Director(Q103360)
    ?award wdt:P585 ?time .                # the "point of time" of the Academy Award
    SERVICE wikibase:label {               # ... include the labels
        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"
    }
}
ORDER BY DESC(?time)

Try it!

Données sur les Oscars

#added before 2016-10
SELECT ?human ?humanLabel ?awardEditionLabel ?awardLabel ?awardWork ?awardWorkLabel ?director ?directorLabel ?time
WHERE
{
	{
		SELECT (SAMPLE(?human) AS ?human) ?award ?awardWork (SAMPLE(?director) AS ?director) (SAMPLE(?awardEdition) AS ?awardEdition) (SAMPLE(?time) AS ?time) WHERE {
			?award wdt:P31 wd:Q19020 .			# All items that are instance of(P31) of Academy awards (Q19020)
			{
				?human p:P166 ?awardStat .              # Humans with an awarded(P166) statement
				?awardStat ps:P166 ?award .     	 # ... that has any of the values of ?award
				?awardStat pq:P805 ?awardEdition . # Get the award edition (which is "subject of" XXth Academy Awards)
				?awardStat pq:P1686 ?awardWork . # The work they have been awarded for
				?human wdt:P31 wd:Q5 . 				# Humans
			} UNION {
				?awardWork wdt:P31 wd:Q11424 . # Films
				?awardWork p:P166 ?awardStat . # ... with an awarded(P166) statement
				?awardStat ps:P166 ?award .     	 # ... that has any of the values of ?award
				?awardStat pq:P805 ?awardEdition . # Get the award edition (which is "subject of" XXth Academy Awards)
			}
			OPTIONAL {
				?awardEdition wdt:P585 ?time . # the "point of time" of the Academy Award
				?awardWork wdt:P57 ?director .
			}
		}
		GROUP BY ?awardWork ?award # We only want every movie once for a category (a 'random' person is selected)
	}

	SERVICE wikibase:label {            # ... include the labels
		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
	}
}
ORDER BY DESC(?time)

Try it!

Personnes qui ont reçu à la fois un Oscar et un prix Nobel

The following query uses these:

  • Properties: award received (P166) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT DISTINCT ?person ?personLabel WHERE {
    2   ?person wdt:P166/wdt:P31? wd:Q7191 .
    3   ?person wdt:P166/wdt:P31? wd:Q19020 .
    4   SERVICE wikibase:label {
    5     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
    6   }
    7 }
    

Nombre de prix décernés aux académiciens par type de prix

#added before 2016-10

SELECT ?awardCount ?award ?awardLabel WHERE {
	{
		SELECT (COUNT(?award) AS ?awardCount) ?award
		WHERE
		{
			{
				SELECT (SAMPLE(?human) AS ?human) ?award ?awardWork (SAMPLE(?director) AS ?director) (SAMPLE(?awardEdition) AS ?awardEdition) (SAMPLE(?time) AS ?time) WHERE {
					?award wdt:P31 wd:Q19020 .			# All items that are instance of(P31) of Academy awards (Q19020)
					{
						?human p:P166 ?awardStat .              # Humans with an awarded(P166) statement
						?awardStat ps:P166 ?award .     	 # ... that has any of the values of ?award
						?awardStat pq:P805 ?awardEdition . # Get the award edition (which is "subject of" XXth Academy Awards)
						?awardStat pq:P1686 ?awardWork . # The work they have been awarded for
						?human wdt:P31 wd:Q5 . 				# Humans
					} UNION {
						?awardWork wdt:P31 wd:Q11424 . # Films
						?awardWork p:P166 ?awardStat . # ... with an awarded(P166) statement
						?awardStat ps:P166 ?award .     	 # ... that has any of the values of ?award
						?awardStat pq:P805 ?awardEdition . # Get the award edition (which is "subject of" XXth Academy Awards)
					}
					OPTIONAL {
						?awardEdition wdt:P585 ?time . # the "point of time" of the Academy Award
						?awardWork wdt:P57 ?director .
					}
				}
				GROUP BY ?awardWork ?award # We only want every movie once for a category (a 'random' person is selected)
			}
		} GROUP BY ?award
		ORDER BY ASC(?awardCount)
	}
	SERVICE wikibase:label {            # ... include the labels
		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
	}
}

Try it!

Réalisateurs classés par leur nombre de liens de sites multipliés par leur nombre de films

SELECT ?director ?director_label ?films ?sitelinks ((?films * ?sitelinks) as ?rank)
WHERE {
  {SELECT ?director (count(distinct ?film) as ?films) (count(distinct ?sitelink) as ?sitelinks)
     WHERE { 
       ?director wdt:P106 wd:Q2526255 .  				# has "film director" as occupation
	   ?film wdt:P57 ?director . 	 					# get all films directed by the director
       ?sitelink schema:about ?director .				# get all the sitelinks about the director
       } GROUP BY ?director }
SERVICE wikibase:label { 
  bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".  # Get label if it exists
?director rdfs:label ?director_label } 	
} ORDER BY DESC(?rank)
LIMIT 100

Try it!

Liste des épisodes de la série télévisée Les Simpson par saison

SELECT ?show ?showLabel ?seasonNumber ?episode ?episodeLabel
WHERE {
	BIND(wd:Q886 as ?show) .
	?season wdt:P361 ?show .
	?episode wdt:P361 ?season .
	?season p:P179 [
	        pq:P1545 ?seasonNumber] .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY xsd:integer(?seasonNumber)

Try it!

Pokémon!

#added before 2016-10

# Gotta catch 'em all
SELECT DISTINCT ?pokemon ?pokemonLabel ?pokedexNumber
WHERE
{
    ?pokemon wdt:P31/wdt:P279* wd:Q3966183 .
    ?pokemon p:P1112 ?statement.
    ?statement ps:P1112 ?pokedexNumber;
              pq:P642 wd:Q20005020.
    FILTER ( !isBLANK(?pokedexNumber) ) .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
ORDER BY (?pokedexNumber)

Try it!

Épisodes de New York, police judiciaire

# All Law & Order episodes on Wikidata.
# According to enwp, “[a] total of 456 original episodes… aired before cancellation” (https://en.wikipedia.org/wiki/List_of_Law_%26_Order_episodes).
# As of this writing, the query returns 451 results, so some episodes are missing (either without item or lacking the necessary statements to match this query).

SELECT (SAMPLE(?seasonNumber) AS ?seasonNumber) (SAMPLE(?episodeNumber) AS ?episodeNumber) (SAMPLE(?title) AS ?title) (MIN(?pubDate) AS ?pubDate) ?episode
{
  # All episodes should be instance of episode with series Law & Order.
  ?episode wdt:P31 wd:Q21191270;
           wdt:P179 wd:Q321423.
  # Many of them also have the season as series, so we can get episode and season number from qualifiers there.
  OPTIONAL {
    ?episode p:P179 [
      # the season also has series Law & Order
      ps:P179/p:P179 [
        ps:P179 wd:Q321423;
                pq:P1545 ?seasonNumber
      ] ;
      pq:P1545 ?episodeNumber
    ]
  }
  OPTIONAL { ?episode wdt:P1476 ?title. }
  OPTIONAL { ?episode wdt:P577 ?pubDate. }
}
GROUP BY ?episode # make sure we return each episode only once – a few have multiple publication dates, for example
ORDER BY IF(BOUND(?seasonNumber), xsd:integer(?seasonNumber), 1000) xsd:integer(?episodeNumber) ?title

Try it!

Sujets principaux des épisodes de À la Maison-Blanche

SELECT DISTINCT ?episode ?ordinal ?episodeLabel ?subject ?subjectLabel
WHERE {
  ?episode wdt:P31/wdt:P279* wd:Q1983062;
           p:P179 ?statement.
  OPTIONAL{ ?episode wdt:P921 ?subject }
  ?statement ps:P179 wd:Q3577037;
             pq:P1545 ?ordinal
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY xsd:integer(?ordinal)

Try it!

Films avec Bud Spencer

SELECT ?item ?itemLabel (MIN(?date) AS ?date) ?_image
WHERE {
  ?item wdt:P161 wd:Q221074;
        wdt:P577 ?date
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P18 ?_image. }
} GROUP BY ?item ?itemLabel ?_image
ORDER BY (?date)

Try it!

Sujets de fiction de l'univers de Marvel

SELECT ?char ?charName (GROUP_CONCAT(DISTINCT ?typeLabel;separator=", ") AS ?types) (GROUP_CONCAT(DISTINCT ?universeLabel;separator=", ") AS ?universes)
WHERE {
	?char wdt:P1080 wd:Q931597;
          wdt:P31 ?type ;
          wdt:P1080 ?universe .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                         ?char rdfs:label ?charName .
                         ?universe rdfs:label ?universeLabel .
                         ?type rdfs:label ?typeLabel .}
} GROUP BY ?char ?charName

Try it!

Actrices indiennes contemporaines

SELECT ?item ?itemLabel ?itemDescription (SAMPLE(?img) AS ?image) (SAMPLE(?dob) AS ?dob) ?sl
WHERE {
	?item wdt:P106 wd:Q33999 ;
          wdt:P27 wd:Q668 ;
          wdt:P21 wd:Q6581072 .
	MINUS { ?item wdt:P570 [] }
	OPTIONAL { ?item wdt:P18 ?img }
	OPTIONAL { ?item wdt:P569 ?dob } 
	OPTIONAL { ?item wikibase:sitelinks ?sl } 
  	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
} GROUP BY ?item ?itemLabel ?itemDescription ?sl
ORDER BY DESC(?sl)

Try it!

Articles de Wikipédia en pendjabi à propos d'actrices pakistanaises

#added 2017-03-25 (46 results)
SELECT ?sitelink
WHERE
{
	# gender = female
  	?item wdt:P21 wd:Q6581072 .

  	# country = Pakistan (Q25)
  	{ ?item wdt:P27 wd:Q843 }

        # occupation = actress (Q33999)
  	{ ?item wdt:P106 wd:Q33999 }
 
	# look for articles (sitelinks) in Punjabi ("pa")
  	{ ?sitelink schema:about ?item . ?sitelink schema:inLanguage "pa" }

	# humans only
  	?item wdt:P31 wd:Q5 .
}
#Listeria can only handle up to 5000
LIMIT 5000

Try it!

Tous les interprètes du Dr Who

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, series ordinal (P1545) View with Reasonator View with SQID, performer (P175) View with Reasonator View with SQID
    1 #added 2017-07-16
    2 SELECT ?doctor ?doctorLabel ?ordinal ?performer ?performerLabel WHERE {
    3   ?doctor wdt:P31 wd:Q34358 .
    4   OPTIONAL { ?doctor wdt:P1545 ?ordinal }
    5   OPTIONAL { ?doctor wdt:P175 ?performer }
    6   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 } ORDER BY ASC(xsd:integer(?ordinal) )
    

Les films positionné sur une carte en fonction des lieux de leur histoire

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

1 #defaultView:Map
2 SELECT ?movie ?movieLabel ?narrative_location ?narrative_locationLabel ?coordinates WHERE {
3    ?movie wdt:P840 ?narrative_location ;
4           wdt:P31 wd:Q11424 .
5    ?narrative_location wdt:P625 ?coordinates .
6   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
7 }

Films réalisés en 2017

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID
    1 SELECT DISTINCT ?item ?itemLabel WHERE {
    2   ?item wdt:P31 wd:Q11424.
    3   ?item wdt:P577 ?pubdate.
    4   FILTER((?pubdate >= "2017-01-01T00:00:00Z"^^xsd:dateTime) && (?pubdate <= "2017-12-31T00:00:00Z"^^xsd:dateTime))
    5   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    6 }
    

Géographie

Continents

Continents

#added before 2016-10

SELECT ?continent ?continentLabel
WHERE
{
  ?continent wdt:P31 wd:Q5107.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY xsd:integer(SUBSTR(STR(?continent),STRLEN("http://www.wikidata.org/entity/Q")+1))

Try it!

Quelques autres continents

continent (P30)

#added before 2016-10

SELECT ?continentLabel
WHERE
{
  { # subquery for optimization so the label service doesn’t have to do as much work (228?ms vs 20731?ms)
    SELECT DISTINCT ?continent
    WHERE
    {
      [] wdt:P30 ?continent.
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY xsd:integer(SUBSTR(STR(?continent),STRLEN("http://www.wikidata.org/entity/Q")+1))

Try it!

Endroits du continent Antarctique situés plus de 3000km au Nord du Pole-Sud

#added before 2016-10

#defaultView:Map
SELECT ?place ?placeLabel ?location WHERE {
  wd:Q933 wdt:P625 ?southPole.                         # coordinates of south pole
  ?place wdt:P30 wd:Q51;                               # continent: antarctica
         wdt:P625 ?location.
  FILTER(geof:distance(?location, ?southPole) > 3000). # over 3000?km away from south pole
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Try it!

Pays

Liste des pays actuels et capitale(s)

#added before 2016-10
SELECT DISTINCT ?country ?countryLabel ?capital ?capitalLabel
WHERE
{
  ?country wdt:P31 wd:Q3624078 .
  #not a former country
  FILTER NOT EXISTS {?country wdt:P31 wd:Q3024240}
  #and no an ancient civilisation (needed to exclude ancient Egypt)
  FILTER NOT EXISTS {?country wdt:P31 wd:Q28171280}
  OPTIONAL { ?country wdt:P36 ?capital } .

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY ?countryLabel

Try it!

Plus grandes villes par pays

#added before 2016-10

#Largest cities per country
SELECT DISTINCT ?city ?cityLabel ?population ?country ?countryLabel ?loc WHERE {
	{
		SELECT (MAX(?population) AS ?population) ?country WHERE {
			?city wdt:P31/wdt:P279* wd:Q515 .
			?city wdt:P1082 ?population .
			?city wdt:P17 ?country .
		}
		GROUP BY ?country
		ORDER BY DESC(?population)
	}
	?city wdt:P31/wdt:P279* wd:Q515 .
	?city wdt:P1082 ?population .
	?city wdt:P17 ?country .
	?city wdt:P625 ?loc .
	SERVICE wikibase:label {
		bd:serviceParam wikibase:language "en" .
	}
}

Try it!

Nombre de contributeurs de Wikidata par million d'habitants pour tous les pays de l'UE

#added before 2016-10

#Interesting maintenance query that shows the relative prominence of a country's current (living) population on Wikidata. The query tends to time out when using all countries at once, but it might be possible to get the figures for each individual country by using uncommenting the line as indicated below
SELECT
	?country ?countryLabel
	?wikiPersons
	?population
	(ROUND(?wikiPersons/?population*1000000) AS ?wikiPersonsPerM)
WHERE
{
	{ SELECT ?country (count(*) as ?wikiPersons) WHERE {
		{SELECT DISTINCT ?person ?country WHERE {
			wd:Q458 wdt:P150 ?country .   # European Union  contains administrative territorial entity
			# BIND( wd:Q30 AS ?country ) # use instead of previous line to check individual countries
			?person wdt:P31 wd:Q5 .
			?person wdt:P27 ?country .
			FILTER NOT EXISTS{ ?person wdt:P570 ?date } # only count living people
		} }
	} GROUP BY ?country  }
	?country wdt:P1082 ?population
	SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY DESC(?wikiPersonsPerM)

Try it!

Articles à propos de Wikidata

#added before 2016-10

#papers about Wikidata
SELECT ?item ?itemLabel
WHERE
{
  ?item (wdt:P31/wdt:P279*) wd:Q191067.
  ?item wdt:P921 wd:Q2013.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 100

Try it!

Pays classés par population

# defaultView:BubbleChart
SELECT DISTINCT ?countryLabel ?population
{
  ?country wdt:P31 wd:Q6256 ;
           wdt:P1082 ?population .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?population ?countryLabel
ORDER BY DESC(?population)

Try it!

Population d’un pays avec la somme des population de ses villes

Lists for each country the population and the total of the populations of all cities of this country. If data were complete and populations were measured at the same time for each country and the respective cities then the ratio would be 1.

SELECT ?country ?countryLabel ?population ?totalCityPopulation (?population / ?totalCityPopulation AS ?ratio) {
  ?country wdt:P1082 ?population .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
  {
    SELECT ?country (SUM(?cityPopulation) AS ?totalCityPopulation) WHERE {
      ?city wdt:P31 wd:Q515 .
      ?city wdt:P17 ?country .
      ?city wdt:P1082 ?cityPopulation .
    } GROUP BY ?country
  }
} ORDER BY ?ratio

Try it!

Noms des pays d’Afrique dans leurs langues officielles ainsi qu’en anglais

The following query uses these:

  • Properties: continent (P30) View with Reasonator View with SQID, official language (P37) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, Wikimedia language code (P424) View with Reasonator View with SQID
     1 SELECT DISTINCT ?item ?itemLabel_ol ?official_language ?itemLabel_en WHERE {
     2   ?item wdt:P30 wd:Q15 ;
     3         wdt:P37 ?officiallanguage ;
     4         wdt:P31 wd:Q6256 .
     5   ?officiallanguage wdt:P424 ?langcode .
     6   ?item rdfs:label ?itemLabel_ol . FILTER(lang(?itemLabel_ol)=?langcode)
     7   ?item rdfs:label ?itemLabel_en . FILTER(lang(?itemLabel_en)='en')
     8   ?officiallanguage rdfs:label ?official_language . FILTER(lang(?official_language)='en')
     9 }
    10 ORDER BY ?item ?itemLabel_lol ?official_language
    

Villes

Anciennes capitales

#added before 2016-10

#defaultView:Map
SELECT DISTINCT ?country ?countryLabel ?capital ?capitalLabel ?coordinates ?ended
WHERE
{
  ?country p:P36 ?stat.
  ?stat ps:P36 ?capital.
  ?capital wdt:P625 ?coordinates.
  OPTIONAL {
    ?country wdt:P582|wdt:P576 ?ended.
  }
  OPTIONAL {
    ?capital wdt:P582|wdt:P576 ?ended.
  }
  OPTIONAL {
    ?stat pq:P582 ?ended.
  }
  FILTER(BOUND(?ended)).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Try it!

Plus grandes villes du monde

#added before 2016-10
 #defaultView:BubbleChart
SELECT DISTINCT ?cityLabel ?population ?gps
WHERE
{
  ?city wdt:P31/wdt:P279* wd:Q515 .
  ?city wdt:P1082 ?population .
  ?city wdt:P625 ?gps .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY DESC(?population) LIMIT 100

Try it!

Villes de même population qu’Eindhoven, à 1000 habitants près

#added before 2016-10

#defaultView:Map
SELECT DISTINCT ?city ?cityLabel ?location ?populatie2 WHERE {
  wd:Q9832 wdt:P1082 ?populatie .
  ?city wdt:P1082 ?populatie2 ;
        wdt:P625 ?location .
  FILTER (abs(?populatie - ?populatie2) < 1000)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl" }
}

Try it!

Où est Anvers dans le monde ?

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:Map
 4 SELECT DISTINCT ?settlement ?name ?coor
 5 WHERE
 6 {
 7   
 8    ?subclass_settlement wdt:P279+ wd:Q486972 .
 9    ?settlement wdt:P31 ?subclass_settlement ;
10                wdt:P625 ?coor ;
11                 rdfs:label ?name .
12    FILTER regex(?name, "Antwerp", "i")
13 
14 }

Destinations au départ de l'aéroport international d'Anvers

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:Map
 4 SELECT ?connectsairport ?connectsairportLabel ?place_served ?place_servedLabel ?coor
 5 WHERE
 6 {
 7   VALUES ?airport { wd:Q17480 } # Antwerp international airport  wd:Q17480
 8   ?airport wdt:P81 ?connectsairport ;
 9            wdt:P625 ?base_airport_coor .
10   ?connectsairport wdt:P931 ?place_served ;
11                    wdt:P625 ?coor .
12  
13   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
14 }

Villes reliées par la route européenne E40

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:Map
 4 SELECT ?city ?cityLabel ?coordinates
 5 WHERE
 6 {
 7    VALUES ?highway {wd:Q327162 }
 8    ?highway wdt:P2789 ?city .
 9     ?city wdt:P625 ?coordinates .
10    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
11 }

Villes reliées par le Transmongolien et le Transsibérien

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:Map
 4 SELECT ?city ?cityLabel ?coordinates
 5 WHERE
 6 {
 7    VALUES ?highway { wd:Q559037 wd:Q58767 }
 8    ?highway wdt:P2789 ?city .
 9     ?city wdt:P625 ?coordinates .
10    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
11 }

Les villes connectées à Paramaribo (au Surinam) par des routes principales

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:Map
 4 SELECT DISTINCT ?connection ?connectionLabel ?connectedWith ?connectedWithLabel ?coor
 5 WHERE
 6 {
 7   VALUES ?city {wd:Q3001} # wd:Q3001 = Paramaribo}
 8   ?connection wdt:P2789+ ?city ;
 9               wdt:P2789+ ?connectedWith .
10   ?connectedWith wdt:P625 ?coor .
11   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
12   }

Noms de 100 villes de plus de 1 000 000 d’habitants dans la langue de leur pays

The following query uses these:

  • Properties: population (P1082) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, country (P17) View with Reasonator View with SQID, official language (P37) View with Reasonator View with SQID, Wikimedia language code (P424) View with Reasonator View with SQID
     1 #added before 2016-10
     2 
     3 # Show the names of 100 cities with a population larger than 1000000 in the native languages of their countries
     4 SELECT ?city ?cityLabel ?country ?countryLabel ?lang ?langLabel ?langCode ?population
     5 WHERE
     6 {
     7   ?city wdt:P1082 ?population .
     8  
     9   FILTER(?population>1000000)
    10  
    11   ?city wdt:P31 wd:Q515;
    12         wdt:P17 ?country;
    13         rdfs:label ?cityLabel .
    14   ?country wdt:P37 ?lang;
    15            rdfs:label ?countryLabel .
    16   ?lang wdt:P424 ?langCode;
    17         rdfs:label ?langLabel .
    18  
    19   FILTER(lang(?cityLabel)=?langCode)
    20   FILTER(lang(?countryLabel)=?langCode)
    21   FILTER(lang(?langLabel)=?langCode)
    22 } LIMIT 100
    

Distances entre deux cités ou municipalité dans une certaine zone

groupés par niveau de distance, la couleur dépendant de la distance

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:BarChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from ?to ?distGrp WHERE {
     5   {
     6     SELECT ?from ?to ?distNum ?mun ?mun2 WHERE {
     7       { SELECT ?mun (SAMPLE(?loc) AS ?loc)
     8         WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
     9                      wdt:P131 var_area:;
    10                      wdt:P625 ?loc. }
    11         GROUP BY ?mun
    12       }
    13       OPTIONAL {
    14         { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    15           WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    16                        wdt:P131 var_area:;
    17                        wdt:P625 ?loc. }
    18           GROUP BY ?mun
    19         }
    20       }
    21       BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    22 
    23       SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    24         ?mun rdfs:label ?from.
    25         ?mun2 rdfs:label ?to.
    26       }
    27     }
    28   }
    29   FILTER(CONCAT(?from,STR(?mun)) <= CONCAT(?to,STR(?mun2))).
    30   #BIND(IF(STR(?from) < STR(?to),CONCAT(?from," <--> ",?to),
    31   #  CONCAT(?to," <--> ",?from)) AS ?distLabel).
    32 
    33   BIND(COALESCE(
    34     IF(?distNum >= 40, "40 - .. km", 1/0),
    35     IF(?distNum >= 30, "30 - 40 km", 1/0),
    36     IF(?distNum >= 20, "20 - 30 km", 1/0),
    37     IF(?distNum >= 10, "10 - 20 km", 1/0),
    38     IF(?distNum >= 5, "05 - 10 km", 1/0),
    39     IF(?distNum >= 1, "01 - 05 km", "00 - 01 km")) AS ?distGrp).
    40 }
    41 ORDER BY ?from ?distGrp
    
regroupées alphabétiquement par ville, sur les abscisses

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from (?distGrp1 AS ?kilometers) ?to WHERE {
     5   { SELECT ?mun (SAMPLE(?loc) AS ?loc)
     6     WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
     7                  wdt:P131 var_area:;
     8                  wdt:P625 ?loc. }
     9     GROUP BY ?mun
    10   }
    11   OPTIONAL {
    12     { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    13       WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    14                    wdt:P131 var_area:;
    15                    wdt:P625 ?loc. }
    16       GROUP BY ?mun
    17     }
    18   }
    19   BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    20   BIND(STR(ROUND(?distNum)) AS ?distGrp0).
    21   BIND(CONCAT(SUBSTR("000",STRLEN(?distGrp0)+1),?distGrp0,".",STR(ROUND((?distNum-FLOOR(?distNum))*10))," km") AS ?distGrp1).
    22 
    23   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    24     ?mun rdfs:label ?from.
    25     ?mun2 rdfs:label ?to.
    26   }
    27 }
    28 ORDER BY ?from ?kilometers
    
regroupé par municipalité (abscisse), par somme de distance

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from (?distNum AS ?kilometers) ?to WHERE {
     5   { SELECT ?mun (SAMPLE(?loc) AS ?loc)
     6     WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
     7                  wdt:P131 var_area:;
     8                  wdt:P625 ?loc. }
     9     GROUP BY ?mun
    10   }
    11   OPTIONAL {
    12     { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    13       WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    14                    wdt:P131 var_area:;
    15                    wdt:P625 ?loc. }
    16       GROUP BY ?mun
    17     }
    18   }
    19   BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    20 
    21   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    22     ?mun rdfs:label ?from.
    23     ?mun2 rdfs:label ?to.
    24   }
    25 }
    26 ORDER BY ?from ?kilometers
    
Regroupé par municipalité sur les abscisse, avec une animation qui présente et change les valeurs en ordonnées

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from (?distNum AS ?kilometers) ?to (?from AS ?animation) WHERE {
     5   { SELECT ?mun (SAMPLE(?loc) AS ?loc)
     6     WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
     7                  wdt:P131 var_area:;
     8                  wdt:P625 ?loc. }
     9     GROUP BY ?mun
    10   }
    11   OPTIONAL {
    12     { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    13       WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    14                    wdt:P131 var_area:;
    15                    wdt:P625 ?loc. }
    16       GROUP BY ?mun
    17     }
    18   }
    19   BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    20 
    21   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    22     ?mun rdfs:label ?from.
    23     ?mun2 rdfs:label ?to.
    24   }
    25 }
    26 ORDER BY ?from ?kilometers
    
regroupé par municipalité sur en abscisses, animé par municipalité dans la profondeur

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from (?distNum AS ?kilometers) ?to (?to AS ?animation) WHERE {
     5   { SELECT ?mun (SAMPLE(?loc) AS ?loc)
     6     WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
     7                  wdt:P131 var_area:;
     8                  wdt:P625 ?loc. }
     9     GROUP BY ?mun
    10   }
    11   OPTIONAL {
    12     { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    13       WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    14                    wdt:P131 var_area:;
    15                    wdt:P625 ?loc. }
    16       GROUP BY ?mun
    17     }
    18   }
    19   BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    20 
    21   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    22     ?mun rdfs:label ?from.
    23     ?mun2 rdfs:label ?to.
    24   }
    25 }
    26 ORDER BY ?from ?kilometers
    
regroupé par municipalité sur les abscisses, animés par intervalle de valeur de distance donné

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from (?distNum AS ?kilometers) ?to (?distGrp AS ?animation) WHERE {
     5   { SELECT ?mun (SAMPLE(?loc) AS ?loc)
     6     WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
     7                  wdt:P131 var_area:;
     8                  wdt:P625 ?loc. }
     9     GROUP BY ?mun
    10   }
    11   OPTIONAL {
    12     { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    13       WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    14                    wdt:P131 var_area:;
    15                    wdt:P625 ?loc. }
    16       GROUP BY ?mun
    17     }
    18   }
    19   #FILTER (STR(?mun) <= STR(?mun2)).
    20   BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    21   BIND(COALESCE(
    22     IF(?distNum >= 40, "40 km und mehr", 1/0),
    23     IF(?distNum >= 30, "30 - 40 km", 1/0),
    24     IF(?distNum >= 20, "20 - 30 km", 1/0),
    25     IF(?distNum >= 10, "10 - 20 km", 1/0),
    26     IF(?distNum >= 5, "05 - 10 km", 1/0),
    27     IF(?distNum >= 1, "01 - 05 km", "00 - 01 km")) AS ?distGrp).
    28   
    29   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    30     ?mun rdfs:label ?from.
    31     ?mun2 rdfs:label ?to.
    32   }
    33 }
    34 ORDER BY ?animation ?from ?kilometers
    
regroupé par municipalité sur les abscisses, animés par ordre de distance décroissante (du plus éloigné au plus proche)

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
     1 #defaultView:ScatterChart
     2 PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
     3 PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
     4 SELECT ?from ?kilometers ?to ?rank_group
     5 WHERE {
     6   {
     7     SELECT (SAMPLE(?mun) AS ?mun) (SAMPLE(?mun2) AS ?mun2) (SAMPLE(?distNum) AS ?kilometers)
     8            (COUNT(*)-1 AS ?rg) (SUBSTR("00",1+STRLEN(STR(?rg))) AS ?rgpad)
     9            (IF(FLOOR((?rg-(100*FLOOR(?rg/100)))/10)=1,0,?rg-(10*FLOOR(?rg/10))) AS ?rgmod)
    10            (IF(?rgmod=1,"st",IF(?rgmod=2,"nd",IF(?rgmod=3,"rd","th"))) AS ?rgord)
    11            (CONCAT(?rgpad,STR(?rg),?rgord,"-most farthest places") AS ?rank_group)
    12     WHERE {
    13       { SELECT ?mun (SAMPLE(?loc) AS ?loc)
    14         WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    15                      wdt:P131 var_area:;
    16                      wdt:P625 ?loc. }
    17         GROUP BY ?mun
    18       }
    19       OPTIONAL {
    20         { SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
    21           WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    22                        wdt:P131 var_area:;
    23                        wdt:P625 ?loc. }
    24           GROUP BY ?mun
    25         }
    26       }
    27       OPTIONAL {
    28         { SELECT (?mun AS ?mun3) (SAMPLE(?loc) AS ?loc3)
    29           WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
    30                        wdt:P131 var_area:;
    31                        wdt:P625 ?loc. }
    32           GROUP BY ?mun
    33         }
    34       }
    35       BIND(geof:distance(?loc, ?loc2) AS ?distNum).
    36       BIND(geof:distance(?loc, ?loc3) AS ?d).
    37       FILTER(?distNum >= ?d).
    38     } GROUP BY ?mun ?mun2 ?distNum
    39   }
    40   
    41   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    42     ?mun rdfs:label ?from.
    43     ?mun2 rdfs:label ?to.
    44   }
    45 }
    46 ORDER BY ?rank_group ?kilometers ?from
    

Rivière

Les plus longues rivières

The following query uses these:

Features: BubbleChart (Q24515280) View with Reasonator View with SQID

 1 #added before 2016-10
 2 
 3 #defaultView:BubbleChart
 4 SELECT ?item ?itemLabel ?length ?pic ?location
 5 WHERE
 6 {
 7   ?item wdt:P31/wdt:P279* wd:Q4022 .
 8   ?item wdt:P2043 ?length .
 9   ?item wdt:P18 ?pic .
10   ?item wdt:P625 ?location
11   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
12 } ORDER BY DESC(?length) ?itemLabel
13 LIMIT 50

Les plus longues rivières par continant

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, length (P2043) View with Reasonator View with SQID, continent (P30) View with Reasonator View with SQID
     1 #added before 2016-10
     2 
     3 SELECT ?continent ?river ?continentLabel ?riverLabel
     4 WHERE
     5 {
     6   {
     7     SELECT ?continent (MAX(?length) AS ?length)
     8     WHERE
     9     {
    10       ?river wdt:P31/wdt:P279* wd:Q355304;
    11              wdt:P2043 ?length;
    12              wdt:P30 ?continent.
    13     }
    14     GROUP BY ?continent
    15   }
    16   ?river wdt:P31/wdt:P279* wd:Q355304;
    17          wdt:P2043 ?length;
    18          wdt:P30 ?continent.
    19   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
    20 }
    21 ORDER BY ?continentLabel
    

Rivières en Antarctique

#added before 2016-10

SELECT ?river ?riverLabel ?location
WHERE
{
  ?river wdt:P31/wdt:P279* wd:Q355304; # watercourse; includes a few creeks – use wd:Q4022 for rivers only
         wdt:P30 wd:Q51.
  OPTIONAL { ?river wdt:P625 ?location. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Try it!

Étendues d’eau dans lequels le plus de cours d’eau se jettent

#added before 2016-10

# Bodies of water that most watercourses end in (transitive).
# For example, over 4000 watercourses eventually flow into the Ob,
# and since the Ob flows into the Kara Sea, the Kara Sea has over 4000 results as well.
SELECT ?mouth (COUNT(?watercourse) AS ?count)
WHERE
{
  ?watercourse wdt:P403+ ?mouth.
}
GROUP BY ?mouth
ORDER BY DESC(?count)
LIMIT 10

Try it!

Ponts franchissant des rivières situés sur l’ancienne division administrative de Leipzig

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT (SAMPLE(?bridge) AS ?bridge) (SAMPLE(?bridgeLabel) AS ?bridgeLabel)
 3        (SAMPLE(?watercourse) AS ?watercourse) (SAMPLE(?watercourseLabel) AS ?watercourseLabel)
 4        (SAMPLE(?loc) AS ?loc) (SAMPLE(?pic) AS ?pic)
 5        (CONCAT(SAMPLE(?sKey),": ",STR(YEAR(SAMPLE(?s)))) AS ?start)
 6        (CONCAT(SAMPLE(?eKey),": ",STR(YEAR(SAMPLE(?e)))) AS ?end)
 7        (SAMPLE(?article) AS ?article) (IF(BOUND(?article),CONCAT(?bridgeLabel," in Wikipedia"),1/0) AS ?articleLabel)
 8 WHERE {
 9   {
10     SELECT ?bridge ?watercourse WHERE {
11       ?bridge wdt:P31/wdt:P279* wd:Q12280; wdt:P177 ?watercourse.
12       ?watercourse wdt:P31/wdt:P279* wd:Q355304.
13       # the following actually yields a perf penalty atm
14       #?bridge wdt:P17 wd:Q183.
15       #OPTIONAL { ?bridge wdt:P17 ?country. }. FILTER(!BOUND(?country) || ?country = wd:Q183).
16     }
17   }
18 
19   # wd:Q1202, wd:Q183 work as well atm and take progressively more time to complete
20   ?bridge (p:P131|ps:P131)+ wd:Q24186.
21 
22   OPTIONAL { ?bridge wdt:P625 ?loc. }.
23   OPTIONAL { ?bridge wdt:P18 ?pic. }.
24   OPTIONAL { ?bridge wdt:P571 ?s. }.
25   OPTIONAL { ?bridge wdt:P576 ?e. }.
26   
27   OPTIONAL {
28     ?article schema:about ?bridge.
29     FILTER (IF(EXISTS {?article schema:inLanguage "[AUTO_LANGUAGE]".},
30                SUBSTR(str(?article), 1, 25) = "https://[AUTO_LANGUAGE].wikipedia.org/",
31                IF(EXISTS {?article schema:inLanguage "en".},
32                   SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/",
33                   SUBSTR(str(?article), 1, 25) = "https://de.wikipedia.org/"
34                )
35             )).
36   }
37 
38   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de".
39     ?bridge rdfs:label ?bridgeLabel.
40     ?watercourse rdfs:label ?watercourseLabel.
41     wd:P571 rdfs:label ?sKey.
42     wd:P576 rdfs:label ?eKey.
43   }
44 }
45 GROUP BY ?bridge ?watercourse

Montagnes

Monts (disposant de coordonnées) situés sur un autre astre que la Terre

SELECT DISTINCT ?item ?name ?coord ?lat ?lon ?globe
{
   ?item wdt:P31 wd:Q8502 ;
         p:P625 [
           psv:P625 [
             wikibase:geoLatitude ?lat ;
             wikibase:geoLongitude ?lon ;
             wikibase:geoGlobe ?globe ;
           ] ;
           ps:P625 ?coord
         ]
  FILTER ( ?globe != wd:Q2 )
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
    ?item rdfs:label ?name
   }
}
ORDER BY ASC (?name)

Try it!

Les plus hautes montagnes de l’univers

#added before 2016-10

#Mountains over 8000 elevation
SELECT ?subj ?label ?coord ?elev
WHERE
{
	?subj wdt:P2044 ?elev	filter(?elev > 8000) .
	?subj wdt:P625 ?coord .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "en,zh" . ?subj rdfs:label ?label }
}

Try it!

Monts de plus de 800 mètres

elevation above sea level (P2044)

#added before 2016-10

SELECT ?subj ?label ?coord ?elev
WHERE
{
	?subj wdt:P2044 ?elev	filter(?elev > 8000) .
	?subj wdt:P625 ?coord .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "en,zh" . ?subj rdfs:label ?label }
}

Try it!

Monts italiens de plus de 4000 mètres

#defaultView:ImageGrid
SELECT ?item ?itemLabel ?coord ?elev ?picture
{
  ?item p:P2044/psn:P2044/wikibase:quantityAmount ?elev ;  # normalized height
        wdt:P625 ?coord ;
        wdt:P17 wd:Q38 ;
        wdt:P18 ?picture
  FILTER(?elev > 4000)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "it" }
}

Try it!

Stations de métro à Paris

SELECT ?item ?itemLabel ?adjacent ?adjacentL ?coords
{
  ?item wdt:P31/wdt:P279* wd:Q928830 ;
        wdt:P81 wd:Q13224 ;
        wdt:P625 ?coords .
  OPTIONAL {
    ?item p:P197 [ ps:P197 ?adjacent ; pq:P560 wd:Q585752 ] .
    ?adjacent rdfs:label ?adjacentL filter (lang(?adjacentL) = "en")
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
} ORDER BY ?itemLabel

Try it!

Carte des lieux de Broadway

#added before 2016-10

#defaultView:Map
# Venues in Broadway
SELECT DISTINCT ?venue ?venueLabel ?coords {
  	?venue wdt:P1217 ?IDBDB .
    wd:Q235065 wdt:P625 ?broadWayLoc .

    SERVICE wikibase:around {
      ?venue wdt:P625 ?coords .
      bd:serviceParam wikibase:center ?broadWayLoc .
      bd:serviceParam wikibase:radius "1.5" .
    }

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}

Try it!

Combien d’états limitrophes à cet état des USA

#added before 2016-10
SELECT ?state ?stateLabel ?borders
WHERE
{
	{
		SELECT ?state (COUNT(?otherState) as ?borders)
		WHERE
		{
		?state wdt:P31 wd:Q35657 .
		?otherState wdt:P47 ?state .
		?otherState wdt:P31 wd:Q35657 .
		}
		GROUP BY ?state
	}
	SERVICE wikibase:label {
		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
	}
}        
ORDER BY DESC(?borders)

Try it!

Endroits situés au dessous de 10 mètres au dessus du niveau de la mer

#added before 2016-10

#defaultView:Map
SELECT ?p ?location ?el ?image
WHERE
{
  ?p p:P2044/psv:P2044 ?pel.
  ?pel wikibase:quantityAmount ?el.
  ?pel wikibase:quantityUnit ?unit.
  bind(0.01 as ?km).
  filter( (?el < ?km*1000 && ?unit = wd:Q11573) ||
         (?el < ?km*3281 && ?unit = wd:Q3710)
       || (?el < ?km && ?unit = wd:Q828224) ).
  ?p wdt:P625 ?location.
  optional { ?p wdt:P18 ?image }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

Globes utilisés pour géolocaliser des éléments

#added before 2016-10
 SELECT (count(?v) as ?c) ?globe
WHERE
{
	?v wikibase:geoGlobe ?globe
}
GROUP BY ?globe
ORDER BY DESC(?c)

Try it!

Lieux à mois d’un kilomètre de l’Empire State Building

#added before 2016-10
 SELECT ?place ?placeLabel ?location ?instanceLabel
WHERE
{
  wd:Q9188 wdt:P625 ?loc .
  SERVICE wikibase:around {
      ?place wdt:P625 ?location .
      bd:serviceParam wikibase:center ?loc .
      bd:serviceParam wikibase:radius "1" .
  }
  OPTIONAL {  	?place wdt:P31 ?instance  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
  BIND(geof:distance(?loc, ?location) as ?dist)
} ORDER BY ?dist

Try it!

Trouver une municipalité de France pas son code INSEE (sélectionner grâce à un identifiant)

SELECT ?item ?itemLabel ?inseeCode {
  ?item wdt:P374 ?inseeCode .
  FILTER (?inseeCode in ("75056", "69123", "13055"))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

numéros d’urgences en fonction des peuples qui les utilisent

#added before 2016-10

#Lists emergency numbers and the total amount of people which can use them
#defaultView:BubbleChart
SELECT ?emergencyNumber ?emergencyNumberLabel ?tel ?population ?countries
WHERE
{
 ?emergencyNumber wdt:P31 wd:Q694554 .
  OPTIONAL{SELECT ?emergencyNumber (COUNT(?state) as ?countries) (SUM(?pop) as ?population) WHERE {
  	?state wdt:P2852 ?emergencyNumber .
  	OPTIONAL{?state wdt:P1082 ?pop} .
  	?state wdt:P31/wdt:P279* wd:Q6256
  } GROUP BY ?emergencyNumber } .
  OPTIONAL{?emergencyNumber wdt:P1329 ?tel }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
ORDER BY DESC(?population)

Try it!

États allemands, triés par nombre de sièges de société par million d’habitants

#added before 2016-10

# German states, ordered by the number of company headquarters per million inhabitants
# Replace wd:Q1221156 (state of Germany) by anything else you care about, e.g., wd:Q6256 (country)
# Nested queries for correctness (don't count companies twice) and performance (aggregate before adding more data)
# Limits: states without population missing; company data in Wikidata is always incomplete
# Note: This query shows some not-so-easy nesting of DISTINCT (don't count any company twice) and aggregate, in combination with arithmetic output evaluation functions. It is a hard query that may time out if modified.
SELECT
	?state ?stateLabel
	?companies
	?population
	(?companies/?population*1000000 AS ?companiesPerM)
WHERE
{
	{ SELECT ?state (count(*) as ?companies) WHERE {
		{SELECT DISTINCT ?company ?state WHERE {
			?state wdt:P31 wd:Q1221156 .
			?company wdt:P31/wdt:P279* wd:Q4830453 .
			?company wdt:P159/wdt:P131* ?state .
			FILTER NOT EXISTS{ ?company wdt:P576 ?date } # don't count dissolved companies
		} }
	} GROUP BY ?state  }
    ?state wdt:P1082 ?population
	SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
ORDER BY DESC(?companiesPerM)

Try it!

Noms populaires en fonction du lieu de naissance

#added before 2016-10

#defaultView:BubbleChart
SELECT ?cid ?firstname (COUNT(*) AS ?count)
WHERE
{
  ?pid wdt:P19 wd:Q64.
  ?pid wdt:P735 ?cid.
  OPTIONAL {
    ?cid rdfs:label ?firstname
    FILTER((LANG(?firstname)) = "en")
  }
}
GROUP BY ?cid ?firstname
ORDER BY DESC(?count) ?firstname
LIMIT 50

Try it!

Cartes des lieux mentionnés dans les récits de voyages en français lisibles en ligne

#added before 2016-10

#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?ed ?edLabel ?auteurLabel (year(?dateCreation) as ?AnneeCreation) ?lieuLabel ?coord ?lien
WHERE
{
  ?item wdt:P136 wd:Q1164267 .    # genre :récit de voyage
  ?item  wdt:P31 wd:Q571 .        # nature : livre
  OPTIONAL{
    ?item wdt:P50 ?auteur .       # [option] auteur
  }
  OPTIONAL{
    ?item wdt:P571 ?dateCreation. # [option] date de création              
  }
 
  ?item  wdt:P840 ?lieu .         # lieu de l'action
  MINUS {?item  wdt:P840 wd:Q933} # (bug du Pôle Sud)
  ?lieu wdt:P625 ?coord .         # coordonnées géographiques du lieu
 
  {
    ?item wdt:P953 ?lien .        # URL, texte intégral disponible sur
    ?item wdt:P407 wd:Q150        # langue de l'œuvre : français
  }UNION{
    ?ed wdt:P629 ?item .          # édition du livre
    ?ed wdt:P953 ?lien .          # URL, texte intégral disponible sur 
    ?ed wdt:P407 wd:Q150          # langue de l'œuvre : français
  }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". }
} ORDER BY ?dateCreation

Try it!

Objets localisés à l’intersection de l’équateur et du premier méridien

#added before 2016-10

SELECT ?place ?placeLabel ?location
WHERE
{
  wd:Q24041662 wdt:P625 ?loc00 .
  SERVICE wikibase:around {
    ?place wdt:P625 ?location .
    bd:serviceParam wikibase:center ?loc00 .
    bd:serviceParam wikibase:radius "0.001" .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .  }
}
ORDER BY ?placeLabel

Try it!

Communes françaises dont le nom fini par ac

#added before 2016-10

#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE
{
	?item	wdt:P31/wdt:P279* wd:Q484170;
				wdt:P17 wd:Q142;
				rdfs:label ?itemLabel;
				wdt:P625 ?coord;
	FILTER (lang(?itemLabel) = "fr").
	FILTER regex (?itemLabel, "ac$").
	FILTER not exists { ?item wdt:P131 wd:Q33788 } # excluding Koumac, New Caledonia...
}

Try it!

Bâtiments situés dans plus d’un pays

#added before 2016-10
SELECT ?item ?itemLabel ?count
WHERE
{
  {
    SELECT ?item (COUNT(DISTINCT ?country) AS ?count) WHERE {
      ?item wdt:P31/wdt:P279* wd:Q41176 .
      ?item wdt:P17 ?country .
      FILTER NOT EXISTS { ?country wdt:P576 ?end }
    }
    GROUP BY ?item
  }
  FILTER ( ?count > 1 )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC(?count) ?itemL

Try it!

Rues nommées d’après une personne

SELECT ?street ?streetLabel ?cityLabel ?personLabel
WHERE
{
    ?street wdt:P31 wd:Q79007 .
    ?street wdt:P17 wd:Q142 .
    ?street wdt:P131 ?city .
    ?street wdt:P138 ?person .
    ?person wdt:P31 wd:Q5
    SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
}
ORDER BY ?city

Try it!

Rues de France sans ville

SELECT ?street ?streetLabel
WHERE
{
    ?street wdt:P31/wdt:P279* wd:Q79007 .
    ?street wdt:P17 wd:Q142 .
    MINUS { ?street wdt:P131 [] } .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
}
ORDER BY ?streetLabel

Try it!

Distributeurs bancaires automatiques autours de Munich du réseau « Bankcard-Servicenetz interbank » (requête fédérée)

#defaultView:Map{"hide":["?atm","?geometry"], "layer": "?bankLabel"}

PREFIX lgdo: <http://linkedgeodata.org/ontology/>
PREFIX geom: <http://geovocab.org/geometry#>
PREFIX bif: <bif:>

SELECT ?atm ?geometry ?bank ?bankLabel WHERE {
  hint:Query hint:optimizer "None".
  
  SERVICE <http://linkedgeodata.org/sparql> {
    { ?atm a lgdo:Bank; lgdo:atm true. }
    UNION { ?atm a lgdo:Atm. }
    
    ?atm geom:geometry [geo:asWKT ?geometry];
         lgdo:operator ?operator.
    FILTER(bif:st_intersects(?geometry, bif:st_point(11.5746898, 48.1479876), 5)) # 5 km around Munich
  }
  
  BIND(STRLANG(?operator, "de") as ?bankLabel) 
  ?bank rdfs:label ?bankLabel.
  
  # bank is part of the Bankcard service network, either via an explicit statement or implicitly due to its legal form (unless explicitly excluded)
  { ?bank wdt:P527 wd:Q806724. }
  UNION { ?bank wdt:P1454 wd:Q5349747. }
  MINUS { wd:Q806724 wdt:P3113 ?bank. }
}

Try it!

Élément situés autour des locaux de la fondation Wikimedia, triés par éloignement

SELECT ?place ?location ?distance ?placeLabel WHERE {
    SERVICE wikibase:around { 
      ?place wdt:P625 ?location . 
      bd:serviceParam wikibase:center "Point(-122.399523 37.786952)"^^geo:wktLiteral .
      bd:serviceParam wikibase:radius "1" . 
      bd:serviceParam wikibase:distance ?distance .
    } 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?distance LIMIT 100

Try it!

Démographie

Lieux de naissance des personnes prénommées « Antoine »

#added before 2016-10

# Coordinates of the birth places of people named Antoine
#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE
{
  ?item wdt:P31 wd:Q5 .   # human
  ?item wdt:P735 wd:Q15235674.
  ?item wdt:P19 ?place.
  ?place wdt:P625 ?coord.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}