public class PrefixDocumentFormatImpl extends OWLDocumentFormatImpl implements PrefixDocumentFormat
Constructor and Description |
---|
PrefixDocumentFormatImpl()
Default constructor.
|
PrefixDocumentFormatImpl(PrefixManager manager) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the map.
|
boolean |
containsPrefixMapping(String prefixName)
Determines if this manager knows about a given prefix name and it contains a (non-null)
mapping for the prefix.
|
void |
copyPrefixesFrom(Map<String,String> from)
Copies the prefix from another prefix manager into this one.
|
void |
copyPrefixesFrom(PrefixManager from)
Copies the prefix from another prefix manager into this one.
|
String |
getDefaultPrefix()
Gets the default prefix.
|
IRI |
getIRI(String prefixIRI)
Gets the URI for a given prefix IRI.
|
String |
getKey() |
String |
getPrefix(String prefixName)
Gets the prefix that is bound to a particular prefix name.
|
StringComparator |
getPrefixComparator() |
String |
getPrefixIRI(IRI iri)
Gets the prefix IRI given a IRI (URI).
|
String |
getPrefixIRIIgnoreQName(IRI iri)
Gets the prefix IRI given a IRI (URI).
|
Map<String,String> |
getPrefixName2PrefixMap()
Gets a map that maps prefix names to prefixes.
|
boolean |
isPrefixOWLDocumentFormat()
Determines if this format is an instance of a format that uses prefixes to shorted IRIs.
|
Stream<String> |
prefixNames()
Gets the prefix names that have a mapping in this prefix manager.
|
void |
setDefaultPrefix(String defaultPrefix)
Sets the default namespace.
|
void |
setPrefix(String prefixName,
String prefix)
Adds a prefix name to prefix mapping.
|
void |
setPrefixComparator(StringComparator comparator) |
void |
setPrefixManager(PrefixManager m) |
void |
unregisterNamespace(String namespace)
Removes a previously registered prefix namespace mapping.
|
equals, getOntologyLoaderMetaData, getParameter, hashCode, isAddMissingTypes, isTextual, setAddMissingTypes, setOntologyLoaderMetaData, setParameter, toString
asPrefixOWLDocumentFormat, computeIllegals, determineIllegalPunnings, getOntologyLoaderMetaData, getParameter, isAddMissingTypes, isMissingType, isTextual, setAddMissingTypes, setOntologyLoaderMetaData, setParameter, supportsRelativeIRIs
getPrefixNames
public PrefixDocumentFormatImpl()
public PrefixDocumentFormatImpl(PrefixManager manager)
manager
- prefix manager to usepublic void setPrefixManager(PrefixManager m)
setPrefixManager
in interface PrefixDocumentFormat
m
- prefix manager to usepublic void setPrefix(String prefixName, String prefix)
PrefixManager
setPrefix
in interface PrefixManager
prefixName
- name The prefix name (must end with a colon)prefix
- The prefix.public void clear()
PrefixManager
clear
in interface PrefixManager
public Stream<String> prefixNames()
PrefixManager
prefixNames
in interface PrefixManager
public boolean containsPrefixMapping(String prefixName)
PrefixManager
containsPrefixMapping
in interface PrefixManager
prefixName
- The prefix name to be tested for.true
if the manager knows about this prefix and there is a non-null mapping
for this prefix.@Nullable public String getDefaultPrefix()
PrefixManager
getDefaultPrefix
in interface PrefixManager
null
if there is no default prefix.public void setDefaultPrefix(@Nullable String defaultPrefix)
PrefixManager
setDefaultPrefix
in interface PrefixManager
defaultPrefix
- The namespace to be used as the default namespace. Note that the value
may be null
in order to clear the default namespace.public Map<String,String> getPrefixName2PrefixMap()
PrefixManager
getPrefixName2PrefixMap
in interface PrefixManager
@Nullable public String getPrefix(String prefixName)
PrefixManager
getDefaultPrefix()
method.getPrefix
in interface PrefixManager
prefixName
- The prefix name. A string that represents a prefix name of the prefix to be
retrieved. Note that specifying ":" is the same as asking for the default prefix (see
the getDefaultPrefix() method).null
if there is no prefix name bound to this prefix, or the
prefix name doesn't exist.public IRI getIRI(String prefixIRI)
PrefixManager
getIRI
in interface PrefixManager
prefixIRI
- The Prefix IRI@Nullable public String getPrefixIRI(IRI iri)
PrefixManager
getPrefixIRI
in interface PrefixManager
iri
- The IRI whose prefix it to be retrievednull
if a prefix IRI cannot be generated.public String getPrefixIRIIgnoreQName(IRI iri)
PrefixManager
getPrefixIRIIgnoreQName
in interface PrefixManager
iri
- The IRI whose prefix it to be retrievednull
if a prefix IRI cannot be generated.public void copyPrefixesFrom(PrefixManager from)
PrefixManager
copyPrefixesFrom
in interface PrefixManager
from
- The manager that the prefixes should be copied frompublic void copyPrefixesFrom(Map<String,String> from)
PrefixManager
copyPrefixesFrom
in interface PrefixManager
from
- The map containing the prefixespublic void unregisterNamespace(String namespace)
PrefixManager
unregisterNamespace
in interface PrefixManager
namespace
- The namespace to be removed.public StringComparator getPrefixComparator()
getPrefixComparator
in interface PrefixManager
public void setPrefixComparator(StringComparator comparator)
setPrefixComparator
in interface PrefixManager
comparator
- the comparator to usepublic String getKey()
getKey
in interface OWLDocumentFormat
public boolean isPrefixOWLDocumentFormat()
OWLDocumentFormat
isPrefixOWLDocumentFormat
in interface OWLDocumentFormat
true
if this format is an instance of
PrefixDocumentFormat
other wise false
.Copyright © 2020 The University of Manchester. All rights reserved.