Package org.openrefine.wikibase.schema
Class WbNameDescExpr
- java.lang.Object
-
- org.openrefine.wikibase.schema.WbNameDescExpr
-
public class WbNameDescExpr extends Object
An expression that represent a term (label, description or alias). The structure is slightly different from other expressions because we need to call different methods onItemEditBuilder
.- Author:
- Antonin Delpeuch
-
-
Constructor Summary
Constructors Constructor Description WbNameDescExpr(org.openrefine.wikibase.schema.WbNameDescExpr.NameDescType type, WbMonolingualExpr value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contributeTo(ItemEditBuilder entity, ExpressionContext ctxt)
Evaluates the expression and adds the result to the entity update.void
contributeTo(MediaInfoEditBuilder entity, ExpressionContext ctxt)
Evaluates the expression and adds the result to the entity update.boolean
equals(Object other)
PathElement.Type
getPathElementType()
String
getStaticLanguage()
For error-reporting purposes, during schema validation.org.openrefine.wikibase.schema.WbNameDescExpr.NameDescType
getType()
WbMonolingualExpr
getValue()
int
hashCode()
void
validate(ValidationState validation)
Checks that the expression has all its required elements and can be evaluated.
-
-
-
Constructor Detail
-
WbNameDescExpr
public WbNameDescExpr(org.openrefine.wikibase.schema.WbNameDescExpr.NameDescType type, WbMonolingualExpr value)
-
-
Method Detail
-
validate
public void validate(ValidationState validation)
Checks that the expression has all its required elements and can be evaluated.
-
contributeTo
public void contributeTo(ItemEditBuilder entity, ExpressionContext ctxt) throws QAWarningException
Evaluates the expression and adds the result to the entity update.- Parameters:
entity
- the entity update where the term should be storedctxt
- the evaluation context for the expression- Throws:
QAWarningException
-
contributeTo
public void contributeTo(MediaInfoEditBuilder entity, ExpressionContext ctxt) throws QAWarningException
Evaluates the expression and adds the result to the entity update.- Parameters:
entity
- the entity update where the term should be storedctxt
- the evaluation context for the expression- Throws:
QAWarningException
-
getType
public org.openrefine.wikibase.schema.WbNameDescExpr.NameDescType getType()
-
getValue
public WbMonolingualExpr getValue()
-
getPathElementType
public PathElement.Type getPathElementType()
-
getStaticLanguage
public String getStaticLanguage()
For error-reporting purposes, during schema validation.- Returns:
- the constant language code for this term, if there is one, otherwise null
-
-