Class DefaultIRIHandler

java.lang.Object
org.iirds.dita.ot.plugin.contrib.DefaultIRIHandler
All Implemented Interfaces:
IRIHandler

public class DefaultIRIHandler extends Object implements IRIHandler
Default implementation of IRIHandler.
Author:
Martin Kreutzer, Empolis Information Management GmbH
  • Field Details

  • Constructor Details

    • DefaultIRIHandler

      public DefaultIRIHandler()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: IRIHandler
      The unique name of this IRI provider
      Specified by:
      getName in interface IRIHandler
      Returns:
      the name of this handler
    • encode

      protected String encode(String part)
    • getInfoObjectIRI

      public String getInfoObjectIRI(ToCNode node)
      The IRI of information objects follows the scheme "urn:ditaid:" ":" <id of topic or map>. When no id present, then an UUID URN is returned.
      Specified by:
      getInfoObjectIRI in interface IRIHandler
      Parameters:
      node - the node for which to generated
      Returns:
      the generated IRI as String or null
    • getMetadataIRI

      public String getMetadataIRI(ToCNode node, String classURI, String label, String context)
      Description copied from interface: IRIHandler
      Generate IRI for a a metadata string property. Implementation may use external services to lookup IRIs or use properties of the node
      Specified by:
      getMetadataIRI in interface IRIHandler
      Parameters:
      node - the node the metadata belongs to
      classURI - the URI of the RDF metadata class
      label - something like a label of metadata value
      context - an additional context, usually the property name at the node hinting the source of the metadata value
      Returns:
      the generated IRI as String
    • getDocumentOrTopicIRI

      public String getDocumentOrTopicIRI(ToCNode node)
      The IRI of topic and maps follows the scheme "urn:ditaid:" ":" <id of topic or map> ":" <hash of content preprocessed by DITA-OT>. When no id present, then an UUID URN is returned.
      Specified by:
      getDocumentOrTopicIRI in interface IRIHandler
      Parameters:
      node - the node for which to generated
      Returns:
      the generated IRI as String or null
      See Also:
    • getPackageIRI

      public String getPackageIRI(ToCNode root)
      The IRI of a package is freshly generated UUID.
      Specified by:
      getPackageIRI in interface IRIHandler
      Parameters:
      root - the node for which to generated (usually the root node)
      Returns:
      the generated IRI as String
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object