query-f6b90fa52728fb037af657c85396081b
title: Work in progress: all New Zealand people and all New Zealand attributes
SELECT DISTINCT ?person #?personLabel ?personDescription ?personAltLabel (GROUP_CONCAT(DISTINCT ?dob; SEPARATOR = ";") AS ?DOBs) (GROUP_CONCAT(DISTINCT ?dod; SEPARATOR = ";") AS ?DODs) (GROUP_CONCAT(DISTINCT ?lccnurl; SEPARATOR = ";") AS ?LCCN_urls) (GROUP_CONCAT(DISTINCT ?viafurl; SEPARATOR = ";") AS ?VIAF_urls)
# ?komurl ?dnzburl ?shofurl ?fnzaurl ?hnzpurl ?maraurl ?anzlurl ?nlnzurl ?anziurl ?abidurl ?nzocurl ?nzpiurl ?papaurl WHERE {
?person wdt:P31 wd:Q5 . # person is a person { ?person wdt:P27 wd:Q664 . # citizen of New Zealand } UNION { ?person wdt:P551 wd:Q664 . # residence of New Zealand }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" }
OPTIONAL { ?person wdt:P569 ?dob . } .
OPTIONAL { ?person wdt:P570 ?dod . } .
OPTIONAL { ?person wdt:P244 ?lccn . BIND( IRI(CONCAT('https://lccn.loc.gov/', STR(?lccn))) AS ?lccnurl ) . } .
OPTIONAL { ?person wdt:P214 ?viaf . BIND( IRI(CONCAT('https://viaf.org/viaf/', STR(?viaf))) AS ?viafurl ) . } .
OPTIONAL { ?person wdt:P12702 ?komi . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?komi))) AS ?komurl ) . } .
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://teara.govt.nz/en/biographies/', STR(?dnzb))) AS ?dnzburl ) . } . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P4418 ?shof . BIND( IRI(CONCAT('https://www.nzhalloffame.co.nz/Inductees/', STR(?shof))) AS ?shofurl ) . } . # New Zealand Sports Hall of Fame ID
OPTIONAL { ?person wdt:P6792 ?fnza . BIND( IRI(CONCAT('https://findnzartists.org.nz/en/artist/', STR(?fnza))) AS ?fnzaurl ) .} . # Find NZ Artists ID
OPTIONAL { ?person wdt:P11004 ?hnzp . BIND( IRI(CONCAT('https://hockeynz.altiusrt.com/people/', STR(?hnzp))) AS ?hnzpurl ) .} . # Hockey New Zealand person ID
OPTIONAL { ?person wdt:P5640 ?mara . BIND( IRI(CONCAT('https://www.read-nz.org/writer/', STR(?mara))) AS ?maraurl ) .} . # Read NZ Te Pou Muramura writer ID
OPTIONAL { ?person wdt:P5635 ?anzl . BIND( IRI(CONCAT('https://www.anzliterature.com/member/', STR(?anzl))) AS ?anzlurl ) .} . # ANZL writer ID
OPTIONAL { ?person wdt:P7682 ?nlnz . BIND( IRI(CONCAT('https://natlib.govt.nz/records/', STR(?nlnz))) AS ?nlnzurl ) .} . # National Library of New Zealand ID
OPTIONAL { ?person wdt:P12985 ?anzi . BIND( IRI(CONCAT('https://www.anzrankings.org.nz/site/profiles_con/athlete/', STR(?anzi))) AS ?anziurl ) .} . # Athletics New Zealand athlete ID
OPTIONAL { ?person wdt:P3645 ?abid . BIND( IRI(CONCAT('http://stats.allblacks.com/asp/profile.asp?ABID=', STR(?abid))) AS ?abidurl ) .} . # All Blacks player ID
OPTIONAL { ?person wdt:P4056 ?nzoc . BIND( IRI(CONCAT('https://www.olympic.org.nz/athletes/', STR(?nzoc))) AS ?nzocurl ) .} . # New Zealand Olympic Committee athlete ID
OPTIONAL { ?person wdt:P10977 ?nzpi . BIND( IRI(CONCAT('https://paralympics.org.nz/paralympians-profiles/', STR(?nzpi))) AS ?nzpiurl ) .} . # Paralympics New Zealand athlete ID
OPTIONAL { ?person wdt:P3544 ?papa . BIND( IRI(CONCAT('https://collections.tepapa.govt.nz/agent/', STR(?papa))) AS ?papaurl ) .} . # Te Papa agent ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
} GROUP BY ?person # ?personLabel ?personDescription ?personAltLabel # ?komurl ?dnzburl ?shofurl ?fnzaurl ?hnzpurl ?maraurl ?anzlurl ?nlnzurl ?anziurl ?abidurl ?nzocurl ?nzpiurl ?papaurl LIMIT 1000
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Work in progress: all New Zealand people and all New Zealand attributes
#
SELECT DISTINCT
?person
#?personLabel ?personDescription ?personAltLabel
(GROUP_CONCAT(DISTINCT ?dob; SEPARATOR = ";") AS ?DOBs)
(GROUP_CONCAT(DISTINCT ?dod; SEPARATOR = ";") AS ?DODs)
(GROUP_CONCAT(DISTINCT ?lccnurl; SEPARATOR = ";") AS ?LCCN_urls)
(GROUP_CONCAT(DISTINCT ?viafurl; SEPARATOR = ";") AS ?VIAF_urls)
# ?komurl ?dnzburl ?shofurl ?fnzaurl ?hnzpurl ?maraurl ?anzlurl
?nlnzurl ?anziurl ?abidurl ?nzocurl ?nzpiurl ?papaurl
WHERE {
?person wdt:P31 wd:Q5 . # person is a person
{
?person wdt:P27 wd:Q664 . # citizen of New Zealand
} UNION {
?person wdt:P551 wd:Q664 . # residence of New Zealand
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" }
OPTIONAL { ?person wdt:P569 ?dob . } .
OPTIONAL { ?person wdt:P570 ?dod . } .
OPTIONAL { ?person wdt:P244 ?lccn . BIND( IRI(CONCAT('https://lccn.loc.gov/', STR(?lccn))) AS ?lccnurl ) . } .
OPTIONAL { ?person wdt:P214 ?viaf . BIND( IRI(CONCAT('https://viaf.org/viaf/', STR(?viaf))) AS ?viafurl ) . } .
OPTIONAL { ?person wdt:P12702 ?komi . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?komi))) AS ?komurl ) . } .
OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://teara.govt.nz/en/biographies/', STR(?dnzb))) AS ?dnzburl ) . } . # Dictionary of New Zealand Biography ID
OPTIONAL { ?person wdt:P4418 ?shof . BIND( IRI(CONCAT('https://www.nzhalloffame.co.nz/Inductees/', STR(?shof))) AS ?shofurl ) . } . # New Zealand Sports Hall of Fame ID
OPTIONAL { ?person wdt:P6792 ?fnza . BIND( IRI(CONCAT('https://findnzartists.org.nz/en/artist/', STR(?fnza))) AS ?fnzaurl ) .} . # Find NZ Artists ID
OPTIONAL { ?person wdt:P11004 ?hnzp . BIND( IRI(CONCAT('https://hockeynz.altiusrt.com/people/', STR(?hnzp))) AS ?hnzpurl ) .} . # Hockey New Zealand person ID
OPTIONAL { ?person wdt:P5640 ?mara . BIND( IRI(CONCAT('https://www.read-nz.org/writer/', STR(?mara))) AS ?maraurl ) .} . # Read NZ Te Pou Muramura writer ID
OPTIONAL { ?person wdt:P5635 ?anzl . BIND( IRI(CONCAT('https://www.anzliterature.com/member/', STR(?anzl))) AS ?anzlurl ) .} . # ANZL writer ID
OPTIONAL { ?person wdt:P7682 ?nlnz . BIND( IRI(CONCAT('https://natlib.govt.nz/records/', STR(?nlnz))) AS ?nlnzurl ) .} . # National Library of New Zealand ID
OPTIONAL { ?person wdt:P12985 ?anzi . BIND( IRI(CONCAT('https://www.anzrankings.org.nz/site/profiles_con/athlete/', STR(?anzi))) AS ?anziurl ) .} . # Athletics New Zealand athlete ID
OPTIONAL { ?person wdt:P3645 ?abid . BIND( IRI(CONCAT('http://stats.allblacks.com/asp/profile.asp?ABID=', STR(?abid))) AS ?abidurl ) .} . # All Blacks player ID
OPTIONAL { ?person wdt:P4056 ?nzoc . BIND( IRI(CONCAT('https://www.olympic.org.nz/athletes/', STR(?nzoc))) AS ?nzocurl ) .} . # New Zealand Olympic Committee athlete ID
OPTIONAL { ?person wdt:P10977 ?nzpi . BIND( IRI(CONCAT('https://paralympics.org.nz/paralympians-profiles/', STR(?nzpi))) AS ?nzpiurl ) .} . # Paralympics New Zealand athlete ID
OPTIONAL { ?person wdt:P3544 ?papa . BIND( IRI(CONCAT('https://collections.tepapa.govt.nz/agent/', STR(?papa))) AS ?papaurl ) .} . # Te Papa agent ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
# OPTIONAL { ?person wdt:P2745 ?dnzb . BIND( IRI(CONCAT('https://www.komako.org.nz/person/', STR(?dnzb))) AS ?dnzburl ) .} . # Dictionary of New Zealand Biography ID
}
GROUP BY ?person # ?personLabel ?personDescription ?personAltLabel
# ?komurl ?dnzburl ?shofurl ?fnzaurl ?hnzpurl ?maraurl ?anzlurl
?nlnzurl ?anziurl ?abidurl ?nzocurl ?nzpiurl ?papaurl
LIMIT 1000