User:Realworldobject/Test1: Difference between revisions
Jump to navigation
Jump to search
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Content deleted Content added
Initial setup |
(No difference)
|
Revision as of 15:18, 10 March 2016
Apologies to User:Pyb for borrowing User:Pyb/Test4 as a template for my own tests. (Hopefully the hyperlink acts as fair and sufficient attribution under the Creative Commons license.)
Links :
- http://rdf.myexperiment.org/howtosparql
- http://www.snee.com/bobdc.blog/2013/09/making-charts-out-of-sparql-qu.html
- http://dev.data2000.no/sgvizler/
- Wikidata:SPARQL query service/queries
- https://query.wikidata.org/bigdata/namespace/wdq/sparql
- http://biohackathon.org/d3sparql/
- http://demo.seco.tkk.fi/visu/#/ (example)
- http://jsfiddle.net/N5jeb/1/
- http://jsfiddle.net/Q37U5/
- http://jsfiddle.net/valexiev/etzbh248/
- https://io.datascience-paris-saclay.fr/exampleInsertUpdate.php?dataset_id=41
Père-Lachaise Cemetery
On this day
People buried in Père-Lachaise (cemetery + columbarium) born or dead today
SELECT ?entity ?entityS ?image ?event (year(?date) as ?year) WHERE { # show label then wikidata id
{
?entityS wdt:P119 wd:Q311 . # cimetière du Père-Lachaise
} UNION { # OR (claim[119:311,119:3006253])
?entityS wdt:P119 wd:Q3006253 # columbarium du Père-Lachaise
} .
{
?entityS wdt:P569 ?date . # date de naissance
BIND ('naissance' AS ?event) .
} UNION { # OR
?entityS wdt:P570 ?date . # date de décès
BIND ('décès' AS ?event) .
} .
OPTIONAL { ?entityS wdt:P1442 ?image } .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr,en" . # show label in French or in English (if French is missing)
?entityS rdfs:label ?entity
}
FILTER (datatype(?date) = xsd:dateTime)
FILTER (month(?date) = month(now()))
FILTER (day(?date) = day(now()))
}
ORDER BY ?date # sort by date
LIMIT 100
by division number
List of people buried in Père-Lachaise (cemetery + columbarium) by division number
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>SELECT ?personne ?personneLabel ?numéro_de_division WHERE {
{
?personne wdt:P31 wd:Q5 .
?personne p:P119 ?déclaration . # déclaration du lieu d'enterrement
?déclaration v:P119 wd:Q311 . # -> Cimetière du Père-Lachaise
?déclaration pq:P965 ?numéro_de_division .
}UNION{
?personne wdt:P31 wd:Q5 .
?personne p:P119 ?déclaration . # déclaration du lieu d'enterrement
?déclaration v:P119 wd:Q3006253 . # -> Columbarium du Père-Lachaise
?déclaration pq:P965 ?numéro_de_division .
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr, en" .
}
} ORDER BY xsd:integer(?numéro_de_division)
Number of people buried in Père-Lachaise (cemetery + columbarium) by division number
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>SELECT ?division (count(*) as ?count) WHERE {
{
?human wdt:P31 wd:Q5 .
?human p:P119 ?burial_place_statement .
?burial_place_statement v:P119 wd:Q311 .
?burial_place_statement pq:P965 ?division .
}UNION{
?human wdt:P31 wd:Q5 .
?human p:P119 ?burial_place_statement .
?burial_place_statement v:P119 wd:Q3006253 .
?burial_place_statement pq:P965 ?division .
}
}
GROUP BY ?division
ORDER BY DESC(?count) ASC(xsd:integer(?division))
by year of death
Number of people buried in Père-Lachaise (cimcemetery + columbarium) by year of death
SELECT ?year (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P119 wd:Q311 . # buried at Père-lachaise cemetery
?a wdt:P570 ?date .
BIND(year(?date) AS ?year)
} GROUP BY ?year ORDER BY ?year
by gender
SELECT ?cid ?cause (count(*) as ?count)
WHERE {
?pid wdt:P119 wd:Q311 .
?pid wdt:P21 ?cid .
OPTIONAL {
?cid rdfs:label ?cause filter (lang(?cause) = "en") .
}
}
GROUP BY ?cid ?cause
ORDER BY DESC(?count) ASC(?cause)
by age (find centenarians)
SELECT ?human ?humanLabel ?naissance ?deces (?deces - ?naissance AS ?result) WHERE {
?human wdt:P119 wd:Q311 .
?human wdt:P569 ?birth .
?human wdt:P570 ?death .
BIND(year(?birth) AS ?naissance)
BIND(year(?death) AS ?deces)
SERVICE wikibase:label {bd:serviceParam wikibase:language "fr" .}
}
ORDER BY DESC(?result)
by death location
SELECT ?human ?humanLabel ?cityLabel ?countryLabel WHERE {
?human wdt:P119 wd:Q311 .
?human wdt:P20 ?city .
?city wdt:P17 ?country .
SERVICE wikibase:label {bd:serviceParam wikibase:language "fr" .}
}
ORDER BY ?countryLabel ?cityLabel
by occupation
SELECT ?human ?humanLabel ?occupationLabel WHERE {
?human wdt:P119 wd:Q311 .
?human wdt:P106 ?occupation .
SERVICE wikibase:label {bd:serviceParam wikibase:language "fr" .}
}
ORDER BY ?occupationLabel
by cemetery
SELECT ?id ?lieu (count(*) as ?nombre)
WHERE {
?pid wdt:P31 wd:Q5 .
?pid wdt:P119 ?id .
OPTIONAL {
?id rdfs:label ?lieu filter (lang(?lieu) = "fr") .
}
}
GROUP BY ?id ?lieu
ORDER BY DESC(?nombre) ASC(?lieu)
LIMIT 50
WikiCheese
Cheeses AOC by area
SELECT ?fromage ?fromageLabel ?aire WHERE {
?fromage wdt:P31 wd:Q10943 .
?fromage wdt:P1389 wd:Q1565828 .
?fromage wdt:P2046 ?aire .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr" .
}
} ORDER BY ?aire