public static class BigdataGASEngine.BigdataGraphAccessor extends Object implements IGraphAccessor
Constructor and Description |
---|
BigdataGASEngine.BigdataGraphAccessor(IIndexManager indexManager)
Obtain a view of the default KB instance as of the last commit time on
the database.
|
BigdataGASEngine.BigdataGraphAccessor(IIndexManager indexManager,
String namespace,
long timestamp) |
Modifier and Type | Method and Description |
---|---|
void |
advanceView()
Hook to advance the view of the graph.
|
VertexDistribution |
getDistribution(Random r)
Obtain a weighted distribution of the vertices in the graph from which
samples may then be taken.
|
long |
getEdgeCount(IGASContext<?,?,?> ctx,
org.openrdf.model.Value u,
EdgesEnum edges)
Return the #of edges of the specified type for the given vertex.
|
Iterator<org.openrdf.model.Statement> |
getEdges(IGASContext<?,?,?> ctx,
org.openrdf.model.Value u,
EdgesEnum edges)
Return the edges for the given vertex.
|
AbstractTripleStore |
getKB()
Return a view of the specified graph (aka KB) as of the specified
timestamp.
|
String |
getNamespace() |
Long |
getTimestamp() |
public BigdataGASEngine.BigdataGraphAccessor(IIndexManager indexManager, String namespace, long timestamp)
indexManager
- The index manager.namespace
- The namespace of the graph.timestamp
- The timestamp of the view. If you specify
ITx.READ_COMMITTED
, then
IIndexStore.getLastCommitTime()
will be used to
locate the most recently committed view of the graph at
the start of each iteration. This provides one mechanism
for dynamic graphs.public BigdataGASEngine.BigdataGraphAccessor(IIndexManager indexManager)
public void advanceView()
IGraphAccessor
IGASProgram
.advanceView
in interface IGraphAccessor
public AbstractTripleStore getKB()
RuntimeException
- if the graph could not be resolved.public String getNamespace()
public Long getTimestamp()
public Iterator<org.openrdf.model.Statement> getEdges(IGASContext<?,?,?> ctx, org.openrdf.model.Value u, EdgesEnum edges)
IGraphAccessor
getEdges
in interface IGraphAccessor
ctx
- The IGASContext
.u
- The vertex.edges
- Typesafe enumeration indicating which edges should be visited.public long getEdgeCount(IGASContext<?,?,?> ctx, org.openrdf.model.Value u, EdgesEnum edges)
IGraphAccessor
Note: This is not always a flyweight operation due to the need to filter
for only the observable edge types. If this information is required, it
may be best to cache it on the vertex state object for a given
IGASProgram
.
getEdgeCount
in interface IGraphAccessor
ctx
- The IGASContext
.u
- The vertex.edges
- Typesafe enumeration indicating which edges should be visited.public VertexDistribution getDistribution(Random r)
IGraphAccessor
getDistribution
in interface IGraphAccessor
r
- A random number generator that (a) MAY be used to select the
sample distribution (the distribution does not need to be
exhaustive so long as it obeys the sampling requirements); and
(b) WILL be used to select vertices from that distribution.This COULD be fixed if we required the implementation to put the sampled vertices into an order based on their external representation as RDF Values, but still reporting their internal since that is what is used to actually specify a starting vertex of the GAS program. However, even then, implementation specific characteristics might not provide us with the same vertices (e.g., bigdata imposes a canonical mapping on xsd:dateTime).
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.