edgeState, vertexState
Constructor and Description |
---|
BigdataGASState(IGASEngine gasEngine,
BigdataGASEngine.BigdataGraphAccessor graphAccessor,
IStaticFrontier frontier,
IGASSchedulerImpl gasScheduler,
IGASProgram<VS,ES,ST> gasProgram) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(org.openrdf.model.Value u,
org.openrdf.model.Value v)
Return -1, o, or 1 if
u is LT, EQ, or GT v . |
org.openrdf.model.Statement |
decodeStatement(org.openrdf.model.Value v)
If the vertex is actually an edge, then return the decoded edge.
|
protected BigdataGASEngine.BigdataGraphAccessor |
getGraphAccessor()
Provides access to the backing graph.
|
org.openrdf.model.Literal |
getLinkAttr(org.openrdf.model.Value u,
org.openrdf.model.Statement e)
This will only work for the BigdataGASState.
|
org.openrdf.model.Value |
getOtherVertex(org.openrdf.model.Value u,
org.openrdf.model.Statement e)
Return the other end of a link.
|
boolean |
isAttrib(org.openrdf.model.Statement e)
Return
true iff the given Statement models an
property value for a vertex of the graph (Statement s also model
edges). |
boolean |
isEdge(org.openrdf.model.Statement e)
Return
true iff the given Statement models an edge
that connects two vertices (Statement s also model property
values). |
boolean |
isLinkAttrib(org.openrdf.model.Statement e,
org.openrdf.model.URI linkAttribType)
Return
true iff the statement models a link attribute having
the specified link type. |
String |
toString(org.openrdf.model.Statement e)
Return a useful representation of an edge (non-batch API, debug only).
|
void |
traceState()
Conditionally log various interesting information about the state of the
computation.
|
public BigdataGASState(IGASEngine gasEngine, BigdataGASEngine.BigdataGraphAccessor graphAccessor, IStaticFrontier frontier, IGASSchedulerImpl gasScheduler, IGASProgram<VS,ES,ST> gasProgram)
protected BigdataGASEngine.BigdataGraphAccessor getGraphAccessor()
GASState
GASState.traceState()
.getGraphAccessor
in class GASState<VS,ES,ST>
public void traceState()
traceState
in interface IGASState<VS,ES,ST>
traceState
in class GASState<VS,ES,ST>
public String toString(org.openrdf.model.Statement e)
IGASState
Value
s. In this case, it
will materialize the RDF Values and present a pleasant view of the edge.
The materialization step is a random access, which is why this method is
for debug only. Efficient, vectored mechanisms exist to materialize RDF
Value
s for other purposes, e.g., when exporting a set of edges as
as graph in a standard interchange syntax.public boolean isEdge(org.openrdf.model.Statement e)
true
iff the given Statement
models an edge
that connects two vertices (Statement
s also model property
values).
Note: The IV
classes sometimes implement more than one kind of
Value
. E.g., TermId
can be a BNode
, URI
,
or Literal
and implements ALL of those interfaces. So we have to
make an IV
-specific check here.
TODO This is visiting all edges, including link attributes (aka
hyperedges or statements about statements). Should we further restrict
traversal to only simple edges (by checking that the source and target
vertices are not SidIV
s).
public boolean isAttrib(org.openrdf.model.Statement e)
IGASState
true
iff the given Statement
models an
property value for a vertex of the graph (Statement
s also model
edges).public boolean isLinkAttrib(org.openrdf.model.Statement e, org.openrdf.model.URI linkAttribType)
GASState
true
iff the statement models a link attribute having
the specified link type. When this method returns true
, the
Statement.getSubject()
may be decoded to obtain the link
described by that link attribute using IGASState.decodeStatement(Value)
.
The openrdf implementation does not support link attributes and this
method always returns false
.
isLinkAttrib
in interface IGASState<VS,ES,ST>
isLinkAttrib
in class GASState<VS,ES,ST>
e
- The statement.linkAttribType
- The type for the link attribute.false
public org.openrdf.model.Statement decodeStatement(org.openrdf.model.Value v)
GASState
Note: A vertex may be an edge. A link attribute is modeled by treating the link as a vertex and then asserting a property value about that "link vertex". For bigdata, this is handled efficiently as inline statements about statements. This approach subsumes the property graph model (property graphs do not permit recursive nesting of these relationships) and is 100% consistent with RDF reification, except that the link attributes are modeled efficiently inline with the links. This is what we call Reification Done Right .
The openrdf implementation does not support link attributes and this
method always returns null
.
decodeStatement
in interface IGASState<VS,ES,ST>
decodeStatement
in class GASState<VS,ES,ST>
v
- The vertex.null
public int compareTo(org.openrdf.model.Value u, org.openrdf.model.Value v)
IGASState
u
is LT, EQ, or GT v
. A
number of GAS programs depend on the ability to place an order over the
vertex identifiers, as does 2D partitioning. The ordering provided by
this method MAY be arbitrary, but it MUST be total and stable across the
life-cycle of the GAS program evaluation.public org.openrdf.model.Value getOtherVertex(org.openrdf.model.Value u, org.openrdf.model.Statement e)
GASState
FIXME We can optimize this to use reference testing if we are careful in
the GATHER and SCATTER implementations to impose a canonical mapping over
the vertex objects for the edges that are exposed to the
IGASProgram
during a single round.
getOtherVertex
in interface IGASState<VS,ES,ST>
getOtherVertex
in class GASState<VS,ES,ST>
u
- One end of the link.e
- The link.public org.openrdf.model.Literal getLinkAttr(org.openrdf.model.Value u, org.openrdf.model.Statement e)
getLinkAttr
in interface IGASState<VS,ES,ST>
getLinkAttr
in class GASState<VS,ES,ST>
u
- One end of the link.e
- The link.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.