public static class SAILGASEngine.SAILGraphAccessor extends Object implements IGraphAccessor
Constructor and Description |
---|
SAILGASEngine.SAILGraphAccessor(org.openrdf.sail.SailConnection cxn) |
SAILGASEngine.SAILGraphAccessor(org.openrdf.sail.SailConnection cxn,
boolean includeInferred,
org.openrdf.model.Resource... defaultContext) |
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<?,?,?> p,
org.openrdf.model.Value u,
EdgesEnum edges)
Return the edges for the given vertex.
|
public SAILGASEngine.SAILGraphAccessor(org.openrdf.sail.SailConnection cxn)
public SAILGASEngine.SAILGraphAccessor(org.openrdf.sail.SailConnection cxn, boolean includeInferred, org.openrdf.model.Resource... defaultContext)
cxn
- The connection.includeInferred
- When true
, inferred triples will be visited
as well as explicit triples.defaultContext
- The default context(s) for the operation (optional).public void advanceView()
IGraphAccessor
IGASProgram
.advanceView
in interface IGraphAccessor
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 Iterator<org.openrdf.model.Statement> getEdges(IGASContext<?,?,?> p, org.openrdf.model.Value u, EdgesEnum edges)
IGraphAccessor
getEdges
in interface IGraphAccessor
p
- 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.