Class PrefixManager
java.lang.Object
org.incenp.obofoundry.sssom.PrefixManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new prefix.voidAdds new prefixes.expandIdentifier(String curie) Expands a shortened identifier into its long, canonical form.expandIdentifiers(List<String> curies) Expands all identifiers in the given list.expandIdentifiers(List<String> curies, boolean inPlace) Expands all identifiers in the given list.getLocalName(String iri) Gets the local part of the shortened form of given identifier.Gets the prefix associated with the given prefix name.Gets the underlying map of prefix names to URL prefixes.getPrefixName(String iri) Gets the name of the best (longest) prefix for a given identifier.Gets the prefix names that this resolver could not expand.Gets the IRIs that could not be shortened byshortenIdentifier(String)for lack of a suitable prefix declaration.shortenIdentifier(String iri) Shortens an identifier according to the prefix map.shortenIdentifiers(List<String> iris) Shortens all identifiers in the given list.shortenIdentifiers(List<String> iris, boolean inPlace) Shortens all identifiers in the given list.
-
Constructor Details
-
PrefixManager
public PrefixManager()Creates a new instance.
-
-
Method Details
-
add
-
add
-
getPrefixMap
-
getUnresolvedPrefixNames
-
getUnshortenedIRIs
Gets the IRIs that could not be shortened byshortenIdentifier(String)for lack of a suitable prefix declaration.- Returns:
- The set of all IRIs encountered in the lifetime of this object that could not be shortened.
-
getPrefix
-
getPrefixName
-
getLocalName
Gets the local part of the shortened form of given identifier.- Parameters:
iri- The identifier for which to get the local part.- Returns:
- The local name of the identifier, that is, everything after the
longest matching prefix; or
nullif the original identifier could not be shortened.
-
shortenIdentifier
-
shortenIdentifiers
-
shortenIdentifiers
Shortens all identifiers in the given list.- Parameters:
iris- The list of identifiers to shorten.inPlace- Iftrue, the original list is modified; otherwise it is left untouched and a new list is returned.- Returns:
- A list with the shortened identifiers. If
inPlaceistrue, this is the original list.
-
expandIdentifier
-
expandIdentifiers
-
expandIdentifiers
Expands all identifiers in the given list.- Parameters:
curies- The list of short identifiers to expand.inPlace- Iftrue, the original list is modified; otherwise it is left untouched and a new list is returned.- Returns:
- A list with the expanded identifiers. If
inPlaceistrue, this is the original list.
-