User:Culex/SPARQL

From Wikidata
Jump to navigation Jump to search

To check :

Frise chronologique des maires de Perpignan[edit]

The following query uses these:

  • Properties: position held (P39)  View with Reasonator View with SQID, start time (P580)  View with Reasonator View with SQID, end time (P582)  View with Reasonator View with SQID
    #defaultView:Timeline
    select ?mayor ?mayorLabel ?start ?end where {
      ?mayor p:P39 ?position.
      ?position ps:P39 wd:Q62084660;
                pq:P580 ?start;
                pq:P582 ?end.
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en". }
    

Bibliothèques en France[edit]

The following query uses these:

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

#defaultView:Map
SELECT ?bibliothèque ?bibliothèqueLabel ?coord ?coordonnées WHERE {
  ?bibliothèque (wdt:P31/(wdt:P279*)) wd:Q7075.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  ?bibliothèque wdt:P17 wd:Q142.
  OPTIONAL { ?bibliothèque wdt:P625 ?coord. }
  OPTIONAL {
    ?bibliothèque p:P159 ?position_du_siège.
    ?position_du_siège wdt:P625 ?coordonnées.
  }
}

Hôpitaux du monde[edit]

The following query uses these:

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

#Map of hospitals
#added 2017-08
#defaultView:Map
SELECT * WHERE {
  ?item wdt:P31/wdt:P279* wd:Q16917;
        wdt:P625 ?geo .
}

Noms de Céret dans plusieurs écritures/langues (trié par occurrence)[edit]

(à trier sur wordclouds.com)

The following query uses these:

  • Items: Céret (Q6643)  View with Reasonator View with SQID
    #title: Noms de Céret dans plusieurs écritures/langues (trié par occurrence) / Names of Céret in multiple scripts/languages (order by weight)
    SELECT ?word (COUNT(?label) AS ?weight) WHERE {
      wd:Q6643 rdfs:label ?label .
      BIND ( STR(?label) AS ?word )
    }
    GROUP BY ?word
    ORDER BY DESC(?weight)
    

Lieux de tournages de films tournés dans le Pyrénées-Orientales[edit]

The following query uses these:

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

#title: Lieux de tournages de films tournés dans les Pyrénées-Orientales
#defaultView:Map
SELECT ?film ?filmLabel ?lieu ?lieuLabel ?coord WHERE {
  ?film wdt:P915 ?lieu .
  ?lieu wdt:P131* wd:Q12709 .
  ?lieu wdt:P625 ?coord .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Timeline of François Arago[edit]

The following query uses these:

  • Properties: date of death (P570)  View with Reasonator View with SQID, publication date (P577)  View with Reasonator View with SQID, notable work (P800)  View with Reasonator View with SQID, image (P18)  View with Reasonator View with SQID
    #title: Timeline of François Arago
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    
    #defaultView:Timeline
    SELECT DISTINCT ?timestamp ?entity ?relationLabel ?entityLabel (SAMPLE(?image) AS ?img) WHERE {
      BIND(wd:Q154353 AS ?person)
      {
        ?person ?property ?timestamp.
        ?entity wikibase:directClaim ?property.
        FILTER((DATATYPE(?timestamp)) = xsd:dateTime)
      }
      UNION
      {
        ?person ?entityToStatement ?statement.
        OPTIONAL {?person wdt:P570 ?dDate.}
        ?statement ?statementToQualifier ?timestamp.
        ?statement ?statementToValue ?entity.
        ?relation wikibase:statementProperty ?statementToValue.
        FILTER(REGEX(STR(?entityToStatement), "prop/P"))
        FILTER(REGEX(STR(?statementToQualifier), "prop/qualifier/P"))
        FILTER((DATATYPE(?timestamp)) = xsd:dateTime)
        BIND (IF(!BOUND(?dDate), now(), ?dDate) AS ?deathDate)
        FILTER(?timestamp <= ?deathDate)
      }
      UNION
      {
        BIND(wd:P50 AS ?relation)
        ?relation wikibase:directClaim ?property.
        ?entity ?property ?person.
        ?entity wdt:P577 ?timestamp.
        FILTER(NOT EXISTS { ?person wdt:P800 ?entity })
      }
      UNION
      {
        BIND(wd:P800 AS ?relation)
        ?relation wikibase:directClaim ?property.
        ?person ?property ?entity.
        ?entity wdt:P577 ?timestamp.
      }
      OPTIONAL { ?entity wdt:P18 ?image }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,de,fr" }
    }
    GROUP BY ?timestamp ?entity ?relationLabel ?entityLabel
    

Routes en France[edit]

The following query uses these:

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

#defaultView:Map
SELECT ?route ?routeLabel ?coord ?coordonnées WHERE {
  ?route(wdt:P31/(wdt:P279*)) wd:Q34442.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  ?route wdt:P17 wd:Q142.
  OPTIONAL { ?route wdt:P625 ?coord. }
  OPTIONAL {
    ?route p:P159 ?position_du_siège.
    ?position_du_siège wdt:P625 ?coordonnées.
  }
}

Personnes nées dans les P-O par occupation (bubbles)[edit]

The following query uses these:

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

#defaultView:BubbleChart
SELECT ?occupationLabel (COUNT(DISTINCT ?person) as ?personCount) 
WHERE {
   ?person wdt:P31 wd:Q5;
         wdt:P19 ?birthPlace;
         wdt:P106 ?occupation.
   ?birthPlace wdt:P131 wd:Q12709.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?occupationLabel ORDER BY DESC(?personCount)

Cartes des lieux de naissance de femmes dans les Pyrénées-Orientales (avec et sans photo)[edit]

The following query uses these:

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

#title: Cartes des lieux de naissance de femmes dans les Pyrénées-Orientales (avec et sans photo)
#defaultView:Map
SELECT ?personne ?personneLabel ?locLabel ?coord ?rgb WHERE {
  ?personne wdt:P31 wd:Q5 ;
     wdt:P21 wd:Q6581072 ;
     wdt:P19 ?loc .
  ?loc wdt:P131* wd:Q12709 ; wdt:P625 ?coord .
  OPTIONAL { ?personne wdt:P18 ?image }
  BIND(IF(BOUND(?image),"60BB00","666666") AS ?rgb).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Ponts MH en France[edit]

The following query uses these:

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

#defaultView:Map{"hide": ["?coords"]}
SELECT DISTINCT ?item ?itemLabel ?crosses ?crossesLabel ?coords ?image
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q12280 ;
        wdt:P1435/wdt:P279* wd:Q916475 .
  OPTIONAL { ?item wdt:P625 ?coords }
  OPTIONAL { ?item wdt:P18 ?image }
  OPTIONAL { ?item wdt:P177 ?crosses }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # le label viendra de préférence dans votre langue, et autrement en anglais
}

Voies de Canet-en-Roussillon géolocalisées dans Wikidata et dont la plaque de rue a été versée ou non sur WikiCommons[edit]

The following query uses these:

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

#defaultView:Map
SELECT ?voie ?voieLabel (SAMPLE(?coord) AS ?loc) (SAMPLE(?plaque) AS ?panneau) ?rgb {
  hint:Query hint:optimizer "None" .
  ?voie wdt:P131+ wd:Q380514 ; wdt:P625 ?coord ; wdt:P31/wdt:P279* wd:Q83620 .
  OPTIONAL { ?voie wdt:P1766 ?plaque }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
  BIND(IF(BOUND(?plaque), "00F", "F00") AS ?rgb) .
}
GROUP BY ?voie ?voieLabel ?rgb