query-bfa8a0ed5e06fbf26ac2a4ec5e19480c

rq turtle/ttl

]reply[21:25, 5 June 2020 (UTC) dosisEpìci sono cose da sistemare. Domani ti spiego meglio. Buona notte, --]reply[08:47, 6 June 2020 (UTC) Jura (if no other reference is given). --- (P1317)floruit An intermediate solution could be to change the property of these statements to ) for all dates would be too much work. explanation hereI suppose re-reading the source to check "ns1:dateType" (see Given the time it's there, I'm glad about any approach that solves it. ]reply[21:46, 5 June 2020 (UTC) dosisEpì: Wow, so it's an ancient problem; I've noticed it only today, I think. How about removing them all, in your opinion? --Jura1@ ]reply[21:35, 5 June 2020 (UTC) Jura. --- Wikidata:Bot_requests#Cleanup_VIAF_datesThat would be great. It's the same as More complete list of cases (note: it comprehends not only references to VIAF URLs, so has certainly some false positives):

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?p ?db
WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:endpoint "www.wikidata.org" .
    bd:serviceParam wikibase:api "Generator" .
    bd:serviceParam mwapi:generator "exturlusage" .
    bd:serviceParam mwapi:geuprop "title" .
    bd:serviceParam mwapi:geunamespace "0" .
    bd:serviceParam mwapi:geuprotocol "https" .
    bd:serviceParam mwapi:geuquery "viaf.org/viaf/" .
    bd:serviceParam mwapi:geulimit "max" .
    ?p wikibase:apiOutputItem mwapi:title .
  }


  ?p p:P569 [psv:P569 ?dbv ; prov:wasDerivedFrom [pr:P854 ?site] ].
  FILTER CONTAINS(STR(?site),"viaf.org/viaf/")
  ?dbv wikibase:timeValue ?db; wikibase:timePrecision ?precision.
  BIND (YEAR(?db) AS ?year)
  FILTER(?precision = 9)
  FILTER IF(?year > 0,
            ?year - FLOOR(?year / 100) * 100 = 50, # year is AD
            ?year - FLOOR(?year / 100) * 100 = 51) # year is BC, 1 BC is encoded as "0", 2 BC as "-1" etc.
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?db"):::projected v5("?dbv") v4("?p"):::projected v2("?precision") v3("?site") v7("?year") a1((" ")) a2((" ")) c6(["viaf.org/viaf/"]):::literal c16(["title"]):::literal c8(["bd:serviceParam"]):::iri c20(["https"]):::literal c10(["www.wikidata.org"]):::literal c23(["max"]):::literal c18(["0"]):::literal c14(["exturlusage"]):::literal c25(["mwapi:title"]):::iri c12(["Generator"]):::literal f0[["if(?year > '0^^xsd:integer',?year - numeric-floor(?year / '100^^xsd:integer') * '100^^xsd:integer' = '50^^xsd:integer',?year - numeric-floor(?year / '100^^xsd:integer') * '100^^xsd:integer' = '51^^xsd:integer')"]] f0 --> v7 f1[["?precision = '9^^xsd:integer'"]] f1 --> v2 f2[["contains(str(?site),'viaf.org/viaf/')"]] f2 --> v3 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c8 --"mwapi:endpoint"--> c10 c8 --"mwapi:api"--> c12 c8 --"mwapi:generator"--> c14 c8 --"mwapi:geuprop"--> c16 c8 --"mwapi:geunamespace"--> c18 c8 --"mwapi:geuprotocol"--> c20 c8 --"mwapi:geuquery"--> c6 c8 --"mwapi:geulimit"--> c23 v4 --"mwapi:apiOutputItem"--> c25 end a1 --"p:statement/value/P569"--> v5 a2 --"p:reference/P854"--> v3 a1 --"prov:wasDerivedFrom"--> a2 v4 --"p:P569"--> a1 v5 --"mwapi:timeValue"--> v6 v5 --"mwapi:timePrecision"--> v2 bind3[/"year-from-dateTime(?db)"/] v6 --o bind3 bind3 --as--o v7