query-9efaf9218a3eda5da2139a0f671fb72f

rq turtle/ttl

Biographies by death date with article on cawiki SELECT ?item ?articlename ?itemLabel ?itemDescription ?sl ?article WHERE {

VALUES ?dod {"+2022-11-20"^^xsd:dateTime}

?item p:P570 ?statement.
?statement a wikibase:BestRank .
?statement psv:P570 ?statement2 . 
?statement2 wikibase:timeValue ?dod . hint:Prior hint:rangeSafe true.
?statement2 wikibase:timePrecision "11"^^xsd:integer .
?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

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Biographies by death date with article on cawiki
SELECT ?item ?articlename ?itemLabel ?itemDescription ?sl ?article 
WHERE {
#   VALUES ?dod {"+2022-11-20"^^xsd:dateTime}
    ?item p:P570 ?statement.
    ?statement a wikibase:BestRank .
    ?statement psv:P570 ?statement2 . 
    ?statement2 wikibase:timeValue ?dod . 
    ?statement2 wikibase:timePrecision "11"^^xsd:integer .
    ?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; v8("?article"):::projected v9("?articlename"):::projected v3("?dod") v4("?item"):::projected v10("?itemDescription"):::projected v2("?itemLabel"):::projected v7("?sl"):::projected v11("?sortname") v5("?statement") v6("?statement2") c9(["11^^xsd:integer"]):::literal c5(["wikibase:BestRank"]):::iri c13([https://ca.wikipedia.org/]):::iri c16(["bd:serviceParam"]):::iri c18(["ca"]):::literal f0[["'2022-11-01^^xsd:date' <= ?dod?dod < s2022-11-12^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f0 --> v3 v4 --"p:P570"--> v5 v5 --"a"--> c5 v5 --"p:statement/value/P570"--> v6 v6 --"wikibase:timeValue"--> v3 v6 --"wikibase:timePrecision"--> c9 v4 --"wikibase:sitelinks"--> v7 v8 --"schema:about"--> v4 v8 --"schema:isPartOf"--> c13 v8 --"schema:name"--> v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 v4 --"rdfs:label"--> v2 v4 --"schema:description"--> v10 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 v11