Package com.sodius.oslc.core.model
Class Namespace
java.lang.Object
com.sodius.oslc.core.model.Namespace
- Direct Known Subclasses:
Acc,Dcterms,Foaf,Gcm,JazzDiscovery,JazzDm,JazzFoundation,JazzNetProcess,JazzProcess,JazzQm,Ldp,OslcAm,OslcCm,OslcCmx,OslcConfig,OslcCore,OslcQm,OslcRm,OslcScm,Prov,Rdf,Rdfs,RtcCm,SodiusAudit,SodiusFeedback,SodiusJobs,SodiusLinks,SodiusLqe,SodiusOAuth,SodiusProcess,SodiusProcessScheme,SodiusProcessTypes,SodiusSecurity,SodiusTrs,Trs
Describes a RDF namespace, composed of a URI and a preferred prefix.
- Since:
- 1.4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the namespace preferred prefix.getPrefixed(String uri) Returns the prefixed name of the specified URI, which is the preferred namespace prefix (as defined on this instance) and the local part of the URI.Returns the qualified name of the URI, which is this namespace URI concatenated with the local part of the specified URI.getUri()Returns the namespace URI.inthashCode()static QNameparseQName(String uri) Splits a URI into a qualified name (namespace + localpart).toString()
-
Constructor Details
-
Namespace
Creates a Namespace instance.- Parameters:
uri- the namespace URI.prefix- the namespace preferred prefix.
-
-
Method Details
-
parseQName
Splits a URI into a qualified name (namespace + localpart).- Parameters:
uri- the URI to parse.- Returns:
- the corresponding
QName. - Throws:
IllegalArgumentException- if the URI is not a namespace URI.- Since:
- 3.1.0
-
getUri
Returns the namespace URI.- Returns:
- the namespace URI.
-
getPrefix
Returns the namespace preferred prefix.- Returns:
- the namespace preferred prefix.
-
getQName
Returns the qualified name of the URI, which is this namespace URI concatenated with the local part of the specified URI.- Parameters:
uri- either a simple name (e.g "title"), a full name (e.g. "http://purl.org/dc/terms/title") or a prefixed name (e.g. "dcterms:title")- Returns:
- the qualified name of the namespace, which is the namespace URI concatenated with the specified local part.
-
getPrefixed
Returns the prefixed name of the specified URI, which is the preferred namespace prefix (as defined on this instance) and the local part of the URI. As an example, this method returns"dcterms:title"for a"http://purl.org/dc/terms/title"URI.- Parameters:
uri- either a simple name (e.g "title"), a full name (e.g. "http://purl.org/dc/terms/title") or a prefixed name (e.g. "dcterms:title")- Returns:
- the prefix name of the URI.
-
hashCode
public int hashCode() -
equals
-
toString
-