|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO
de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetImpl
public class NamedGraphSetImpl
Implementation of the NamedGraphSet interface based on a
set of in-memory NamedGraphs. For details about Named Graphs see
http://www.w3.org/2004/03/trix/.
| Constructor Summary | |
|---|---|
NamedGraphSetImpl()
|
|
| Method Summary | |
|---|---|
void |
addGraph(NamedGraph graph)
Adds a NamedGraph to the set. |
void |
addQuad(Quad quad)
Adds a quad to the NamedGraphSet. |
Graph |
asJenaGraph(Node defaultGraphForAdding)
Returns the union graph of the NamedGraphSet. |
NamedGraphModel |
asJenaModel(String defaultGraphForAdding)
Returns a Jena Model view on the NamedGraphSet, equivalent to the union graph of all graphs in the graph set. |
void |
clear()
Deletes all NamedGraphs from the set. |
void |
close()
Closes the NamedGraphSet and frees up resources held. |
boolean |
containsGraph(Node graphName)
Tells wether the NamedGraphSet contains a NamedGraph. |
boolean |
containsGraph(String graphNameURI)
Tells wether the NamedGraphSet contains a NamedGraph. |
boolean |
containsQuad(Quad pattern)
Tells wether the NamedGraphSet contains a quad or quads matching a pattern. |
long |
countGraphs()
Returns the number of NamedGraphs in the set. |
int |
countQuads()
Counts the Quads in the NamedGraphSet. |
NamedGraph |
createGraph(Node graphName)
Creates a new NamedGraph and adds it to the set. |
NamedGraph |
createGraph(String graphNameURI)
Creates a new NamedGraph and adds it to the set. |
protected NamedGraph |
createNamedGraphInstance(Node graphName)
|
Iterator |
findQuads(Node graphName,
Node subject,
Node predicate,
Node object)
Finds Quads that match a pattern. |
Iterator |
findQuads(Quad pattern)
Finds Quads that match a quad pattern. |
NamedGraph |
getGraph(Node graphName)
Returns the NamedGraph with a specific name from the GraphSet. |
NamedGraph |
getGraph(String graphNameURI)
Returns the NamedGraph with a specific name from the GraphSet. |
boolean |
isEmpty()
Tells wether the set contains any NamedGraphs. |
Iterator |
listGraphs()
Returns an iterator over all NamedGraphs in the set. |
void |
removeGraph(Node graphName)
Removes a NamedGraph from the set. |
void |
removeGraph(String graphNameURI)
Removes the NamedGraph with a specific name. |
void |
removeQuad(Quad pattern)
Deletes Quads from the NamedGraphSet. |
| Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO |
|---|
read, read, read, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.fuberlin.wiwiss.ng4j.NamedGraphSet |
|---|
read, read, read, write, write |
| Constructor Detail |
|---|
public NamedGraphSetImpl()
| Method Detail |
|---|
public void addGraph(NamedGraph graph)
NamedGraphSet
addGraph in interface NamedGraphSetgraph - The NamedGraph to be addedpublic boolean containsGraph(Node graphName)
NamedGraphSet
containsGraph in interface NamedGraphSetgraphName - The name of a NamedGraph
public boolean containsGraph(String graphNameURI)
NamedGraphSet
containsGraph in interface NamedGraphSetgraphNameURI - The name of a NamedGraph
public long countGraphs()
NamedGraphSet
countGraphs in interface NamedGraphSetpublic NamedGraph createGraph(Node graphName)
NamedGraphSet
createGraph in interface NamedGraphSetgraphName - The name of the NamedGraph to be created;
must be an URI node
public NamedGraph createGraph(String graphNameURI)
NamedGraphSet
createGraph in interface NamedGraphSetgraphNameURI - The name of the NamedGraph to be created;
must be an URI
public NamedGraph getGraph(Node graphName)
NamedGraphSet
getGraph in interface NamedGraphSetgraphName - The name of the NamedGraph to be returned
public NamedGraph getGraph(String graphNameURI)
NamedGraphSet
getGraph in interface NamedGraphSetgraphNameURI - The name of the NamedGraph to be returned
public boolean isEmpty()
NamedGraphSet
isEmpty in interface NamedGraphSetpublic Iterator listGraphs()
NamedGraphSetNamedGraphs in the set.
listGraphs in interface NamedGraphSetpublic void removeGraph(Node graphName)
NamedGraphSet
removeGraph in interface NamedGraphSetgraphName - The name of the NamedGraph to be removedpublic void removeGraph(String graphNameURI)
NamedGraphSet
removeGraph in interface NamedGraphSetgraphNameURI - The name of the NamedGraph to be removedpublic void clear()
NamedGraphSet
clear in interface NamedGraphSetpublic void addQuad(Quad quad)
NamedGraphSet
addQuad in interface NamedGraphSetquad - A quad to be added to the NamedGraphSetpublic boolean containsQuad(Quad pattern)
NamedGraphSetQuad
instances with Node.ANY in one or more positions.
containsQuad in interface NamedGraphSetpattern - A quad or quad pattern
public int countQuads()
NamedGraphSet
countQuads in interface NamedGraphSet
public Iterator findQuads(Node graphName,
Node subject,
Node predicate,
Node object)
NamedGraphSetNode.ANY to match everything in that position.
findQuads in interface NamedGraphSetgraphName - The graph to find triples fromsubject - The subject to be matchedpredicate - The predicate to be matchedobject - The object to be matched
Quads that match the patternpublic Iterator findQuads(Quad pattern)
NamedGraphSetNode.ANY).
findQuads in interface NamedGraphSetpattern - A quad or quad pattern
Quads that match the patternpublic void removeQuad(Quad pattern)
NamedGraphSetNode.ANY).
All matching Quads will be deleted. If no Quads match, nothing
happens. This operation will not delete any NamedGraphs from the set.
Empty NamedGraphs will be retained.
removeQuad in interface NamedGraphSetpattern - A quad or quad pattern to be deletedpublic Graph asJenaGraph(Node defaultGraphForAdding)
NamedGraphSetAdd operations to the union graph are all written to the default graph specified as the argument.
Delete operations remove the triple from all NamedGraphs.
asJenaGraph in interface NamedGraphSetdefaultGraphForAdding - The name of the default graph used for
adding triples; must be an URI
public NamedGraphModel asJenaModel(String defaultGraphForAdding)
NamedGraphSetAdd operations on the returned model are all written to the default graph.
Read and write operations one the returned
model have the behaviour of NamedGraphSet.read(String, String) and
NamedGraphSet.write(OutputStream, String, String).
All Statements returned by the NamedGraphModel can be casted to
NamedGraphStatement to access information about the graphs
they are contained in.
asJenaModel in interface NamedGraphSetdefaultGraphForAdding - The name of the default graph used for
adding triples; must be an URI
public void close()
NamedGraphSet
close in interface NamedGraphSetprotected NamedGraph createNamedGraphInstance(Node graphName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||