wikidata · 2019-11-12 · sparql #matemàtiques i polítiques amb imatges opcionals #nascudes...
TRANSCRIPT
![Page 1: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/1.jpg)
Introducció aIntroducció aSPARQL a partir deSPARQL a partir de
WikidataWikidata
Toni Hermoso Pulido@Toniher
Amical Wikimedia
https://w.wiki/Bw$
![Page 2: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/2.jpg)
SSPARQL PARQL PProtocolrotocol
AAndnd
RRDF DF QQuery uery LLanguageanguage
SPARQLSPARQL
![Page 3: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/3.jpg)
RResource esource DDescriptionescriptionFFrameworkramework
RDFRDF
![Page 4: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/4.jpg)
TriplesTriples
![Page 5: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/5.jpg)
Serialització RDFSerialització RDFElements de WikidataElements de Wikidata
Documentació aMediaWiki
JSON:
XML/RDF:
Turtle/RDF:
etc.
https://www.wikidata.org/wiki/Special:EntityData/Q1492.json
https://www.wikidata.org/wiki/Special:EntityData/Q1492.rdf
https://www.wikidata.org/wiki/Special:EntityData/Q1492.ttl
Accés de dades aWikidata
![Page 6: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/6.jpg)
SPARQLSPARQL
#GatsSELECT ?itemWHERE { ?item wdt:P31 wd:Q146 .}
123456
https://query.wikidata.org/
![Page 7: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/7.jpg)
SPARQLSPARQLhttps://query.wikidata.org/
wdt: Propertieswd: Entities
...others:
rdfsschema
PREFIXESPREFIXES
![Page 8: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/8.jpg)
SPARQLSPARQL
#GatsSELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q146 . ?item rdfs:label ?itemLabel .}
1234567
https://w.wiki/Buw
![Page 9: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/9.jpg)
SPARQLSPARQL
#GatsSELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q146 ; rdfs:label ?itemLabel .}
1234567
https://w.wiki/Buy
![Page 10: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/10.jpg)
SPARQLSPARQL
#GatsSELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q146 ; rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "ca").}
12345678
https://w.wiki/Buz
![Page 11: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/11.jpg)
SPARQLSPARQL
#GatsSELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q146 . SERVICE wikibase:label { bd:serviceParam wikibase:language "ca". }}
123456789
1011
https://w.wiki/Bu$
![Page 12: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/12.jpg)
SPARQLSPARQL
#GatsSELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q146 . SERVICE wikibase:label { bd:serviceParam wikibase:language "es,fr,ca". }}ORDER BY ?itemLabelLIMIT 10
123456789
101112
https://w.wiki/Bv2
![Page 13: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/13.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955; rdfs:label ?itemLabel . ?item wdt:P21 wd:Q6581072 .}
12345678
https://w.wiki/Bv5
![Page 14: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/14.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955; rdfs:label ?itemLabel . ?item wdt:P21 wd:Q6581072 . FILTER(LANG(?itemLabel) = "ca") . }
123456789
https://w.wiki/Bv6
![Page 15: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/15.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques SELECT ?item ?itemLabel ?itemDescription WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955; rdfs:label ?itemLabel ; schema:description ?itemDescription . ?item wdt:P21 wd:Q6581072 . FILTER(LANG(?itemLabel) = "ca") . FILTER(LANG(?itemDescription) = "ca") . }
123456789101112
https://w.wiki/Bv7
![Page 16: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/16.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955 . ?item wdt:P21 wd:Q6581072 . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
1011
https://w.wiki/Bv8
![Page 17: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/17.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques amb imatges SELECT DISTINCT ?item ?itemLabel ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955 . ?item wdt:P21 wd:Q6581072 . ?item wdt:P18 ?image . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
101112
https://w.wiki/Bv9
![Page 18: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/18.jpg)
SPARQLSPARQL#Matemàtiques i polítiques amb imatges opcionals SELECT DISTINCT ?item ?itemLabel ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955 . ?item wdt:P21 wd:Q6581072 . OPTIONAL { ?item wdt:P18 ?image . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
1011121314
https://w.wiki/BvC
![Page 19: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/19.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques només amb imatges SELECT DISTINCT ?item ?itemLabel ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955 . ?item wdt:P21 wd:Q6581072 . FILTER EXISTS { ?item wdt:P18 ?image . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
1011121314
https://w.wiki/BvD
![Page 20: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/20.jpg)
SPARQLSPARQL
#Matemàtiques i polítiques sense imatgesSELECT DISTINCT ?item ?itemLabel ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955 . ?item wdt:P21 wd:Q6581072 . FILTER NOT EXISTS { ?item wdt:P18 ?image . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
10111213
https://w.wiki/BvE
![Page 21: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/21.jpg)
SPARQLSPARQLhttps://w.wiki/BvH
#Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q170790, wd:Q82955 . ?item wdt:P21 wd:Q6581072 ; wdt:P569 ?born . FILTER (?born >= "1961-01-01T00:00:00Z"^^xsd:dateTime) . OPTIONAL { ?item wdt:P18 ?image . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
1234567891011121314151617
![Page 22: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/22.jpg)
SPARQLSPARQLhttps://w.wiki/BvJ
# Subclasses de matemàtic SELECT DISTINCT ?item ?itemLabel WHERE { ?item wdt:P279* wd:Q170790; SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
12345678
![Page 23: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/23.jpg)
SPARQLSPARQLhttps://w.wiki/BvL
#Matemàtiques (ampli) amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?born ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106/wdt:P279* wd:Q170790; wdt:P21 wd:Q6581072; wdt:P569 ?born. FILTER(?born >= "1961-01-01T00:00:00Z"^^xsd:dateTime) OPTIONAL { ?item wdt:P18 ?image. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
1011121314
![Page 24: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/24.jpg)
SPARQLSPARQLhttps://w.wiki/BvM
#Matemàtiques (ampli) amb imatges opcionals #nascudes després del 1961 i amb lloc de naixement conegut SELECT DISTINCT ?item ?born ?birthPlace ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106/wdt:P279* wd:Q170790; wdt:P21 wd:Q6581072; wdt:P569 ?born ; wdt:P19 ?birthPlace . FILTER(?born >= "1961-01-01T00:00:00Z"^^xsd:dateTime) OPTIONAL { ?item wdt:P18 ?image. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
101112131415
![Page 25: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/25.jpg)
SPARQLSPARQLhttps://w.wiki/BvN
#Matemàtiques (ampli) amb imatges opcionals #nascudes després del 1961 i amb lloc de naixement conegut SELECT DISTINCT ?item ?born ?birthPlace ?coordinate ?image WHERE { ?item wdt:P31 wd:Q5; wdt:P106/wdt:P279* wd:Q170790; wdt:P21 wd:Q6581072; wdt:P569 ?born ; wdt:P19 ?birthPlace . ?birthPlace wdt:P625 ?coordinate . FILTER(?born >= "1961-01-01T00:00:00Z"^^xsd:dateTime) OPTIONAL { ?item wdt:P18 ?image. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca". }}
123456789
10111213141516
![Page 26: Wikidata · 2019-11-12 · SPARQL #Matemàtiques i polítiques amb imatges opcionals #nascudes després del 1961 SELECT DISTINCT ?item ?itemLabel ?born ?image WHERE {?item wdt:P31](https://reader033.vdocuments.mx/reader033/viewer/2022052803/5f24571316fa1c7eee17f64b/html5/thumbnails/26.jpg)
Més informacióMés informació
Wikidata Query Service in BriefPresentacions de Wikidata i SPARQLExemples de consultes SPARQL