query-cd16154d6e47d8239a61f8eb6191a835
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?item ?articlename ?itemLabel ?itemDescription ?sl ?dob
?dod ?dod_refs ?cod ?mod
WHERE
{
{
SELECT
?item ?dod_stm ?dod ?dod_refs ?cod (SAMPLE(?modLabel) AS ?mod)
WHERE
{
{
SELECT
?item ?dod_stm ?dod ?dod_refs (GROUP_CONCAT(?codLabel; SEPARATOR=", ") AS ?cod)
WHERE
{
INCLUDE %get_dod_refs
OPTIONAL
{
?item p:P509 ?cod_stm .
?cod_stm ps:P509 ?cod .
}
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "en" .
?cod rdfs:label ?codLabel .
}
}
GROUP BY ?item ?dod_stm ?dod ?dod_refs
} OPTIONAL
{
?item p:P1196 ?mod_stm .
?mod_stm ps:P1196 ?mod .
}
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "en" .
?mod rdfs:label ?modLabel .
}
}
GROUP BY ?item ?dod_stm ?dod ?dod_refs ?cod
} ?item wikibase:sitelinks ?sl .
?item ^schema:about ?article .
?article schema:isPartOf <https://en.wikipedia.org/> ;
schema:name ?articlename .
OPTIONAL { ?item wdt:P569 ?dob ;
p:P569 ?dob_stm .
?dob_stm ps:P569 ?dob .
?dob_stm a wikibase:BestRank
}
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "en" .
?item rdfs:label ?itemLabel .
?item schema:description ?itemDescription .
}
BIND(REPLACE(?itemLabel, "^.*(?<! [Vv][ao]n| [Dd][aeiu]| [Dd][e][lns]| [Ll][ae]) (?!([SJ]r\\.?|[XVI]+)$)", "") AS ?sortname)
} ORDER BY ASC(UCASE(?sortname)) ASC(UCASE(?itemLabel))