|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Molecule
A molecule is a container of a subgraph of RDF triples. It contains a collection of triples that share some common chain of blank nodes. Molecules consist of a set of root triples. These share a blank node - typically the subject but it can be the object as well. For example, _1 p o, s p2 _1 is a simple molecule. The highest in this set of root triples (as defined by some ordering) is the head triple. The typical ordering is most grounded (fewest blank nodes), followed by URIs, Literals and then alphabetical ordering. The chain of blank nodes creates a molecule that contains submolecules. If a triple in the root has a blank node as its object it is a linking triple. This is how the chains to submolecules are created. From one molecule to the next the object and subject nodes are swapped. For example, the linking triple _1 p _2 will link to a triple in a submolecule _2 p o.
| Method Summary | |
|---|---|
Molecule |
add(MergeSubmolecules merger,
Molecule subMolecule)
Adds a molecule based on head triple matching. |
Molecule |
add(Triple triple)
Add a triple to the root set of triples. |
Molecule |
add(Triple linkingTriple,
Molecule subMolecule)
Add a submolecule to a molecule using the given root triple. |
Molecule |
add(Triple linkingTriple,
Triple subMoleculeTriple)
Add a triple to a submolecule which has the given linking triple. |
boolean |
contains(Triple triple)
Checks for existence of a triple in the root triples. |
Iterator<Triple> |
find(SubjectNode subject,
PredicateNode predicateNode,
ObjectNode object)
|
Iterator<Triple> |
find(Triple triple)
|
Triple |
getHeadTriple()
Returns the highest triple (as defined by some ordering). |
Iterator<Triple> |
getRootTriples()
Returns an iterator of all the triples in the root set. |
Set<Triple> |
getRootTriplesAsSet()
Creates an (usually) in memory version of the root set of triples. |
SortedSet<Molecule> |
getSubMolecules(Triple rootTriple)
Returns a set of submolecules for a given root triple. |
boolean |
isTopLevelMolecule()
Returns true if this molecule has no parent molecule (it's not a submolecule). |
Iterator<Triple> |
iterator()
|
void |
remove(Triple triple)
Remove a triple from the root set of triples. |
boolean |
removeMolecule(Triple triple,
Molecule subMolecule)
Removes the submolecule from the triple. |
int |
size()
Returns the number of triples in the molecule. |
void |
specialAdd(Molecule molecule)
Copies the top level (from the root triples) of the given molecule into this molecule. |
| Method Detail |
|---|
Molecule add(Triple triple)
triple - the triple to add.
Molecule add(Triple linkingTriple,
Molecule subMolecule)
linkingTriple - the root triple to hang the submolecule off of.subMolecule - the submolecule to add.
Molecule add(Triple linkingTriple,
Triple subMoleculeTriple)
linkingTriple - the linking triple.subMoleculeTriple - the triple of the submolecule.
boolean contains(Triple triple)
triple - the triple to check for existance.
Triple getHeadTriple()
Iterator<Triple> getRootTriples()
Set<Triple> getRootTriplesAsSet()
SortedSet<Molecule> getSubMolecules(Triple rootTriple)
rootTriple - the root triple to use to get the submolecules.
void remove(Triple triple)
triple - the triple to remove.int size()
boolean isTopLevelMolecule()
Molecule add(MergeSubmolecules merger,
Molecule subMolecule)
merger - the code which merges the two submolecules together.subMolecule - the submolecule to add.
void specialAdd(Molecule molecule)
molecule - the molecule to add to this one.
boolean removeMolecule(Triple triple,
Molecule subMolecule)
triple - The triple which contains the submolecules.subMolecule - The submolecule to remove.
Iterator<Triple> iterator()
Iterator<Triple> find(Triple triple)
Iterator<Triple> find(SubjectNode subject,
PredicateNode predicateNode,
ObjectNode object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||