Package org.openrefine.wikidata.schema
Class ExpressionContext
java.lang.Object
org.openrefine.wikidata.schema.ExpressionContext
A class holding all the necessary information about the context in which a
schema expression is evaluated.
- Author:
- Antonin Delpeuch
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionContext(String baseIRI, Map<String, String> entityTypeBaseIRIs, String mediaWikiApiEndpoint, int rowId, Row row, ColumnModel columnModel, QAWarningStore warningStore) Builds an expression context to evaluate a schema on a row -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWarning(QAWarning warning) getBaseIRIForEntityType(String entityType) getCellByName(String name) Retrieves a cell in the current row, by column name.intgetRowId()
-
Constructor Details
-
ExpressionContext
public ExpressionContext(String baseIRI, Map<String, String> entityTypeBaseIRIs, String mediaWikiApiEndpoint, int rowId, Row row, ColumnModel columnModel, QAWarningStore warningStore) Builds an expression context to evaluate a schema on a row- Parameters:
baseIRI- the siteIRI of the schemaentityTypeBaseIRIS- the siteIRI for specific entity types, falling back on the baseIRI otherwisemediaWikiApiEndpoint- the MediaWiki API endpoint of the WikibaserowId- the id of the row currently visitedrow- the row itselfcolumnModel- lets us access cells by column namewarningStore- where to store the issues encountered when evaluating (can be set to null if these issues should be ignored)
-
-
Method Details
-
getBaseIRI
-
getBaseIRIForEntityType
-
getMediaWikiApiEndpoint
-
getCellByName
Retrieves a cell in the current row, by column name. If the column does not exist, null is returned.- Parameters:
name- the name of the column to retrieve the cell from- Returns:
- the cell
-
getRowId
public int getRowId() -
addWarning
-