Class WikibaseSchema

  • All Implemented Interfaces:
    OverlayModel

    public class WikibaseSchema
    extends Object
    implements OverlayModel
    Main class representing a skeleton of Wikibase edits with OpenRefine columns as variables.
    Author:
    Antonin Delpeuch
    • Field Detail

      • siteIri

        protected String siteIri
      • mediaWikiApiEndpoint

        protected String mediaWikiApiEndpoint
      • validated

        protected boolean validated
    • Constructor Detail

      • WikibaseSchema

        public WikibaseSchema()
        Constructor. TODO remove this, it does not create a valid schema.
    • Method Detail

      • validate

        public void validate​(ValidationState validationContext)
        Checks that this schema is complete.
        Parameters:
        validationContext -
      • getSiteIri

        public String getSiteIri()
        Returns:
        the site IRI of the Wikibase instance referenced by this schema
      • getEntityTypeSiteIri

        public Map<String,​String> getEntityTypeSiteIri()
        Returns:
        the site IRI of the Wikibase instance referenced by this schema
      • getEntityDocumentExpressions

        public List<WbExpression<? extends EntityEdit>> getEntityDocumentExpressions()
        Returns:
        the list of document expressions for this schema
      • getMediaWikiApiEndpoint

        public String getMediaWikiApiEndpoint()
      • evaluateEntityDocuments

        public List<EntityEdit> evaluateEntityDocuments​(ExpressionContext ctxt)
                                                 throws QAWarningException
        Evaluates all entity documents in a particular expression context. This specifies, among others, a row where the values of the variables will be read.
        Parameters:
        ctxt - the context in which the schema should be evaluated.
        Returns:
        Throws:
        QAWarningException
      • evaluate

        public List<EntityEdit> evaluate​(Grid grid,
                                         Engine engine,
                                         QAWarningStore warningStore)
        Evaluates the schema on a project, returning a list of EntityUpdates generated by the schema. Some warnings will be emitted in the warning store: those are only the ones that are generated at evaluation time (such as invalid formats for dates). Issues detected on candidate statements (such as constraint violations) are not included at this stage.
        Parameters:
        grid - the grid on which the schema should be evaluated
        engine - the engine, which gives access to the current facets
        warningStore - a store in which issues will be emitted
        Returns:
        entity updates are stored in their generating order (not merged yet).
      • evaluate

        public List<EntityEdit> evaluate​(ColumnModel columnModel,
                                         Iterable<IndexedRow> indexedRows,
                                         QAWarningStore warningStore)
        Evaluates the schema on a list of rows, returning a list of EntityUpdates generated by the schema.

        Some warnings will be emitted in the warning store: those are only the ones that are generated at evaluation time (such as invalid formats for dates). Issues detected on candidate statements (such as constraint violations) are not included at this stage.

        Parameters:
        columnModel - the column model of the grid on which the schema should be evaluated
        indexedRows - the rows to evaluate the schema on
        warningStore - a store in which issues will be emitted
        Returns:
        entity updates are stored in their generating order (not merged yet).