Truthy statements about translations - ghrgriner/wikidata-lexdata GitHub Wiki
Summary
There is a theoretical problem with using truthy statements for translations. In brief, the problem is that any assigned rank presumably is meant to apply within the target language of the translation, but the software treats the rank as applicable to all translations. Fortunately, in practice this is not an issue, as PreferredRank is used only twice on all translation properties. However, it's something worth keeping an eye on as more data is added.
There is a similar theoretical problem with the 'false friend' property (P5976), but this currently has no records with PreferredRank assigned.
Details
We provide here a bit more details about 'truthy' statements for readers who are not familiar. All statements can be assigned a rank of
PreferredRank, NormalRank, or DeprecatedRank. Using the 'wdt:' prefix with the property selects only item(s) with preferred rank if it exists and otherwise items with NormalRank.
The Wikidata SPARQL tutorial uses the example of the U.S. capital. The current capital is Washington D.C. (and this has PreferredRank assigned), but previous capitals were Philadelphia and New York City. So the pattern wd:Q30 wdt:P30 ?o matches one item, and the pattern wd:Q30 p:P30 ?o matches three items. In the Mediawiki database, each of the three statements has qualifiers attached (such as 'start time' for all three and 'end time' for the statements about the two previous capitals).
Query
The below query returns the two senses that assign a translation PreferredRank.
select ?sense
where {
?sense a ontolex:LexicalSense ;
p:P5972 [ wikibase:rank wikibase:PreferredRank ] .
}