Class RdfSerializer

java.lang.Object
org.wikidata.wdtk.rdf.RdfSerializer
All Implemented Interfaces:
EntityDocumentDumpProcessor, EntityDocumentProcessor

public class RdfSerializer extends Object implements EntityDocumentDumpProcessor
This class implements EntityDocumentDumpProcessor to provide a RDF serializer to render RDF graphs of EntityDocument objects.
Author:
Michael Günther
  • Field Details

  • Constructor Details

    • RdfSerializer

      public RdfSerializer(org.eclipse.rdf4j.rio.RDFFormat format, OutputStream output, Sites sites, PropertyRegister propertyRegister)
      Creates a new RDF serializer for the specified format and output stream.
      Parameters:
      format - RDF format, such as RDFFormat.TURTLE
      output - the output stream to write to
      sites - information about site links
  • Method Details

    • setTasks

      public void setTasks(int tasks)
      Sets the tasks that should be performed during export. The value should be a combination of flags such as TASK_STATEMENTS.
      Parameters:
      tasks - the tasks to be performed
    • getTasks

      public int getTasks()
      Returns the tasks that should be performed during export. The value should be a combination of flags such as TASK_STATEMENTS.
      Returns:
      tasks to be performed
    • getTripleCount

      public long getTripleCount()
      Returns the number of triples that have been written so far.
      Returns:
      number of triples
    • open

      public void open()
      Description copied from interface: EntityDocumentDumpProcessor
      Starts the processing by performing any initial steps to prepare processing.
      Specified by:
      open in interface EntityDocumentDumpProcessor
    • processItemDocument

      public void processItemDocument(ItemDocument itemDocument)
      Description copied from interface: EntityDocumentProcessor
      Processes the given ItemDocument.
      Specified by:
      processItemDocument in interface EntityDocumentProcessor
      Parameters:
      itemDocument - the ItemDocument
    • processPropertyDocument

      public void processPropertyDocument(PropertyDocument propertyDocument)
      Description copied from interface: EntityDocumentProcessor
      Processes the given PropertyDocument.
      Specified by:
      processPropertyDocument in interface EntityDocumentProcessor
      Parameters:
      propertyDocument - the PropertyDocument
    • close

      public void close()
      Description copied from interface: EntityDocumentDumpProcessor
      Finishes the processing by performing any final steps, such as closing resources.
      Specified by:
      close in interface EntityDocumentDumpProcessor