EChO IMAGES:SPARQL/examples: Difference between revisions
Espartatuga (talk | contribs) No edit summary |
Espartatuga (talk | contribs) No edit summary |
||
| Line 49: | Line 49: | ||
OPTIONAL { ?item wdt:P170 ?creator . } | OPTIONAL { ?item wdt:P170 ?creator . } | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | |||
} | |||
==Women in photography== | |||
SELECT DISTINCT ?image ?item ?itemLabel ?birth ?country ?countryLabel WHERE { | |||
?item wdt:P106 wd:Q33231 . | |||
?item wdt:P27 ?country . | |||
?item wdt:P18 ?image . | |||
# ?item wdt:P625 ?location . | |||
# ?item wdt:P571 ?inception . | |||
# ?item wdt:P2079 ?method . | |||
?item wdt:P569 ?birth; | |||
wdt:P21 wd:Q6581072; | |||
FILTER (?birth > "1790-01-01"^^xsd:dateTime && ?birth < "2026-01-01"^^xsd:dateTime) | |||
# OPTIONAL { ?item wdt:P170 ?creator . } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | ||
} | } | ||
Revision as of 15:41, 6 June 2026
Queries
Inventors
<sparql tryit="1"> PREFIX wdt: <https://wikibase.echoimages.labs.wikimedia.pt/prop/direct/> PREFIX wd: <https://wikibase.echoimages.labs.wikimedia.pt/entity/>
SELECT ?item ?itemLabel ?inventor ?inventorLabel WHERE {
?item wdt:P3 wd:Q66 .
OPTIONAL { ?item wdt:P79 ?inventor . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
</sparql>
wikidata
SELECT ?item ?itemLabel ?inventor ?inventorLabel WHERE {
?item wdt:P31 wd:Q172839 .
OPTIONAL { ?item wdt:P61 ?inventor . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
image location
<sparql tryit="1"> PREFIX wdt: <https://wikibase.echoimages.labs.wikimedia.pt/prop/direct/> PREFIX wd: <https://wikibase.echoimages.labs.wikimedia.pt/entity/>
SELECT ?image ?item ?itemLabel ?creator ?creatorLabel ?method ?methodLabel ?inception ?location WHERE {
?item wdt:P3 wd:Q56 .
?item wdt:P6 ?image .
?item wdt:P10 ?location .
?item wdt:P13 ?inception .
?item wdt:P28 ?method .
OPTIONAL { ?item wdt:P16 ?creator . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
</sparql>
wikidata
SELECT DISTINCT ?image ?item ?itemLabel ?creator ?creatorLabel ?method ?methodLabel ?inception ?location WHERE {
?item wdt:P31/wdt:P279* wd:Q125191 . ?item wdt:P18 ?image . ?item wdt:P625 ?location . ?item wdt:P571 ?inception . ?item wdt:P2079 ?method .
OPTIONAL { ?item wdt:P170 ?creator . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Women in photography
SELECT DISTINCT ?image ?item ?itemLabel ?birth ?country ?countryLabel WHERE {
?item wdt:P106 wd:Q33231 . ?item wdt:P27 ?country . ?item wdt:P18 ?image .
- ?item wdt:P625 ?location .
- ?item wdt:P571 ?inception .
- ?item wdt:P2079 ?method .
?item wdt:P569 ?birth;
wdt:P21 wd:Q6581072;
FILTER (?birth > "1790-01-01"^^xsd:dateTime && ?birth < "2026-01-01"^^xsd:dateTime)
- OPTIONAL { ?item wdt:P170 ?creator . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}