Package org.openrefine.wikidata.schema
Class WbLanguageConstant
java.lang.Object
org.openrefine.wikidata.schema.WbLanguageConstant
- All Implemented Interfaces:
WbExpression<String>
A constant that represents a Wikimedia language code.
- Author:
- Antonin Delpeuch
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate(ExpressionContext ctxt) Evaluates the value expression in a given context, returns a Wikibase value suitable to be the target of a claim.getLabel()getLang()inthashCode()static StringnormalizeLanguageCode(String lang) static StringnormalizeLanguageCode(String lang, String mediaWikiApiEndpoint) Checks that a language code is valid and returns its preferred version (converting deprecated language codes to their better values).
-
Field Details
-
_langId
-
_langLabel
-
-
Constructor Details
-
WbLanguageConstant
-
-
Method Details
-
normalizeLanguageCode
-
normalizeLanguageCode
Checks that a language code is valid and returns its preferred version (converting deprecated language codes to their better values).- Parameters:
lang- a Wikimedia language codemediaWikiApiEndpoint- the MediaWiki API endpoint of the Wikibase- Returns:
- the normalized code, or null if the code is invalid.
-
evaluate
Description copied from interface:WbExpressionEvaluates the value expression in a given context, returns a Wikibase value suitable to be the target of a claim.- Specified by:
evaluatein interfaceWbExpression<String>- Throws:
SkipSchemaExpressionException
-
getLang
- Returns:
- the language code for this language
-
getLabel
- Returns:
- the name of the language in itself
-
equals
-
hashCode
public int hashCode()
-