|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.ilrt.inkling.api.Graph
A simple RDF Graph, inspired by http://www.w3.org/2001/12/rubyrdf/basicrdf.rb The principal methods are ask(), tell(), askSquish(); also askForObjects() and similar. Also removeAll(), delete() See GraphTest to see how they work. Graph gr = new Graph(null, uri, Util.RDFXML); gr.load(); Vector classInstances =gr.askForSubjects(null,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",cl); (returning a Vector of Nodes) Vector superclasses =gr.ask(cl,"http://www.w3.org/2000/01/rdf-schema#subClassOf",null); (returning a Vector of Statements) java.sql.ResultSet r=gr.askSquish(query); (returning a ResultSet) gr.tell(new Statement(new Node(subject),new Node(predicate),new Node(object))); gr.tellAll(vectorOfStatements v); gr.delete(Statement s); (s cannot have null Nodes in it as yet) gr.removeAll();
| Constructor Summary | |
Graph()
|
|
Graph(java.lang.String base)
base would normally be the source url |
|
Graph(java.lang.String base,
java.lang.String type)
Type should be taken from Util e.g. |
|
Graph(java.util.Vector statements)
|
|
Graph(java.util.Vector states,
java.lang.String base,
java.lang.String type)
|
|
| Method Summary | |
java.util.Vector |
ask(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
Simple query method - with lazy strings |
Graph |
ask(Query query)
Ask with a query object |
java.util.Vector |
askForObjects(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
Handy method returning a Vector of object Nodes answering the query |
java.util.Vector |
askForSubjects(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
Handy method returning a Vector of subject Nodes answering the query |
java.util.Vector |
askQuery(Node ss,
Node pp,
Node oo)
The simple triple query method - with Nodes GraphInterface method |
java.sql.ResultSet |
askSquish(java.lang.String query)
Ask with a squish string; returns a ResultSet object, not a Graph. |
boolean |
delete(Statement statement)
Delete a specified Statement |
java.lang.String |
getBase()
base is usually the source url |
static GraphInterface |
getDefault()
For Graphs without a uri (base), creates one with a default uri |
java.util.Vector |
getEdges()
Returns all properties |
java.lang.String |
getID()
legacy - calls getBase() |
java.util.Vector |
getNodes()
Returns all subjects and properties |
java.util.Vector |
getObjects()
Shortcut for getting all object Nodes in the Graph |
java.util.Vector |
getPredicates()
Shortcut for getting all predicates (properties) in the Graph |
int |
getSize()
Returns the number of unique Statements in the Graph |
java.util.Vector |
getStatements()
returns the full Vector of Statements from the Graph |
java.util.Vector |
getSubjects()
Shortcut for getting all subject Nodes in the Graph |
java.lang.String |
getType()
|
java.lang.String |
inspect()
Returns a string containing the contents of the Graph - for debugging |
void |
load()
loads in an RDF graph, using method depending on value of type (you can setType() or set it during initialization, or use gr.load(type)). |
void |
load(java.lang.String type)
loads in an RDF graph, using method depending on value of type (you can setType() or set it during initialization, or use gr.load(type)). |
boolean |
removeAll()
Remove all Statements in the Graph |
void |
setBase(java.lang.String base)
base is usually the source url |
void |
setID(java.lang.String base)
legacy - calls setBase() |
void |
setType(java.lang.String type)
|
int |
size()
Returns the number of unique Statements in the Graph |
void |
tell(Statement statement)
Tell one Statement to the Graph |
void |
tellAll(java.util.Vector states)
Tell a Vector of Statements to the Graph |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Graph()
public Graph(java.lang.String base)
public Graph(java.util.Vector statements)
public Graph(java.lang.String base,
java.lang.String type)
public Graph(java.util.Vector states,
java.lang.String base,
java.lang.String type)
| Method Detail |
public void setType(java.lang.String type)
public java.lang.String getType()
public void load()
public void load(java.lang.String type)
public void setBase(java.lang.String base)
setBase in interface GraphInterfacepublic java.lang.String getBase()
getBase in interface GraphInterfacepublic java.lang.String getID()
public void setID(java.lang.String base)
public java.util.Vector getStatements()
getStatements in interface GraphInterfacepublic static GraphInterface getDefault()
public void tellAll(java.util.Vector states)
tellAll in interface GraphInterfacepublic void tell(Statement statement)
tell in interface GraphInterface
public java.util.Vector askForObjects(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
public java.util.Vector askForSubjects(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
public java.util.Vector askQuery(Node ss,
Node pp,
Node oo)
askQuery in interface SimpleQueryInterface
public java.util.Vector ask(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
ask in interface GraphInterfacepublic java.sql.ResultSet askSquish(java.lang.String query)
askSquish in interface GraphInterfacepublic Graph ask(Query query)
ask in interface GraphInterfacepublic java.lang.String inspect()
public java.util.Vector getObjects()
public java.util.Vector getSubjects()
public java.util.Vector getPredicates()
public boolean removeAll()
removeAll in interface GraphInterfacepublic boolean delete(Statement statement)
delete in interface GraphInterfacepublic int getSize()
public int size()
public java.util.Vector getNodes()
public java.util.Vector getEdges()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||