|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIterable
de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO
org.ontonym.logan.LoganGraphSet
public class LoganGraphSet
A NamedGraphSet implementation backed by a Jess-based quad store.
Can be extended to add additional functionality if desired.
| Constructor Summary | |
|---|---|
LoganGraphSet()
Creates a new LoganGraphSet. |
|
LoganGraphSet(File... some_rules)
Creates a new LoganGraphSet and loads a set of rules into the underlying Jess engine. |
|
LoganGraphSet(String... some_rules)
Creates a new LoganGraphSet and loads a set of rule files into the underlying Jess
engine. |
|
| Method Summary | |
|---|---|
void |
addGraph(NamedGraph a_graph)
Adds a NamedGraph to the graph set. |
void |
addQuad(Quad a_quad)
Adds a Quad to the graph set. |
Graph |
asJenaGraph(Node a_defaultGraph)
Presents a view of the entire graph set as a single Jena Graph, with a specified graph
for adding new triples. |
NamedGraphModel |
asJenaModel(String a_defautGraph)
View this graph set as a NamedGraphModel. |
void |
clear()
Removes all graphs (and therefore statements) from this graph set. |
void |
close()
The close operation has no effect. |
boolean |
containsGraph(Node a_graphNode)
Checks to see if the graph set contains a graph with a given Node identifier. |
boolean |
containsGraph(String a_graphNameURI)
Checks to see if the graph set contains a graph with a given URI identifier. |
boolean |
containsQuad(Quad a_pattern)
Checks if a given Quad pattern exists in the graph set. |
long |
countGraphs()
Counts the number of graphs in the model. |
int |
countQuads()
Counts the number of quads in the model. |
NamedGraph |
createGraph(Node a_graphNode)
Creates a new graph using the given Node as an identifier. |
NamedGraph |
createGraph(String a_graphNameURI)
Creates a new graph using the given identifier. |
Iterator<Quad> |
findQuads(Node a_graphName,
Node a_subject,
Node a_predicate,
Node an_object)
Creates an iterator over a set of quads matching the specified pattern. |
Iterator<Quad> |
findQuads(Quad a_pattern)
Creates an iterator over a set of quads matching the specified pattern. |
NamedGraph |
getGraph(Node a_graphNode)
Returns the graph identified by the given node if it exists. |
NamedGraph |
getGraph(String a_graphNameURI)
Returns the graph identified by the given URI identifier if it exists. |
boolean |
isEmpty()
Whether the graph set is empty. |
Iterator<NamedGraph> |
listGraphs()
Lists all the named graphs in this model. |
void |
removeGraph(Node a_graphNode)
Removes a graph from the model. |
void |
removeGraph(String a_graphNameURI)
Removes a graph from the model. |
void |
removeQuad(Quad a_pattern)
Removes any quads from the model that match a Quad pattern. |
| Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO |
|---|
read, read, read, write, write |
| Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIterable |
|---|
iterator |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Constructor Detail |
|---|
public LoganGraphSet()
LoganGraphSet.
public LoganGraphSet(File... some_rules)
LoganGraphSet and loads a set of rules into the underlying Jess engine.
some_rules - the files containing the rules to be loaded into the model.public LoganGraphSet(String... some_rules)
LoganGraphSet and loads a set of rule files into the underlying Jess
engine.
some_rules - the files containing the rules to be loaded into the model.| Method Detail |
|---|
public final void addGraph(NamedGraph a_graph)
NamedGraph to the graph set.
a_graph - the NamedGraph to add to the graph set.public final void addQuad(Quad a_quad)
Quad to the graph set.
a_quad - the Quad to add to the graph set.public final Graph asJenaGraph(Node a_defaultGraph)
Graph, with a specified graph
for adding new triples. If null, the graph name urn:default is used.
a_defaultGraph - the default graph for adding new triples.
public final NamedGraphModel asJenaModel(String a_defautGraph)
NamedGraphModel.
a_defautGraph - the default graph for adding new triples.
public final void clear()
public final void close()
public final boolean containsGraph(Node a_graphNode)
Node identifier.
a_graphNode - the node identifier for the graph of interest.
true if the graph set contains a graph with the same identifier as the
parameter, false otherwise.public final boolean containsGraph(String a_graphNameURI)
a_graphNameURI - the node identifier for the graph of interest.
true if the graph set contains a graph with the same identifier as the
parameter, false otherwise.public final boolean containsQuad(Quad a_pattern)
Quad pattern exists in the graph set.
a_pattern - the pattern of quads we are looking for.
true if at least one quad in the model matching the pattern exists, false otherwise.public final long countGraphs()
public final int countQuads()
public final NamedGraph createGraph(Node a_graphNode)
Node as an identifier. If the graph already
exists, all the statements it contains will be removed before the new graph is created.
a_graphNode - the node to use for the new graph.
a_graphNode parameter.public final NamedGraph createGraph(String a_graphNameURI)
a_graphNameURI - the identifier to use for the new graph.
a_graphNameURI parameter.
public final Iterator<Quad> findQuads(Node a_graphName,
Node a_subject,
Node a_predicate,
Node an_object)
a_graphName - the graph component of the pattern.a_subject - the subject component of the pattern.a_predicate - the predicate component of the pattern.an_object - the object component of the pattern.
public final Iterator<Quad> findQuads(Quad a_pattern)
a_pattern - the quad pattern.
public final NamedGraph getGraph(Node a_graphNode)
a_graphNode - the node representing the graph we wish to return.
null if it cannot be found.public final NamedGraph getGraph(String a_graphNameURI)
a_graphNameURI - the identifier of the graph we wish to return.
null if it cannot be found.public final boolean isEmpty()
true if this graph set contains no graphs, false otherwise.public final Iterator<NamedGraph> listGraphs()
public final void removeGraph(Node a_graphNode)
a_graphNode - a node representing the graph to remove.public final void removeGraph(String a_graphNameURI)
a_graphNameURI - the identifier of the graph to remove.public final void removeQuad(Quad a_pattern)
Quad pattern.
a_pattern - the quad pattern we wish to remove from the model.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||