gate.creole.ontology
Class URI

java.lang.Object
  extended by gate.creole.ontology.URI
All Implemented Interfaces:
OBNodeID, ONodeID, OURI, Comparable<ONodeID>

Deprecated. Use OURI objects and the Ontology factory methods for creating them instead.

@Deprecated
public class URI
extends Object
implements OURI, ONodeID, OBNodeID

Each resource has a unique URI in the Ontology. Each URI has a namespace and a name which all together makes a qualified URI. e.g. namespace: http://gate.ac.uk, aResourceName: Person , URI = http://gate.ac.uk#Person. It is possible to have a URI for an anonymouse resource, in which case the namespace is set to an empty string and a flag (isAnonymouseResource) is set to true.

Author:
Niraj Aswani

Field Summary
protected  String aResourceName
          Deprecated. A Resource name (in current version - a value after the last occurance of '#' or '/')
protected  boolean isAnonymousResource
          Deprecated. Denotes whether the OResource this URI belongs to is an anonymous or not.
protected  String namespace
          Deprecated. Namespace for this URI (in current version - a value before the last occurance of '#' or '/')
protected  String uri
          Deprecated. String representation of the URI
 
Constructor Summary
URI(String uri, boolean isAnonymousResource)
          Deprecated. Constructor
 
Method Summary
 int compareTo(ONodeID other)
          Deprecated.  
 boolean equals(Object other)
          Deprecated.  
 String getNameSpace()
          Deprecated. Retrieves the name space part from the URI.
 String getResourceName()
          Deprecated. Retrieves the resource name from the given URI.
 int hashCode()
          Deprecated.  
 boolean isAnonymousResource()
          Deprecated. Indicates whether the URI refers to an anonymous resource
 String toASCIIString()
          Deprecated. Return the node ID as a pure ASCII string.
 String toDisplayString()
          Deprecated. Return the node ID as a unicode string.
 String toString()
          Deprecated. Returns the string representation of the uri.
 String toTurtle()
          Deprecated. Return a representation of the node that conforms to Turtle syntax.
 void validate()
          Deprecated. Validate if the string that was passed on as a bnode id or as an URI/IRI to the constructor of the implementing class can be converted to a blank node identifier or and URI/IRI that conforms to the implementaion.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

namespace

protected String namespace
Deprecated. 
Namespace for this URI (in current version - a value before the last occurance of '#' or '/')


aResourceName

protected String aResourceName
Deprecated. 
A Resource name (in current version - a value after the last occurance of '#' or '/')


uri

protected String uri
Deprecated. 
String representation of the URI


isAnonymousResource

protected boolean isAnonymousResource
Deprecated. 
Denotes whether the OResource this URI belongs to is an anonymous or not.

Constructor Detail

URI

public URI(String uri,
           boolean isAnonymousResource)
    throws InvalidURIException
Deprecated. 
Constructor

Parameters:
uri -
isAnonymousResource -
Throws:
InvalidURIException
Method Detail

getNameSpace

public String getNameSpace()
Deprecated. 
Retrieves the name space part from the URI. In this implementation it retrieves the string that appears before the last occurance of '#' or '/'.

Specified by:
getNameSpace in interface ONodeID

getResourceName

public String getResourceName()
Deprecated. 
Retrieves the resource name from the given URI. In this implementation it retrieves the string that appears after the last occurrence of '#' or '/'.

Specified by:
getResourceName in interface ONodeID

toString

public String toString()
Deprecated. 
Returns the string representation of the uri. In case of anonymous class, it returns the '[' + resourcename + ']'.

Specified by:
toString in interface ONodeID
Overrides:
toString in class Object

isAnonymousResource

public boolean isAnonymousResource()
Deprecated. 
Indicates whether the URI refers to an anonymous resource

Specified by:
isAnonymousResource in interface ONodeID

compareTo

public int compareTo(ONodeID other)
Deprecated. 
Specified by:
compareTo in interface ONodeID
Specified by:
compareTo in interface Comparable<ONodeID>

equals

public boolean equals(Object other)
Deprecated. 
Specified by:
equals in interface ONodeID
Overrides:
equals in class Object

hashCode

public int hashCode()
Deprecated. 
Specified by:
hashCode in interface ONodeID
Overrides:
hashCode in class Object

toTurtle

public String toTurtle()
Deprecated. 
Description copied from interface: ONodeID
Return a representation of the node that conforms to Turtle syntax. This will return a string that conforms to TURTLE (Terse RDF Triple Language) - see http://www.w3.org/TeamSubmission/turtle/

TODO: at the moment, this only returns either the blank node ID unchanged or the URI as returned by toString() between "<" and ">". This will have to use a proper ASCII representation of the URI or an IRI representation instead.

Specified by:
toTurtle in interface ONodeID

validate

public void validate()
Deprecated. 
Description copied from interface: ONodeID
Validate if the string that was passed on as a bnode id or as an URI/IRI to the constructor of the implementing class can be converted to a blank node identifier or and URI/IRI that conforms to the implementaion.

TODO: this is not yet implemented.

Specified by:
validate in interface ONodeID

toDisplayString

public String toDisplayString()
Deprecated. 
Description copied from interface: ONodeID
Return the node ID as a unicode string. If the node is an OURI, this will return a string that is a valid IRI. If the node is a BNodeID, this will return the same sting as toString().

NOTE: not implemented yet!

Specified by:
toDisplayString in interface ONodeID

toASCIIString

public String toASCIIString()
Deprecated. 
Description copied from interface: ONodeID
Return the node ID as a pure ASCII string. If the node is an OURI, this will return a string that has non ASCII characters escaped according to URI escaping rules.
if the node is a BNodeID, this will return the same string as toString().

NOTE: URI encoding and translation from/to IRIs is not implemented yet!

Specified by:
toASCIIString in interface ONodeID