query-f7ae5b1ee25a002e062adbffd826b5ce
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
- https://query.wikidata.org/sparql
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
- https://www.wikidata.org/wiki/Wikidata:Project_chat/Archive/2021/07
- https://www.wikidata.org/wiki/Wikidata:Requests_for_permissions/Bot/Frettiebot_1