Package org.openrefine.wikibase.schema
Class ExpressionContext
- java.lang.Object
-
- org.openrefine.wikibase.schema.ExpressionContext
-
public class ExpressionContext extends Object
A class holding all the necessary information about the context in which a schema expression is evaluated.- Author:
- Antonin Delpeuch
-
-
Constructor Summary
Constructors Constructor Description ExpressionContext(String baseIRI, Map<String,String> entityTypeBaseIRIs, String mediaWikiApiEndpoint, long rowId, Row row, ColumnModel columnModel, QAWarningStore warningStore)Builds an expression context to evaluate a schema on a row
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWarning(QAWarning warning)StringgetBaseIRI()StringgetBaseIRIForEntityType(String entityType)CellgetCellByName(String name)Retrieves a cell in the current row, by column name.ColumnModelgetColumnModel()StringgetMediaWikiApiEndpoint()longgetRowId()
-
-
-
Constructor Detail
-
ExpressionContext
public ExpressionContext(String baseIRI, Map<String,String> entityTypeBaseIRIs, String mediaWikiApiEndpoint, long 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 Detail
-
getBaseIRI
public String getBaseIRI()
-
getMediaWikiApiEndpoint
public String getMediaWikiApiEndpoint()
-
getCellByName
public Cell getCellByName(String name)
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 long getRowId()
-
addWarning
public void addWarning(QAWarning warning)
-
getColumnModel
public ColumnModel getColumnModel()
-
-