query-f7ae5b1ee25a002e062adbffd826b5ce

rq turtle/ttl

Frettiebot 1) logs • contribs • talk (Frettie Operator: })xtools • User rights • User rights log • Block log • SUL • new lexemes • new items • contribs • talk (Frettiebot. (P570)date of death and (P569)date of birth To merge identical-value statements in Task/s: Code: ]reply[09:39, 8 August 2021 (UTC)) talk (Vojtěch Dostál. --[3] [2] [1]:. Please comment on possible mistakes in our thinking. See examples of bot edits: Epìdosis and supported there by @Proposed on Project chat:. We'd like to merge date-of-birth and date-of-death statements with year precision, same value, no qualifiers attached, same calendar, not deprecated. A query is attached below. Frettie This is a collaboration between me and @Function details: Items with two "identical" date of birth statementsHello, we have quite a few items with several date of birth/date of death statements, with year precision, same calendar, without qualifiers, yet pointing to the same year. The underlying cause is that +1942-00-00T00:00:00Z","precision":9" and "+1942-01-01T00:00:00Z","precision":9" are understood as different dates. I've tried to design a query for some of these:

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
select distinct ?item where {
  ?item p:P569 ?s1, ?s2 filter(?s1 != ?s2) .
  ?s1 ps:P569 ?v1 ; wikibase:rank ?rank1 ; psv:P569/wikibase:timePrecision ?prec1 ; psv:P569/wikibase:timeCalendarModel ?cal1 filter (?rank1 != wikibase:DeprecatedRank && ?prec1 = "9"^^xsd:integer ). 
  ?s2 ps:P569 ?v2 ; wikibase:rank ?rank2 ; psv:P569/wikibase:timePrecision ?prec2 ; psv:P569/wikibase:timeCalendarModel ?cal2 filter ( ?cal1 = ?cal2 && year(?v1) = year(?v2) && ?rank2 != wikibase:DeprecatedRank && ?prec2 = "9"^^xsd:integer ) . 
  minus {
    ?s1 ?pq1 [] .
    ?qualifier1 wikibase:qualifier ?pq1.
  }
  minus {
    ?s2 ?pq2 [] .
    ?qualifier2 wikibase:qualifier ?pq2.
  }
} limit 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?cal1") v2("?cal2") v11("?item"):::projected v12("?pq1") v14("?pq2") v8("?prec1") v6("?prec2") v13("?qualifier1") v15("?qualifier2") v7("?rank1") v5("?rank2") v9("?s1") v10("?s2") v3("?v1") v4("?v2") a5((" ")) a6((" ")) a1((" ")) a2((" ")) a3((" ")) a4((" ")) f0[["?cal1 = ?cal2year-from-dateTime(?v1) = year-from-dateTime(?v2)?rank2 != 'wikibase:DeprecatedRank'?prec2 = '9^^xsd:integer'"]] f0 --> v1 f0 --> v2 f0 --> v3 f0 --> v4 f0 --> v5 f0 --> v6 f1[["?rank1 != 'wikibase:DeprecatedRank'?prec1 = '9^^xsd:integer'"]] f1 --> v7 f1 --> v8 f2[["?s1 != ?s2"]] f2 --> v9 f2 --> v10 v11 --"p:P569"--> v9 v11 --"p:P569"--> v10 v9 --"p:statement/P569"--> v3 v9 --"wikibase:rank"--> v7 v9 --"p:statement/value/P569"--> a1 a1 --"wikibase:timePrecision"--> v8 v9 --"p:statement/value/P569"--> a2 a2 --"wikibase:timeCalendarModel"--> v1 v10 --"p:statement/P569"--> v4 v10 --"wikibase:rank"--> v5 v10 --"p:statement/value/P569"--> a3 a3 --"wikibase:timePrecision"--> v6 v10 --"p:statement/value/P569"--> a4 a4 --"wikibase:timeCalendarModel"--> v2 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v9 -->v12--> a5 v13 --"wikibase:qualifier"--> v12 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v10 -->v14--> a6 v15 --"wikibase:qualifier"--> v14 end