openrefine-wikibase icon indicating copy to clipboard operation
openrefine-wikibase copied to clipboard

Feature request: filter a given claim by language

Open hughlilly opened this issue 3 years ago • 2 comments

This issue follows on from a comment I left on #72.

I would like to be able to filter a given claim by language in order to create a column that contains, for example, only English occurrences of some data point.

My example (detailed at the Open Data Stack Exchange) uses Leptospermum scoparium (Q1520028), which has 8 common name (P1843) entries in various languages, including three in English.

Apologies if my naïveté in this regard causes any problems, but discussion on Twitter suggested that it might help to alter the SPARQL query here to include a FILTER(LANG(?best_label) = "en") statement, where en is the sought-after language: https://github.com/wetneb/openrefine-wikibase/blob/2b066e173e9d8728dfda5b2b3902e68b89b90f3a/wdreconcile/propertypath.py#L285-L297

If I can help in any way I would be happy to. Thank you.

hughlilly avatar Sep 09 '21 06:09 hughlilly

So the tasks for this would be to:

  • decide on a syntax to specify such a filter in our current property paths. Perhaps something like P1843[en]?
  • implement it, with the appropriate unit tests

wetneb avatar Sep 09 '21 10:09 wetneb

+1'ing this use case / feature request. Today, I tried to use data extension to specifically retrieve Spanish-language monolingual taxon common name values of a set of taxon items on Wikidata; it would be great if this were possible.

trnstlntk avatar Jun 18 '22 15:06 trnstlntk