query-90c3846efee3fb5f814d45c53cc1628f
All Greek mythology related items and their links to MANTO, Mythoskop, MythsOnMaps
and ToposText as well as their article in the Realencyclopädie
SELECT DISTINCT ?item ?itemLabel ?REArticle ?MANTO ?Mythoskop ?MythsOnMaps ?ToposText WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?item (wdt:P31/wdt:P279*)?/wdt:P361 wd:Q34726 . OPTIONAL { ?item p:P1343 ?statement . ?statement ps:P1343 wd:Q1138524 . OPTIONAL { ?statement pq:P805 ?REitem . ?REArticle schema:about ?REitem ; schema:isPartOf https://de.wikisource.org/ .} OPTIONAL { ?statement pq:P958 ?REArticle . } #the RE article exists, but has yet to be made available } OPTIONAL { ?item2 wdt:P460 ?item ; p:P1343 ?statement . ?statement ps:P1343 wd:Q1138524 . OPTIONAL { ?statement pq:P805 ?REitem . ?REArticle schema:about ?REitem ; schema:isPartOf https://de.wikisource.org/ . } #the item isn't described, but another figure to whom it is said to be the same as is described OPTIONAL { ?statement pq:P958 ?REArticle . } #same as above, but has yet to be made available } OPTIONAL { ?item wdt:P9660 wd:Q1138524 . BIND("N/A" AS ?REArticle) } #if there is no RE article OPTIONAL { ?item wdt:P9736 ?manto . wd:P9736 wdt:P1630 ?fmtMANTO . BIND(IRI(REPLACE(?manto, CONCAT('(',?manto,')'), ?fmtMANTO)) AS ?MANTO) .} OPTIONAL { ?item wdt:P11946 ?mythoskop . wd:P11946 wdt:P1630 ?fmtMythoskop . BIND(IRI(REPLACE(?mythoskop, CONCAT('(',?mythoskop,')'), ?fmtMythoskop)) AS ?Mythoskop) .} OPTIONAL { ?item wdt:P12402 ?mythsonmaps . wd:P12402 wdt:P1630 ?fmtMythsOnMaps . BIND(IRI(REPLACE(?mythsonmaps, CONCAT('(',?mythsonmaps,')'), ?fmtMythsOnMaps)) AS ?MythsOnMaps) .} OPTIONAL { ?item wdt:P8069 ?topostext . wd:P8069 wdt:P1630 ?fmtToposText . BIND(IRI(REPLACE(?topostext, CONCAT('(',?topostext,')'), ?fmtToposText)) AS ?ToposText) .} }
ORDER BY STR(?itemLabel)
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 schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#All Greek mythology related items and their links to MANTO, Mythoskop, MythsOnMaps
#and ToposText as well as their article in the Realencyclopädie
SELECT DISTINCT ?item ?itemLabel ?REArticle ?MANTO ?Mythoskop ?MythsOnMaps ?ToposText WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?item (wdt:P31/wdt:P279*)?/wdt:P361 wd:Q34726 .
OPTIONAL { ?item p:P1343 ?statement .
?statement ps:P1343 wd:Q1138524 .
OPTIONAL { ?statement pq:P805 ?REitem .
?REArticle schema:about ?REitem ;
schema:isPartOf <https://de.wikisource.org/> .}
OPTIONAL { ?statement pq:P958 ?REArticle . } #the RE article exists, but has yet to be made available
}
OPTIONAL { ?item2 wdt:P460 ?item ;
p:P1343 ?statement .
?statement ps:P1343 wd:Q1138524 .
OPTIONAL { ?statement pq:P805 ?REitem .
?REArticle schema:about ?REitem ;
schema:isPartOf <https://de.wikisource.org/> . } #the item isn't described, but another figure to whom it is said to be the same as is described
OPTIONAL { ?statement pq:P958 ?REArticle . } #same as above, but has yet to be made available
}
OPTIONAL { ?item wdt:P9660 wd:Q1138524 .
BIND("N/A" AS ?REArticle) } #if there is no RE article
OPTIONAL { ?item wdt:P9736 ?manto .
wd:P9736 wdt:P1630 ?fmtMANTO .
BIND(IRI(REPLACE(?manto, CONCAT('(',?manto,')'), ?fmtMANTO)) AS ?MANTO) .}
OPTIONAL { ?item wdt:P11946 ?mythoskop .
wd:P11946 wdt:P1630 ?fmtMythoskop .
BIND(IRI(REPLACE(?mythoskop, CONCAT('(',?mythoskop,')'), ?fmtMythoskop)) AS ?Mythoskop) .}
OPTIONAL { ?item wdt:P12402 ?mythsonmaps .
wd:P12402 wdt:P1630 ?fmtMythsOnMaps .
BIND(IRI(REPLACE(?mythsonmaps, CONCAT('(',?mythsonmaps,')'), ?fmtMythsOnMaps)) AS ?MythsOnMaps) .}
OPTIONAL { ?item wdt:P8069 ?topostext .
wd:P8069 wdt:P1630 ?fmtToposText .
BIND(IRI(REPLACE(?topostext, CONCAT('(',?topostext,')'), ?fmtToposText)) AS ?ToposText) .}
}
ORDER BY STR(?itemLabel)