query-f911fb5adba9ab95424773eafb334628

rq turtle/ttl

Looking for a tool for altering descriptions in multiple languages 22:08, 29 July 2022 (UTC)) talk (Jarekt. Is there some tool which would make that task easier than editing 50 descriptions one by one? (P217)inventory number ) of the title is impossible without first altering descriptions of other items, often requiring changes in multiple languages one does not speak. The cleanest solution is to add something unique and language independent to all the descriptions like the year of creation or this, and any attempt to add a new translation (like (Q148475)Jean-Baptiste Camille Corot are all paintings with the same title by (Q17331798)Landscape and (Q18178206)Landscape. , (Q20792242)Landscape Artworks often get standard labels and descriptions. The title of the artwork usually is used as label and standard description like "painting by ..." is used as description. The problem is that Wikidata will block adding titles to items if the same title/description is used on other item. I run often into this issue when the same author creates multiple paintings or sculptures with the same title. In such cases a bot adds standard description in 50 languages which blocks any attempts of adding titles in those languages. For example 00:21, 30 July 2022 (UTC)) talk (Tagishsimon - put the third column into an editor, search & replace QQQ with a tab, bung it in quickstatements & you're good. --https://w.wiki/5WtnAbsent a tool, I'd be inclined to knit a SPARQL query which'll emit Quickstatements. In this example - 03:03, 30 July 2022 (UTC)) talk (Jarekt, That is an excellent idea. I modified your query a bit so that I can pick either description alteration by year or by inventory number and can cut an paste directly from the query output. Thanks. --Tagishsimon

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?QID ?Dlang ?desc2
WHERE 
{
  VALUES ?item { wd:Q17331798 }
  ?item schema:description ?description .
  ?item wdt:P217 ?inv .
  ?item wdt:P571 ?date . 
  bind(str(YEAR(?date)) as ?year) 

  BIND(LANG(?description) as ?lang)
  bind(strafter(str(?item),"http://www.wikidata.org/entity/")as ?QID)
  bind(concat("D",?lang) as ?Dlang)
  bind(concat('"',?description," (",?inv,')"') as ?desc1)
  bind(concat('"',?description,", ",?year,'"') as ?desc2)
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?Dlang"):::projected v7("?QID"):::projected v4("?date") v9("?desc1") v10("?desc2"):::projected v2("?description") v3("?inv") v1("?item") v6("?lang") v5("?year") bind0[/VALUES ?item/] bind0-->v1 bind00(["wd:Q17331798"]) bind00 --> bind0 v1 --"schema:description"--> v2 v1 --"wdt:P217"--> v3 v1 --"wdt:P571"--> v4 bind1[/"str(year-from-dateTime(?date))"/] v4 --o bind1 bind1 --as--o v5 bind2[/"?description"/] v2 --o bind2 bind2 --as--o v6 bind3[/"substring-after(str(?item),'http://www.wikidata.org/entity/')"/] v1 --o bind3 bind3 --as--o v7 bind4[/"concat('D',?lang)"/] v6 --o bind4 bind4 --as--o v8 bind5[/"concat('"',?description,' (',?inv,')"')"/] v2 --o bind5 v3 --o bind5 bind5 --as--o v9 bind6[/"concat('"',?description,', ',?year,'"')"/] v2 --o bind6 v5 --o bind6 bind6 --as--o v10