query-6a299c05c5c9c2a8c509b8af1188e3fb
Biographies by death date with article on cawiki SELECT ?item ?articlename ?itemLabel ?itemDescription ?sl ?ca WHERE {
VALUES ?dod {"+2022-11-20"^^xsd:dateTime}
?item wdt:P570 ?dod . hint:Prior hint:rangeSafe true.
?item wikibase:sitelinks ?sl .
?item ^schema:about ?article .
?article schema:isPartOf <https://ca.wikipedia.org/>;
schema:name ?articlename .
FILTER("2022-11-01"^^xsd:dateTime <= ?dod &&
?dod < "2022-11-12"^^xsd:dateTime)
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "ca" .
?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))
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Biographies by death date with article on cawiki
SELECT ?item ?articlename ?itemLabel ?itemDescription ?sl ?ca
WHERE {
# VALUES ?dod {"+2022-11-20"^^xsd:dateTime}
?item wdt:P570 ?dod .
?item wikibase:sitelinks ?sl .
?item ^schema:about ?article .
?article schema:isPartOf <https://ca.wikipedia.org/>;
schema:name ?articlename .
FILTER("2022-11-01"^^xsd:date <= ?dod &&
?dod < "2022-11-12"^^xsd:dat)
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "ca" .
?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))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?article")
v7("?articlename"):::projected
v3("?dod")
v4("?item"):::projected
v8("?itemDescription"):::projected
v2("?itemLabel"):::projected
v5("?sl"):::projected
v9("?sortname")
c7([https://ca.wikipedia.org/]):::iri
c10(["bd:serviceParam"]):::iri
c12(["ca"]):::literal
f0[["'2022-11-01^^xsd:date' <= ?dod?dod < s2022-11-12^^<http://www.w3.org/2001/XMLSchema#dat>'"]]
f0 --> v3
v4 --"wdt:P570"--> v3
v4 --"wikibase:sitelinks"--> v5
v6 --"schema:about"--> v4
v6 --"schema:isPartOf"--> c7
v6 --"schema:name"--> v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v4 --"rdfs:label"--> v2
v4 --"schema:description"--> v8
end
bind1[/"replace(?itemLabel,'^.*(?<! #91;Vv#93;#91;ao#93;n| #91;Dd#93;#91;aeiu#93;| #91;Dd#93;#91;e#93;#91;lns#93;| #91;Ll#93;#91;ae#93;) (?!(#91;SJ#93;r\.?|#91;XVI#93;+)$)','')"/]
v2 --o bind1
bind1 --as--o v9