org.openrdf.model
Interface URI

All Superinterfaces:
Comparable, Resource, Serializable, Value
All Known Implementing Classes:
URIImpl

public interface URI
extends Resource

A URI. A URI consists of a local name and a namespace. The local name is defined as the part of the URI string after the last occurrence of the '#', ':' or '/' character, the rest of the URI string is the namespace. URI strings that do not contain any of these character are considered to be malformed.


Method Summary
 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 getPredicateStatements()
          Gets all statements from the RDF graph for which this URI is the predicate.
 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()
 
Methods inherited from interface org.openrdf.model.Resource
addProperty, getSubjectStatements
 
Methods inherited from interface org.openrdf.model.Value
getObjectStatements
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getNamespace

public String getNamespace()
Gets the namespace of this URI.

Returns:
The URI's namespace.

getLocalName

public String getLocalName()
Gets the local name of this URI.

Returns:
The URI's local name.

getURI

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

Returns:
The String-representation of this URI.

getPredicateStatements

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

Throws:
GraphException

equals

public boolean equals(Object o)
Compares a URI object to another object.

Parameters:
o - The object to compare this URI to.
Returns:
true if the other object is an instance of URI and their String-representations are equal, false otherwise.

hashCode

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

Returns:
A hash code for the URI.


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