Class QuickStatementsExporter
- java.lang.Object
-
- org.openrefine.wikibase.exporters.QuickStatementsExporter
-
- All Implemented Interfaces:
Exporter,WriterExporter
public class QuickStatementsExporter extends Object implements WriterExporter
-
-
Field Summary
Fields Modifier and Type Field Description static StringimpossibleSchedulingErrorMessageprotected QSSnakPrintermainSnakPrinterstatic StringnoSchemaErrorMessageprotected QSSnakPrinterreferenceSnakPrinter
-
Constructor Summary
Constructors Constructor Description QuickStatementsExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexport(Grid grid, ProjectMetadata projectMetadata, long projectId, Properties options, Engine engine, Writer writer)StringgetContentType()protected voidtranslateItem(ItemEdit item, Writer writer)voidtranslateItemList(List<EntityEdit> updates, Writer writer)protected voidtranslateMediaInfo(MediaInfoEdit item, Writer writer)protected voidtranslateNameDescr(String qid, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> values, String prefix, org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, Writer writer)voidtranslateSchema(Grid grid, Engine engine, WikibaseSchema schema, Writer writer)Exports a project and a schema to a QuickStatements fileprotected voidtranslateSnakGroup(org.wikidata.wdtk.datamodel.interfaces.SnakGroup sg, boolean reference, Writer writer)protected voidtranslateStatement(String qid, org.wikidata.wdtk.datamodel.interfaces.Statement statement, String pid, boolean add, Writer writer)
-
-
-
Field Detail
-
impossibleSchedulingErrorMessage
public static final String impossibleSchedulingErrorMessage
- See Also:
- Constant Field Values
-
noSchemaErrorMessage
public static final String noSchemaErrorMessage
- See Also:
- Constant Field Values
-
mainSnakPrinter
protected final QSSnakPrinter mainSnakPrinter
-
referenceSnakPrinter
protected final QSSnakPrinter referenceSnakPrinter
-
-
Method Detail
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceExporter- Returns:
- MIME content type handled by exporter
-
export
public void export(Grid grid, ProjectMetadata projectMetadata, long projectId, Properties options, Engine engine, Writer writer) throws IOException
- Specified by:
exportin interfaceWriterExporter- Throws:
IOException
-
translateSchema
public void translateSchema(Grid grid, Engine engine, WikibaseSchema schema, Writer writer) throws IOException
Exports a project and a schema to a QuickStatements file- Parameters:
grid- the project to translateengine- the engine used for evaluation of the editsschema- the WikibaseSchema used for translation of tabular data to editswriter- the writer to which the QS should be written- Throws:
IOException
-
translateItemList
public void translateItemList(List<EntityEdit> updates, Writer writer) throws IOException
- Throws:
IOException
-
translateNameDescr
protected void translateNameDescr(String qid, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> values, String prefix, org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, Writer writer) throws IOException
- Throws:
IOException
-
translateItem
protected void translateItem(ItemEdit item, Writer writer) throws IOException
- Throws:
IOException
-
translateMediaInfo
protected void translateMediaInfo(MediaInfoEdit item, Writer writer) throws IOException
- Throws:
IOException
-
translateStatement
protected void translateStatement(String qid, org.wikidata.wdtk.datamodel.interfaces.Statement statement, String pid, boolean add, Writer writer) throws IOException
- Throws:
IOException
-
translateSnakGroup
protected void translateSnakGroup(org.wikidata.wdtk.datamodel.interfaces.SnakGroup sg, boolean reference, Writer writer) throws IOException- Throws:
IOException
-
-