org.openrdf.model.impl
Class URIImpl

java.lang.Object
  extended byorg.openrdf.model.impl.URIImpl
All Implemented Interfaces:
Comparable, Resource, Serializable, URI, Value
Direct Known Subclasses:
IdURI, NativeURI, URINode

public class URIImpl
extends Object
implements URI, Serializable

An implementation of the URI interface.

See Also:
Serialized Form

Field Summary
static URI RDF_ALT
          Constant URI for rdf:Alt
static URI RDF_BAG
          Constant URI for rdf:Bag
static URI RDF_FIRST
          Constant URI for rdf:first
static URI RDF_LIST
          Constant URI for rdf:List
static URI RDF_NIL
          Constant URI for rdf:nil
static URI RDF_OBJECT
          Constant URI for rdf:object
static URI RDF_PREDICATE
          Constant URI for rdf:predicate
static URI RDF_PROPERTY
          Constant URI for rdf:Property
static URI RDF_REST
          Constant URI for rdf:rest
static URI RDF_SEQ
          Constant URI for rdf:Seq
static URI RDF_STATEMENT
          Constant URI for rdf:Statement
static URI RDF_SUBJECT
          Constant URI for rdf:subject
static URI RDF_TYPE
          Constant URI for rdf:type
static URI RDF_VALUE
          Constant URI for rdf:value
static URI RDF_XMLLITERAL
          Constant URI for rdf:XMLLiteral
static URI RDFS_CLASS
          Constant URI for rdfs:Class
static URI RDFS_COMMENT
          Constant URI for rdfs:comment
static URI RDFS_CONTAINER
          Constant URI for rdfs:Container
static URI RDFS_CONTAINERMEMBERSHIPPROPERTY
          Constant URI for rdfs:ContainerMembershipProperty
static URI RDFS_DATATYPE
          Constant URI for rdfs:Datatype
static URI RDFS_DOMAIN
          Constant URI for rdfs:domain
static URI RDFS_ISDEFINEDBY
          Constant URI for rdfs:isDefinedBy
static URI RDFS_LABEL
          Constant URI for rdfs:label
static URI RDFS_LITERAL
          Constant URI for rdfs:Literal
static URI RDFS_MEMBER
          Constant URI for rdfs:member
static URI RDFS_RANGE
          Constant URI for rdfs:range
static URI RDFS_RESOURCE
          Constant URI for rdfs:Resource
static URI RDFS_SEEALSO
          Constant URI for rdfs:seeAlso
static URI RDFS_SUBCLASSOF
          Constant URI for rdfs:subClassOf
static URI RDFS_SUBPROPERTYOF
          Constant URI for rdfs:subPropertyOf
 
Constructor Summary
URIImpl(String uri)
          Creates a new URI from the supplied string.
URIImpl(String namespace, String localName)
          Creates a new URI that will get the supplied namespace and local name.
 
Method Summary
 void addProperty(URI property, Value value)
          Adds a property to this Resource in the RDF graph.
 int compareTo(Object o)
          Compares this URI with the supplied object.
 boolean equals(Object o)
          Compares a URI object to another object.
 String getLocalName()
          Gets the local name of this URI.
 String getNamespace()
          Gets the namespace of this URI.
 StatementIterator getObjectStatements()
          Gets all statements from the RDF graph for which this value is the object.
 StatementIterator getPredicateStatements()
          Gets all statements from the RDF graph for which this URI is the predicate.
 StatementIterator getSubjectStatements()
          Gets all statements from the RDF graph for which this resource is the subject.
 String getURI()
          Returns the String-representation of this URI.
 int hashCode()
          The hash code of a URI is defined as follows: namespace.hashCode() ^ localName.hashCode()
 String toString()
          Returns the String-representation of this URI.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RDF_TYPE

public static final URI RDF_TYPE
Constant URI for rdf:type


RDF_PROPERTY

public static final URI RDF_PROPERTY
Constant URI for rdf:Property


RDF_XMLLITERAL

public static final URI RDF_XMLLITERAL
Constant URI for rdf:XMLLiteral


RDF_SUBJECT

public static final URI RDF_SUBJECT
Constant URI for rdf:subject


RDF_PREDICATE

public static final URI RDF_PREDICATE
Constant URI for rdf:predicate


RDF_OBJECT

public static final URI RDF_OBJECT
Constant URI for rdf:object


RDF_STATEMENT

public static final URI RDF_STATEMENT
Constant URI for rdf:Statement


RDF_ALT

public static final URI RDF_ALT
Constant URI for rdf:Alt


RDF_BAG

public static final URI RDF_BAG
Constant URI for rdf:Bag


RDF_SEQ

public static final URI RDF_SEQ
Constant URI for rdf:Seq


RDF_VALUE

public static final URI RDF_VALUE
Constant URI for rdf:value


RDF_LIST

public static final URI RDF_LIST
Constant URI for rdf:List


RDF_FIRST

public static final URI RDF_FIRST
Constant URI for rdf:first


RDF_REST

public static final URI RDF_REST
Constant URI for rdf:rest


RDF_NIL

public static final URI RDF_NIL
Constant URI for rdf:nil


RDFS_RESOURCE

public static final URI RDFS_RESOURCE
Constant URI for rdfs:Resource


RDFS_CLASS

public static final URI RDFS_CLASS
Constant URI for rdfs:Class


RDFS_LITERAL

public static final URI RDFS_LITERAL
Constant URI for rdfs:Literal


RDFS_SUBCLASSOF

public static final URI RDFS_SUBCLASSOF
Constant URI for rdfs:subClassOf


RDFS_SUBPROPERTYOF

public static final URI RDFS_SUBPROPERTYOF
Constant URI for rdfs:subPropertyOf


RDFS_DOMAIN

public static final URI RDFS_DOMAIN
Constant URI for rdfs:domain


RDFS_RANGE

public static final URI RDFS_RANGE
Constant URI for rdfs:range


RDFS_COMMENT

public static final URI RDFS_COMMENT
Constant URI for rdfs:comment


RDFS_LABEL

public static final URI RDFS_LABEL
Constant URI for rdfs:label


RDFS_ISDEFINEDBY

public static final URI RDFS_ISDEFINEDBY
Constant URI for rdfs:isDefinedBy


RDFS_SEEALSO

public static final URI RDFS_SEEALSO
Constant URI for rdfs:seeAlso


RDFS_DATATYPE

public static final URI RDFS_DATATYPE
Constant URI for rdfs:Datatype


RDFS_CONTAINER

public static final URI RDFS_CONTAINER
Constant URI for rdfs:Container


RDFS_MEMBER

public static final URI RDFS_MEMBER
Constant URI for rdfs:member


RDFS_CONTAINERMEMBERSHIPPROPERTY

public static final URI RDFS_CONTAINERMEMBERSHIPPROPERTY
Constant URI for rdfs:ContainerMembershipProperty

Constructor Detail

URIImpl

public URIImpl(String uri)
Creates a new URI from the supplied string.

Parameters:
uri - A String representing a legal, absolute URI.
Throws:
IllegalArgumentException - If the supplied URI is not a legal (absolute) URI.

URIImpl

public URIImpl(String namespace,
               String localName)
Creates a new URI that will get the supplied namespace and local name.

Parameters:
namespace - A namespace.
localName - A legal local name. A legal local name adheres to the definition of an NCName as specified at http://www.w3.org/TR/REC-xml-names/#NT-NCName.
Method Detail

getNamespace

public String getNamespace()
Description copied from interface: URI
Gets the namespace of this URI.

Specified by:
getNamespace in interface URI
Returns:
The URI's namespace.

getLocalName

public String getLocalName()
Description copied from interface: URI
Gets the local name of this URI.

Specified by:
getLocalName in interface URI
Returns:
The URI's local name.

getURI

public String getURI()
Description copied from interface: URI
Returns the String-representation of this URI. The String-representation consists of the concatenation of the namespace and the local name.

Specified by:
getURI in interface URI
Returns:
The String-representation of this URI.

equals

public boolean equals(Object o)
Description copied from interface: URI
Compares a URI object to another object.

Specified by:
equals in interface URI

hashCode

public int hashCode()
Description copied from interface: URI
The hash code of a URI is defined as follows:
 namespace.hashCode() ^ localName.hashCode()
 

Specified by:
hashCode in interface URI

compareTo

public int compareTo(Object o)
Compares this URI with the supplied object.

Specified by:
compareTo in interface Comparable
Throws:
ClassCastException - if o is not of type Value
See Also:
Comparable

toString

public String toString()
Returns the String-representation of this URI.


getPredicateStatements

public StatementIterator getPredicateStatements()
                                         throws GraphException
Description copied from interface: URI
Gets all statements from the RDF graph for which this URI is the predicate.

Specified by:
getPredicateStatements in interface URI
Throws:
GraphException

addProperty

public void addProperty(URI property,
                        Value value)
                 throws GraphException
Description copied from interface: Resource
Adds a property to this Resource in the RDF graph. The result is that a statement of the form (this, property, value) is added.

Specified by:
addProperty in interface Resource
Parameters:
property - the predicate of the statement that should be added.
value - the value of the statements that should be added.
Throws:
GraphException

getSubjectStatements

public StatementIterator getSubjectStatements()
                                       throws GraphException
Description copied from interface: Resource
Gets all statements from the RDF graph for which this resource is the subject.

Specified by:
getSubjectStatements in interface Resource
Throws:
GraphException

getObjectStatements

public StatementIterator getObjectStatements()
                                      throws GraphException
Description copied from interface: Value
Gets all statements from the RDF graph for which this value is the object.

Specified by:
getObjectStatements in interface Value
Throws:
GraphException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.