Class RDFImporterExporterService

java.lang.Object
net.ontopia.topicmaps.utils.rdf.RDFImporterExporterService
All Implemented Interfaces:
ImportExportServiceIF

public class RDFImporterExporterService extends Object implements ImportExportServiceIF
ImportExportServiceIF service providing RDF import and export functionality.
Since:
5.4.0
  • Constructor Details

    • RDFImporterExporterService

      public RDFImporterExporterService()
  • Method Details

    • canRead

      public boolean canRead(URL resource)
      Description copied from interface: ImportExportServiceIF
      PUBLIC: Indicates that the service can supply a TopicMapReaderIF implementation for the specified resource.
      Specified by:
      canRead in interface ImportExportServiceIF
      Parameters:
      resource - The resource a reader is needed for
      Returns:
      true if this service can provide the needed reader
    • canWrite

      public boolean canWrite(URL resource)
      Description copied from interface: ImportExportServiceIF
      PUBLIC: Indicates that the service can supply a TopicMapWriterIF implementation for the specified resource.
      Specified by:
      canWrite in interface ImportExportServiceIF
      Parameters:
      resource - The resource a writer is needed for
      Returns:
      true if this service can provide the needed writer
    • getWriter

      public TopicMapWriterIF getWriter(OutputStream stream) throws IOException
      Description copied from interface: ImportExportServiceIF
      PUBLIC: Create and return a TopicMapWriterIF for the specified stream. This method should be preceded with a call to #canWrite(java.lang.String) to check if this service can write to the resource which the stream is connected to.
      Specified by:
      getWriter in interface ImportExportServiceIF
      Parameters:
      stream - The stream to write to
      Returns:
      The TopicMapWriterIF created by this service
      Throws:
      IOException - if anything goes wrong during initialization of the writer regarding IO operations
    • getReader

      public TopicMapReaderIF getReader(URL resource)
      Description copied from interface: ImportExportServiceIF
      PUBLIC: Create and return a TopicMapReaderIF for the specified resource. This method should be preceded with a call to #canRead(java.lang.String) to check if this service can read the specified resource.
      Specified by:
      getReader in interface ImportExportServiceIF
      Parameters:
      resource - The resource to create a reader for
      Returns:
      The TopicMapReaderIF created by this service
    • createReference

      public AbstractURLTopicMapReference createReference(URL url, String refid, String title, LocatorIF base_address)
      Description copied from interface: ImportExportServiceIF
      PUBLIC: Creates an AbstractURLTopicMapReference for the specified url, using the appropriate reader and/or writer provided by this service. This method is used by the sources like URLTopicMapSource and ResourceTopicMapSource.
      Specified by:
      createReference in interface ImportExportServiceIF
      Parameters:
      url - The resource to create the reference for
      refid - The id to use for the reference
      title - The title to use for the reference
      base_address - The base address to use if supported
      Returns:
      the reference for the specified resource