Package cz.cvut.kbss.jopa.utils
Class NamespaceResolver
java.lang.Object
cz.cvut.kbss.jopa.utils.NamespaceResolver
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
registerNamespace
(String prefix, String namespace) Registers the specified namespace with the specified prefix.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.
-
Field Details
-
URN_PREFIX
- See Also:
-
-
Constructor Details
-
NamespaceResolver
public NamespaceResolver()
-
-
Method Details
-
registerNamespace
Registers the specified namespace with the specified prefix.- Parameters:
prefix
- Prefix representing the namespacenamespace
- Namespace to represent
-
resolveFullIri
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
-