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
,Prov
,Rdf
,Rdfs
,RtcCm
,SodiusAudit
,SodiusFeedback
,SodiusLinks
,SodiusLqe
,SodiusOAuth
,SodiusProcess
,SodiusProcessScheme
,SodiusProcessTypes
,SodiusSecurity
,SodiusTrs
,Trs
public class Namespace extends Object
Describes a RDF namespace, composed of a URI and a preferred prefix.- Since:
- 1.4.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getPrefix()
Returns the namespace preferred prefix.String
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.QName
getQName(String uri)
Returns the qualified name of the URI, which is this namespace URI concatenated with the local part of the specified URI.String
getUri()
Returns the namespace URI.int
hashCode()
static QName
parseQName(String uri)
Splits a URI into a qualified name (namespace + localpart).String
toString()
-
-
-
Method Detail
-
parseQName
public static QName parseQName(String uri)
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
public String getUri()
Returns the namespace URI.- Returns:
- the namespace URI.
-
getPrefix
public String getPrefix()
Returns the namespace preferred prefix.- Returns:
- the namespace preferred prefix.
-
getQName
public QName getQName(String uri)
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
public String 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. 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.
-
-