Package org.openrefine.wikidata.schema
Class WikibaseSchema
java.lang.Object
org.openrefine.wikidata.schema.WikibaseSchema
- All Implemented Interfaces:
OverlayModel
Main class representing a skeleton of Wikibase edits with OpenRefine columns
as variables.
- Author:
- Antonin Delpeuch
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<WbExpression<? extends EntityEdit>>protected Stringprotected String -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.WikibaseSchema(List<WbExpression<? extends EntityEdit>> exprs, List<WbItemEditExpr> legacyItemExprs, String siteIri, Map<String, String> entityTypeSiteIri, String mediaWikiApiEndpoint) Constructor for deserialization via Jackson -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanSame as above, ignoring any warnings.evaluate(Project project, Engine engine, QAWarningStore warningStore) Evaluates the schema on a project, returning a list of EntityUpdates generated by the schema.Evaluates all entity documents in a particular expression context.List<WbExpression<? extends EntityEdit>>static WikibaseSchemavoidonAfterSave(Project project) voidonBeforeSave(Project project) static WikibaseSchemareconstruct(String json)
-
Field Details
-
entityEditExprs
-
siteIri
-
entityTypeSiteIri
-
mediaWikiApiEndpoint
-
-
Constructor Details
-
WikibaseSchema
public WikibaseSchema()Constructor. -
WikibaseSchema
public WikibaseSchema(List<WbExpression<? extends EntityEdit>> exprs, List<WbItemEditExpr> legacyItemExprs, String siteIri, Map<String, String> entityTypeSiteIri, String mediaWikiApiEndpoint) Constructor for deserialization via Jackson
-
-
Method Details
-
getSiteIri
- Returns:
- the site IRI of the Wikibase instance referenced by this schema
-
getEntityTypeSiteIri
- Returns:
- the site IRI of the Wikibase instance referenced by this schema
-
getEntityDocumentExpressions
- Returns:
- the list of document expressions for this schema
-
getMediaWikiApiEndpoint
-
evaluateEntityDocuments
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
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 evaluatedengine- the engine, which gives access to the current facetswarningStore- a store in which issues will be emitted- Returns:
- entity updates are stored in their generating order (not merged yet).
-
evaluate
Same as above, ignoring any warnings. -
reconstruct
- Throws:
IOException
-
load
- Throws:
Exception
-
onBeforeSave
- Specified by:
onBeforeSavein interfaceOverlayModel
-
onAfterSave
- Specified by:
onAfterSavein interfaceOverlayModel
-
dispose
- Specified by:
disposein interfaceOverlayModel
-
equals
-