Class NamespaceResolver

java.lang.Object
cz.cvut.kbss.jopa.utils.NamespaceResolver

public class NamespaceResolver extends Object
Holds mapping of prefixes to namespaces and allows resolution of prefixed IRIs.

Prefixes for RDF (rdf:), RDFS (rdfs:) and XSD (xsd:) are pre-registered.

  • Field Details

  • Constructor Details

    • NamespaceResolver

      public NamespaceResolver()
  • Method Details

    • registerNamespace

      public void registerNamespace(String prefix, String namespace)
      Registers the specified namespace with the specified prefix.
      Parameters:
      prefix - Prefix representing the namespace
      namespace - Namespace to represent
    • resolveFullIri

      public String resolveFullIri(String iri)
      Replaces prefix in the specified IRI with a full namespace IRI, if the IRI contains a prefix and it is registered in this resolver.
      Parameters:
      iri - The IRI to resolve
      Returns:
      Full IRI, if this resolver was able to resolve it, or the original IRI