|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrdf.graph.global.MoleculeGraphImpl
public class MoleculeGraphImpl
| Constructor Summary | |
|---|---|
MoleculeGraphImpl(WritableIndex<Long> newWriteIndex,
ReadableIndex<Long> newReadIndex,
MoleculeLocalizer newLocalizer,
Graph newGraph,
NodePool nodePool)
|
|
| Method Summary | |
|---|---|
void |
add(Iterator<Triple> triples)
Adds all the triples contained in an iterator into the graph. |
void |
add(Molecule molecule)
|
void |
add(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
Adds a triple to the graph. |
void |
add(Triple... triples)
Adds all the triples into the graph. |
void |
add(Triple triple)
Adds a triple to the graph. |
Molecule |
addRootTriple(Molecule molecule,
Triple rootTriple)
|
void |
clear()
Removes all statements and resource related to those statements from the graph. |
void |
close()
Closes any resources associated with this graph. |
boolean |
contains(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
Test the graph for the occurrence of a statement. |
boolean |
contains(Triple triple)
Test the graph for the occurrence of the triple. |
void |
delete(Molecule molecule)
|
ClosableIterable<Triple> |
find(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
Returns an iteratable of Triples to a set of statements that
match a given subject, predicate and object. |
ClosableIterable<Triple> |
find(Triple triple)
Returns an iteratable of Triples to a set of statements that
match a given subject, predicate and object. |
Molecule |
findEnclosingMolecule(Triple triple)
|
ClosableIterator<Molecule> |
findMolecules(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
|
ClosableIterator<Molecule> |
findMolecules(Triple rootTriple)
|
ClosableIterable<? extends Node> |
findNodes(NodeType type)
Returns all unique values of a given type. |
ClosableIterable<PredicateNode> |
findPredicates(Resource resource)
Return predicates that are part of an RDF triple where resource is either a subject or object. |
ClosableIterable<Resource> |
findResources(ValueNodeType type)
Returns all unique resources for a given ValueNodeType (BNode or URIReference). |
Molecule |
findTopLevelMolecule(Triple triple)
|
GraphElementFactory |
getElementFactory()
Returns the node factory for the graph, or creates one. |
long |
getNumberOfMolecules()
|
long |
getNumberOfTriples()
Returns the number of triples in the graph. |
TripleFactory |
getTripleFactory()
Returns the triple factory for the graph, or creates one. |
boolean |
isEmpty()
Returns true if the graph is empty i.e. the number of triples is 0. |
ClosableIterator<Molecule> |
iterator()
|
void |
remove(Iterator<Triple> triples)
Removes all the triples contained in an iterator from the graph. |
void |
remove(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
Removes a triple from the graph. |
void |
remove(Triple... triples)
Removes all the triples into the graph. |
void |
remove(Triple triple)
Removes a triple from the graph. |
Molecule |
removeRootTriple(Molecule molecule,
Triple rootTriple)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MoleculeGraphImpl(WritableIndex<Long> newWriteIndex,
ReadableIndex<Long> newReadIndex,
MoleculeLocalizer newLocalizer,
Graph newGraph,
NodePool nodePool)
| Method Detail |
|---|
public void add(Molecule molecule)
add in interface MoleculeGraph
public void delete(Molecule molecule)
throws GraphException
delete in interface MoleculeGraphGraphException
public Molecule findTopLevelMolecule(Triple triple)
throws GraphException
findTopLevelMolecule in interface MoleculeGraphGraphException
public Molecule findEnclosingMolecule(Triple triple)
throws GraphException
findEnclosingMolecule in interface MoleculeGraphGraphException
public ClosableIterator<Molecule> findMolecules(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
throws GraphException
findMolecules in interface MoleculeGraphGraphException
public ClosableIterator<Molecule> findMolecules(Triple rootTriple)
throws GraphException
findMolecules in interface MoleculeGraphGraphException
public boolean contains(Triple triple)
throws GraphException
Graph
contains in interface Graphtriple - The triple to find.
GraphException - If there was an error accessing the graph.
public boolean contains(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
throws GraphException
Graph
contains in interface Graphsubject - The subject to find or AnySubjectNode to indicate any subject.predicate - The predicate to find or AnyPredicateNode to indicate any predicate.object - The object to find or AnyObjectNode to indicate any object.
GraphException - If there was an error accessing the graph.
public ClosableIterable<Triple> find(Triple triple)
throws GraphException
GraphTriples to a set of statements that
match a given subject, predicate and object. An AnyNode value for any of
the parts of a triple are treated as unconstrained, any values will be
returned.
find in interface Graphtriple - The triple to find.
GraphException - If there was an error accessing the graph.
public ClosableIterable<Triple> find(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
throws GraphException
GraphTriples to a set of statements that
match a given subject, predicate and object. An AnyNode value for any of
the parts of a triple are treated as unconstrained, any values will be
returned.
find in interface Graphsubject - The subject to find or AnySubjectNode to indicate any subject.predicate - The predicate to find or AnyPredicateNode to indicate any predicate.object - The object to find or AnyObjectNode to indicate any object.
GraphException - If there was an error accessing the graph.public ClosableIterable<? extends Node> findNodes(NodeType type)
Graph
findNodes in interface Graphtype - the node type can be positional (SPO) or node type (Resource, URIReference, Literal or BNode).
public ClosableIterable<PredicateNode> findPredicates(Resource resource)
throws GraphException
Graph
findPredicates in interface Graphresource - the resource that is either a subject or object in a triple.
GraphException - If there was an error accessing the graph.public ClosableIterable<Resource> findResources(ValueNodeType type)
Graph
findResources in interface Graphtype - either BlankNodeType or URIReferenceNodeType.
public void add(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
throws GraphException
GraphGraphElementFactory.
add in interface Graphsubject - The subject.predicate - The predicate.object - The object.
GraphException - If the statement can't be made.
public void add(Triple triple)
throws GraphException
GraphGraphElementFactory.
add in interface Graphtriple - The triple.
GraphException - If the statement can't be made.
public void add(Iterator<Triple> triples)
throws GraphException
GraphGraphElementFactory.
add in interface Graphtriples - The triple iterator.
GraphException - If the statements can't be made.
public void add(Triple... triples)
throws GraphException
GraphGraphElementFactory.
add in interface Graphtriples - the triples to add.
GraphException - If the statements can't be made.public void clear()
Graph
clear in interface Graphpublic void close()
Graph
close in interface Graph
public void remove(SubjectNode subject,
PredicateNode predicate,
ObjectNode object)
throws GraphException
GraphGraphElementFactory.
remove in interface Graphsubject - The subject.predicate - The predicate.object - The object.
GraphException - If there was an error revoking the statement, For example if it didn't exist.
public void remove(Triple triple)
throws GraphException
GraphGraphElementFactory.
remove in interface Graphtriple - The triple.
GraphException - If there was an error revoking the statement, For
example if it didn't exist.
public void remove(Iterator<Triple> triples)
throws GraphException
GraphGraphElementFactory.
remove in interface Graphtriples - The triple iterator.
GraphException - If the statements can't be revoked.
public void remove(Triple... triples)
throws GraphException
GraphGraphElementFactory.
remove in interface Graphtriples - the triples to remove.
GraphException - If the statements can't be revoked.public GraphElementFactory getElementFactory()
Graph
getElementFactory in interface Graphpublic TripleFactory getTripleFactory()
Graph
getTripleFactory in interface Graph
public long getNumberOfTriples()
throws GraphException
Graph
getNumberOfTriples in interface GraphGraphException - If the statements number of statements in the graph fails to be found.
public boolean isEmpty()
throws GraphException
Graph
isEmpty in interface GraphGraphException - If the statements number of statements in the graph fails to be found.
public ClosableIterator<Molecule> iterator()
throws GraphException
iterator in interface MoleculeGraphGraphExceptionpublic long getNumberOfMolecules()
getNumberOfMolecules in interface MoleculeGraph
public Molecule addRootTriple(Molecule molecule,
Triple rootTriple)
throws GraphException
addRootTriple in interface MoleculeGraphGraphException
public Molecule removeRootTriple(Molecule molecule,
Triple rootTriple)
throws GraphException
removeRootTriple in interface MoleculeGraphGraphExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||