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 String
impossibleSchedulingErrorMessage
protected QSSnakPrinter
mainSnakPrinter
static String
noSchemaErrorMessage
protected QSSnakPrinter
referenceSnakPrinter
-
Constructor Summary
Constructors Constructor Description QuickStatementsExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
export(Grid grid, ProjectMetadata projectMetadata, long projectId, Properties options, Engine engine, Writer writer)
String
getContentType()
protected void
translateItem(ItemEdit item, Writer writer)
void
translateItemList(List<EntityEdit> updates, Writer writer)
protected void
translateMediaInfo(MediaInfoEdit item, Writer writer)
protected void
translateNameDescr(String qid, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> values, String prefix, org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, Writer writer)
void
translateSchema(Grid grid, Engine engine, WikibaseSchema schema, Writer writer)
Exports a project and a schema to a QuickStatements fileprotected void
translateSnakGroup(org.wikidata.wdtk.datamodel.interfaces.SnakGroup sg, boolean reference, Writer writer)
protected void
translateStatement(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:
getContentType
in 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:
export
in 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
-
-