org.ilrt.inkling.api
Class Node

java.lang.Object
  |
  +--org.ilrt.inkling.api.Node
Direct Known Subclasses:
SQLNode, TreeNode

public class Node
extends java.lang.Object

Inspired by http://www.w3.org/2001/12/rubyrdf/basicrdf.rb

This is a simple Node class. use Node.getResource(), Node.getLiteral()
and Node.getBlank() to create Nodes; also can have getSubjects(),
getObjects(), getPredicates(), with or without an identifier for the
Node as a  node-centric API.

There isn't any Caching or reuse of Nodes.


Field Summary
 boolean isbnode
           
 boolean isresource
           
 
Constructor Summary
Node()
          Construtor for a basic Node with nothing in it
Node(java.lang.String content)
          Construtor for a basic Node with specific content
 
Method Summary
 boolean equals(java.lang.Object o)
          Overriding equals for ease of comparison
static Node getBlank(java.lang.String id)
          Use this method to create a blank Node
static Node getBlank(java.lang.String id, Graph graph)
          Use this method to create a Blank Node, also setting the Graph that contains it Note that generation of ID where the source url is known is a hash of the source with the id of the node from the parser, retaining identity of Nodes
 java.lang.String getContent()
          Returns the Stringified value of the Node
 Graph getGraph()
          Returns the Graph which contains the Node
 java.lang.String getID()
          Returns the identifier of the Node
static Node getLiteral(java.lang.String content)
          Use this method to create a Literal Node
static Node getLiteral(java.lang.String content, Graph graph)
          Use this method to create a Literal Node with a refernce to the Graph
 java.util.Vector getObjects()
          Node-centric Graph traversal
 java.util.Vector getObjects(java.lang.String predid)
          Node-centric Graph traversal
 java.util.Vector getPredicates()
          Node-centric Graph traversal
 java.util.Vector getPredicates(java.lang.String objid)
          Node-centric Graph traversal
static Node getResource(java.lang.String content)
          Use this method to create a Resource Node
static Node getResource(java.lang.String content, Graph graph)
          Use this method to create a Resource Node, also setting the Graph that contains it
 java.util.Vector getSubjects()
          Node-centric Graph traversal
 java.util.Vector getSubjects(java.lang.String predid)
          Node-centric Graph traversal
 java.lang.String inspect()
          Method for printing content
 void setContent(java.lang.String content)
          Sets the content value of the Node
 void setGraph(Graph graph)
          For setting the Graph which contains the Node
 void setID(java.lang.String id)
          Sets the internal ID of the Node
 java.lang.String sha1()
          Useful sha1 of content of Node
 java.lang.String toString()
          Method for printing content
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isresource

public boolean isresource

isbnode

public boolean isbnode
Constructor Detail

Node

public Node()
Construtor for a basic Node with nothing in it

Node

public Node(java.lang.String content)
Construtor for a basic Node with specific content
Method Detail

getContent

public java.lang.String getContent()
Returns the Stringified value of the Node

getGraph

public Graph getGraph()
Returns the Graph which contains the Node

setContent

public void setContent(java.lang.String content)
Sets the content value of the Node

setGraph

public void setGraph(Graph graph)
For setting the Graph which contains the Node

getID

public java.lang.String getID()
Returns the identifier of the Node

setID

public void setID(java.lang.String id)
Sets the internal ID of the Node

inspect

public java.lang.String inspect()
Method for printing content

toString

public java.lang.String toString()
Method for printing content
Overrides:
toString in class java.lang.Object

getResource

public static Node getResource(java.lang.String content)
Use this method to create a Resource Node

getResource

public static Node getResource(java.lang.String content,
                               Graph graph)
Use this method to create a Resource Node, also setting the Graph that contains it

getBlank

public static Node getBlank(java.lang.String id)
Use this method to create a blank Node

getBlank

public static Node getBlank(java.lang.String id,
                            Graph graph)
Use this method to create a Blank Node, also setting the Graph that contains it Note that generation of ID where the source url is known is a hash of the source with the id of the node from the parser, retaining identity of Nodes

getLiteral

public static Node getLiteral(java.lang.String content)
Use this method to create a Literal Node

getLiteral

public static Node getLiteral(java.lang.String content,
                              Graph graph)
Use this method to create a Literal Node with a refernce to the Graph

sha1

public java.lang.String sha1()
Useful sha1 of content of Node

getObjects

public java.util.Vector getObjects(java.lang.String predid)
Node-centric Graph traversal

getObjects

public java.util.Vector getObjects()
Node-centric Graph traversal

getSubjects

public java.util.Vector getSubjects(java.lang.String predid)
Node-centric Graph traversal

getSubjects

public java.util.Vector getSubjects()
Node-centric Graph traversal

getPredicates

public java.util.Vector getPredicates(java.lang.String objid)
Node-centric Graph traversal

getPredicates

public java.util.Vector getPredicates()
Node-centric Graph traversal

equals

public boolean equals(java.lang.Object o)
Overriding equals for ease of comparison
Overrides:
equals in class java.lang.Object