|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mulgara.mrg.AbstractGraphExt
org.mulgara.mrg.AbstractGraph
org.mulgara.mrg.IndexedGraph
public class IndexedGraph
A graph with three indexes for complete searchability. Indexes are hash-based, giving constant time lookups. This graph operates the same as other implementations of graph, but is fully indexed.
| Field Summary |
|---|
| Fields inherited from interface org.mulgara.mrg.Graph |
|---|
X |
| Constructor Summary | |
|---|---|
IndexedGraph()
Default constructor for an empty graph. |
|
IndexedGraph(Collection<Triple> triples)
Builds a graph with a collection of triples. |
|
| Method Summary | ||
|---|---|---|
protected
|
createCollection()
Use a HashSet for efficient lookups. |
|
protected
|
createMap()
Use hashmaps for efficient lookups. |
|
boolean |
delete(SubjectNode s,
PredicateNode p,
ObjectNode o)
Remove a triple from the graph. |
|
Collection<ObjectNode> |
getObjects()
Gets all the objects in the graph. |
|
Collection<PredicateNode> |
getPredicates()
Gets all the predicates in the graph. |
|
boolean |
insert(SubjectNode s,
PredicateNode p,
ObjectNode o)
Add a new triple to the graph. |
|
Iterator<Triple> |
match(SubjectNode s,
PredicateNode p,
ObjectNode o)
Find all triples that match a given pattern. |
|
| Methods inherited from class org.mulgara.mrg.AbstractGraph |
|---|
delete, doesResourceExist, exportN3, exportN3, exportXML, exportXML, getProperties, getRawProperties, getRdfList, getSubjects, getSubjects, getTriples, getValue, getValues, insert, isAsserted, isAsserted, isEmpty, matchSubgraph, mergeInto, size, unionInto |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IndexedGraph()
public IndexedGraph(Collection<Triple> triples)
triples - The initial triples for the graph.| Method Detail |
|---|
protected <X,Y> Map<X,Y> createMap()
createMap in class AbstractGraphprotected <X> Collection<X> createCollection()
createCollection in class AbstractGraph
public boolean insert(SubjectNode s,
PredicateNode p,
ObjectNode o)
insert in interface AppendableGraphinsert in class AbstractGraphs - The subject of the triple.p - The predicate of the triple.o - The object of the triple.
true if the triple was already in the graph.
public boolean delete(SubjectNode s,
PredicateNode p,
ObjectNode o)
delete in interface WritableGraphdelete in class AbstractGraphs - The subject of the triple.p - The predicate of the triple.o - The object of the triple.
true if the triple was already in the graph.
public Iterator<Triple> match(SubjectNode s,
PredicateNode p,
ObjectNode o)
match in interface Graphmatch in class AbstractGraphs - The subject of the triples to match. If null or Graph.X then all subjects match.p - The predicate of the triple to add. If null or Graph.X then all predicates match.o - The object of the triple to add. If null or Graph.X then all objects match.
public Collection<PredicateNode> getPredicates()
getPredicates in interface GraphgetPredicates in class AbstractGraphpublic Collection<ObjectNode> getObjects()
getObjects in interface GraphgetObjects in class AbstractGraph
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||