gate.creole.ontology
Interface ONodeID

All Superinterfaces:
Comparable<ONodeID>
All Known Subinterfaces:
OBNodeID, OURI
All Known Implementing Classes:
URI

public interface ONodeID
extends Comparable<ONodeID>

An ONodeID represents the id of either a blank node or a resource. If the node represented by this is a blank node, name space will be blank and the resource name will be whatever internal name for the blank node the implementation uses. If the node respresented by this is a named resource, the ID will be an URI consisting of a name space and a resource name.
TODO: plan for URI/IRI encodings and comparion of OURIs that have non-ASCII resource names. Most likely each ORUI will remember the string it was created from and return that string for getResourceName or toString. The toDisplayString method will always generate a valid IRI, and the toASCIIString will always generate a valid URI representation. Whether these representations are stored or generated on the fly and which of these representations are used with the backend is implementation dependent.

Author:
Johann Petrak

Method Summary
 int compareTo(ONodeID other)
           
 boolean equals(Object other)
           
 String getNameSpace()
           
 String getResourceName()
           
 int hashCode()
           
 boolean isAnonymousResource()
          Return if this represents a blank node or a named resource.
 String toASCIIString()
          Return the node ID as a pure ASCII string.
 String toDisplayString()
          Return the node ID as a unicode string.
 String toString()
          Return the node ID as the string from which the ID was originally created.
 String toTurtle()
          Return a representation of the node that conforms to Turtle syntax.
 void validate()
          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.
 

Method Detail

getNameSpace

String getNameSpace()

getResourceName

String getResourceName()

toString

String toString()
Return the node ID as the string from which the ID was originally created.

Overrides:
toString in class Object

toASCIIString

String toASCIIString()
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!


toDisplayString

String toDisplayString()
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!


isAnonymousResource

boolean isAnonymousResource()
Return if this represents a blank node or a named resource. Returns true if this represents a blank node (is a BNodeID) or a named resource (is a ORUI).

NOTE: not implemented yet!


compareTo

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

equals

boolean equals(Object other)
Overrides:
equals in class Object

hashCode

int hashCode()
Overrides:
hashCode in class Object

toTurtle

String toTurtle()
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.


validate

void validate()
              throws IllegalArgumentException
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.

Throws:
IllegalArgumentException