public class MemoryGraph extends Object implements Graph, Transaction
Transaction.Status| Constructor and Description |
|---|
MemoryGraph() |
MemoryGraph(Collection<Edge> source) |
MemoryGraph(NamespaceManager nsManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Edge edge) |
boolean |
add(org.openrdf.model.Statement statement) |
void |
add(Vertex vertex)
Add all the outgoing statements from the given vertex.
|
boolean |
addAll(Collection<? extends Edge> sequence) |
void |
addWorker(TransactionWorker worker) |
List<Edge> |
asList()
Get the list of edges added to the graph in the current transaction
|
GraphBuilder |
builder() |
void |
clear() |
void |
commit()
Commit the currently open transaction
|
boolean |
contains(Object obj) |
boolean |
contains(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object) |
boolean |
containsAll(Collection<?> collection) |
Edge |
edge(Edge edge) |
Edge |
edge(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
List<? extends org.openrdf.model.Value> list) |
Edge |
edge(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object)
Add an edge to this Graph.
|
Edge |
edge(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object,
org.openrdf.model.Resource context) |
Edge |
edge(Vertex subject,
org.openrdf.model.URI predicate,
Vertex object) |
org.openrdf.model.Resource |
getId()
Get the identifier this Graph as a named graph.
|
NamespaceManager |
getNamespaceManager() |
Transaction.Status |
getStatus()
Check whether a transaction is open
|
Vertex |
getVertex(org.openrdf.model.Resource id)
Get the Vertex with the specified id.
|
Vertex |
getVertex(String id)
A convenience method that gets the Vertex with the specified id.
|
boolean |
isCopyEdgeAttributes() |
boolean |
isEmpty() |
Iterator<Edge> |
iterator() |
Set<org.openrdf.model.URI> |
lookupLocalName(String localName)
Compute the set of all URI values in this graph which have a given local name
|
Vertex |
mappedBNode(org.openrdf.model.BNode bnode)
Obtain the Vertex that is mapped to a given BNode in the current transaction.
|
void |
open()
Open a transaction.
|
void |
remove(Edge edge)
Remove the specified edge from this graph
|
boolean |
remove(Object obj) |
void |
remove(org.openrdf.model.Resource resource)
Remove a resource from this graph.
|
void |
remove(Vertex v)
Remove a vertex from this graph.
|
boolean |
removeAll(Collection<?> collection) |
void |
removeWorker(TransactionWorker worker) |
boolean |
retainAll(Collection<?> arg0) |
void |
rollback() |
void |
setCopyEdgeAttributes(boolean copyEdgeAttributes) |
void |
setId(org.openrdf.model.Resource id)
Set the identifier for this Graph as a named graph.
|
void |
setNamespaceManager(NamespaceManager nsManager) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] arg0) |
String |
toString() |
Transaction |
tx()
Get the Transactional view of this Graph.
|
Traversal |
v(org.openrdf.model.Resource subject)
Return a traversal for the specified subject.
|
Vertex |
vertex()
A convenience method that creates a new Vertex with a BNode identifier.
|
Vertex |
vertex(org.openrdf.model.Resource id)
Create or get a Vertex with the specified id.
|
Vertex |
vertex(String id)
A convenience method that gets or creates a Vertex from a string IRI identifier.
|
Collection<Vertex> |
vertices()
Returns the set of vertices in this Graph
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCode, spliteratorparallelStream, removeIf, streampublic MemoryGraph()
public MemoryGraph(Collection<Edge> source)
public MemoryGraph(NamespaceManager nsManager)
public boolean isCopyEdgeAttributes()
public void setCopyEdgeAttributes(boolean copyEdgeAttributes)
public Vertex vertex(org.openrdf.model.Resource id)
Graphpublic Vertex getVertex(org.openrdf.model.Resource id)
Graphpublic Vertex vertex(String id)
Graphpublic Vertex getVertex(String id)
Graphpublic Edge edge(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object)
Graphpublic Edge edge(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.openrdf.model.Resource context)
public Collection<Vertex> vertices()
Graphpublic Traversal v(org.openrdf.model.Resource subject)
Graphpublic Transaction tx()
Graphpublic void open()
Transactionopen in interface Transactionpublic Transaction.Status getStatus()
TransactiongetStatus in interface Transactionpublic void commit()
Transactioncommit in interface Transactionpublic void rollback()
rollback in interface Transactionpublic List<Edge> asList()
TransactionasList in interface Transactionpublic void addWorker(TransactionWorker worker)
addWorker in interface Transactionpublic void removeWorker(TransactionWorker worker)
removeWorker in interface Transactionpublic void remove(Edge edge)
Graphpublic void add(Vertex vertex)
Graphpublic org.openrdf.model.Resource getId()
Graphpublic void setId(org.openrdf.model.Resource id)
Graphpublic Vertex vertex()
Graphpublic GraphBuilder builder()
public boolean add(org.openrdf.model.Statement statement)
public boolean add(Edge edge)
public boolean addAll(Collection<? extends Edge> sequence)
public void clear()
public boolean contains(Object obj)
public boolean containsAll(Collection<?> collection)
containsAll in interface Collection<Edge>containsAll in interface Set<Edge>public boolean isEmpty()
public boolean remove(Object obj)
public boolean removeAll(Collection<?> collection)
public boolean retainAll(Collection<?> arg0)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] arg0)
public NamespaceManager getNamespaceManager()
getNamespaceManager in interface Graphpublic void setNamespaceManager(NamespaceManager nsManager)
setNamespaceManager in interface Graphpublic boolean contains(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object)
public void remove(Vertex v)
Graphpublic void remove(org.openrdf.model.Resource resource)
GraphVertex v = graph.getVertex(resource); graph.remove(v);
public Set<org.openrdf.model.URI> lookupLocalName(String localName)
GraphlookupLocalName in interface GraphlookupLocalName in interface LocalNameServicelocalName - The local name to be matchedpublic Edge edge(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, List<? extends org.openrdf.model.Value> list)
public Vertex mappedBNode(org.openrdf.model.BNode bnode)
GraphmappedBNode in interface GraphCopyright © 2019. All rights reserved.