User:Realworldobject/GraphDBExamples
Jump to navigation
Jump to search
Bryan's example
[edit]The following query uses these:
- Items: book (Q571)
- Properties: coordinate location (P625) , place of birth (P19) , instance of (P31) , subclass of (P279) , author (P50) , image (P18)
Features: map (Q24515275)
#defaultView:Map{"layer":"?instance_ofLabel"}
SELECT ?book ?bookLabel ?person ?personLabel ?birthplace ?birthplaceLabel ?image ?coordinate_location
WHERE {
SERVICE wikibase:around {
?birthplace wdt:P625 ?coordinate_location.
bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
bd:serviceParam wikibase:radius "150".
bd:serviceParam wikibase:distance ?dist.
}
?person wdt:P19 ?birthplace .
?book wdt:P31/wdt:P279* wd:Q571;
wdt:P50 ?person .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
OPTIONAL { ?book wdt:P18 ?image. }
}
Number of Women Composers
[edit]The following query uses these:
- Items: female (Q6581072) , composer (Q36834)
- Properties: sex or gender (P21) , occupation (P106) , subclass of (P279)
SELECT (COUNT(DISTINCT ?item) AS ?count) WHERE { ?item wdt:P21 wd:Q6581072; wdt:P106/wdt:P279* wd:Q36834. }
Birthplaces of women composers born before 1800
[edit]The following query uses these:
- Items: female (Q6581072) , composer (Q36834)
- Properties: sex or gender (P21) , occupation (P106) , subclass of (P279) , place of birth (P19) , date of birth (P569) , image (P18) , coordinate location (P625)
Features: map (Q24515275)
#defaultView:Map
SELECT ?item ?itemLabel ?image ?placeOfBirth ?placeOfBirthLabel ?coordinates
WHERE {
?item wdt:P21 wd:Q6581072;
wdt:P106/wdt:P279* wd:Q36834;
wdt:P19 ?placeOfBirth;
wdt:P569 ?birthdate .
OPTIONAL {?item wdt:P18 ?image}
?placeOfBirth wdt:P625 ?coordinates .
FILTER(YEAR(?birthdate) < 1800)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Images of women composers born between 1000 and 1700
[edit]Note incorrect birthdate for زویا زاکاریان
The following query uses these:
- Items: female (Q6581072) , composer (Q36834)
- Properties: sex or gender (P21) , occupation (P106) , subclass of (P279) , date of birth (P569) , image (P18)
#defaultView:Timeline SELECT DISTINCT ?item ?itemLabel ?image ?birthdate WHERE { ?item wdt:P21 wd:Q6581072; wdt:P106/wdt:P279* wd:Q36834; wdt:P569 ?birthdate . ?item wdt:P18 ?image. FILTER(YEAR(?birthdate) > 1000 && YEAR(?birthdate) < 1700) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }