Class ExpressionContext

java.lang.Object
org.openrefine.wikidata.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 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 schema
      entityTypeBaseIRIS - the siteIRI for specific entity types, falling back on the baseIRI otherwise
      mediaWikiApiEndpoint - the MediaWiki API endpoint of the Wikibase
      rowId - the id of the row currently visited
      row - the row itself
      columnModel - lets us access cells by column name
      warningStore - where to store the issues encountered when evaluating (can be set to null if these issues should be ignored)
  • Method Details

    • getBaseIRI

      public String getBaseIRI()
    • getBaseIRIForEntityType

      public String getBaseIRIForEntityType(String entityType)
    • 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 int getRowId()
    • addWarning

      public void addWarning(QAWarning warning)