Class WikibaseSchema

java.lang.Object
org.openrefine.wikidata.schema.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 Details

  • Constructor Details

  • Method Details

    • 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(Project project, 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:
      project - the project 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(Project project, Engine engine)
      Same as above, ignoring any warnings.
    • reconstruct

      public static WikibaseSchema reconstruct(String json) throws IOException
      Throws:
      IOException
    • load

      public static WikibaseSchema load(Project project, String obj) throws Exception
      Throws:
      Exception
    • onBeforeSave

      public void onBeforeSave(Project project)
      Specified by:
      onBeforeSave in interface OverlayModel
    • onAfterSave

      public void onAfterSave(Project project)
      Specified by:
      onAfterSave in interface OverlayModel
    • dispose

      public void dispose(Project project)
      Specified by:
      dispose in interface OverlayModel
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object