openrefine-wikibase
openrefine-wikibase copied to clipboard
Feature request: filter a given claim by language
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.
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
+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.