gate.creole.ontology
Interface OValue


public interface OValue

A class representing something that is either a literal or a OResource.

Developer note: ideally this would be implemented as a superinteface of the Literal and OResource interfaces, but Literal is implemented as a class and has to remain a class for backwards compatibility.löschnaz

Author:
Johann Petrak

Method Summary
 boolean equals(Object other)
           
 Literal getLiteral()
          Get the Literal object if this object represents a literal.
 OResource getOResource()
          Get the OResource object if this object represents a resource.
 int hashCode()
           
 boolean isLiteral()
          Check if the object represents a literal.
 boolean isOResource()
          Check if the object represents a OResource
 String toString()
           
 String toTurtle()
          Create a String representation that conforms to Turtle language syntax.
 

Method Detail

isLiteral

boolean isLiteral()
Check if the object represents a literal.

Returns:
true if the object represents a literal value, false if it represents a blank node ID or an URI.

isOResource

boolean isOResource()
Check if the object represents a OResource

Returns:
true if the object represents a OResource object

getOResource

OResource getOResource()
Get the OResource object if this object represents a resource. Throws a GateOntologyException if this object represents a literal.

Returns:
the OResource represented by this object

getLiteral

Literal getLiteral()
Get the Literal object if this object represents a literal. Throws a GateOntologyException if this object represents a node ID.

Returns:
the Literal represented by this object

toString

String toString()
Overrides:
toString in class Object

toTurtle

String toTurtle()
Create a String representation that conforms to Turtle language syntax. If this represents a OResource it is identical to OResource.toString()

Returns:
a string representation of the node id or literal following Turtle syntax.

hashCode

int hashCode()
Overrides:
hashCode in class Object

equals

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