Class 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 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 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 Detail

      • 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 long getRowId()
      • addWarning

        public void addWarning​(QAWarning warning)