public class BigdataStatementImpl extends Object implements BigdataStatement
true
for
AbstractTripleStore#isStatement(IV)
. When used to model a quad, the
4th position will be a BigdataValue
but its term identifier will
report false
for AbstractTripleStore#isStatement(IV)
.
Note: The ctors are intentionally protected. Use the
BigdataValueFactory
to create instances of this class - it will
ensure that term identifiers are propagated iff the backing lexicon is the
same.
Constructor and Description |
---|
BigdataStatementImpl(BigdataResource subject,
BigdataURI predicate,
BigdataValue object,
BigdataResource context,
StatementEnum type,
boolean userFlag)
Used by
BigdataValueFactory |
Modifier and Type | Method and Description |
---|---|
IV |
c()
The term identifier for the SID/context position (slot 3) -or-
#NULL . |
boolean |
equals(Object o) |
boolean |
equals(org.openrdf.model.Statement stmt)
Note: implementation per
Statement interface, which specifies
that only the (s,p,o) positions are to be considered. |
IV |
get(int index)
Return the s,p,o, or c value corresponding to the given index.
|
BigdataResource |
getContext()
Specialized return type.
|
ModifiedEnum |
getModified()
Return the state of the transient modified flag.
|
BigdataValue |
getObject()
Specialized return type.
|
BigdataURI |
getPredicate()
Specialized return type.
|
IV |
getStatementIdentifier()
The statement identifier (optional).
|
StatementEnum |
getStatementType()
|
BigdataResource |
getSubject()
Specialized return type.
|
boolean |
getUserFlag()
Return
true IFF the SPO user flag is set |
int |
hashCode()
Note: implementation per Statement interface, which does not consider the
context position.
|
boolean |
hasStatementIdentifier()
|
boolean |
hasStatementType()
Return
true iff the statement type is known. |
boolean |
isAxiom()
true if the statement is an axiom that is not present as
an explicit assertion. |
boolean |
isExplicit()
true if the statement is an explicit assertion. |
boolean |
isFullyBound()
Return true iff all position (s,p,o) are non-
#NULL . |
boolean |
isInferred()
true if the statement is an inference that is not present
as an explicit assertion or an axiom. |
boolean |
isModified() |
boolean |
isOverride()
When
true the statement will be written onto the database
with exactly its current ISPO.getStatementType() (default
false ). |
IV |
o()
The term identifier for the object position (slot 2) -or-
#NULL . |
IV |
p()
The term identifier for the predicate position (slot 1) -or-
#NULL . |
IV |
s()
The term identifier for the subject position (slot 0) -or-
#NULL . |
void |
setModified(ModifiedEnum modified)
Set a transient flag indicating whether or not the persistent state of
the statement was modified when it was last written onto the database.
|
void |
setOverride(boolean override)
Set the override flag.
|
void |
setStatementType(StatementEnum type)
Set the statement type for this statement.
|
void |
setUserFlag(boolean userFlag)
Set
SPO user flag |
String |
toString() |
String |
toString(IRawTripleStore storeIsIgnored)
Note: this implementation is equivalent to
toString() since the
Value s are already resolved. |
public BigdataStatementImpl(BigdataResource subject, BigdataURI predicate, BigdataValue object, BigdataResource context, StatementEnum type, boolean userFlag)
BigdataValueFactory
public final BigdataResource getSubject()
BigdataStatement
getSubject
in interface BigdataStatement
getSubject
in interface org.openrdf.model.Statement
public final BigdataURI getPredicate()
BigdataStatement
getPredicate
in interface BigdataStatement
getPredicate
in interface org.openrdf.model.Statement
public final BigdataValue getObject()
BigdataStatement
getObject
in interface BigdataStatement
getObject
in interface org.openrdf.model.Statement
public final BigdataResource getContext()
BigdataStatement
getContext
in interface BigdataStatement
getContext
in interface org.openrdf.model.Statement
public final boolean hasStatementType()
ISPO
true
iff the statement type is known.
true
iff the statement type is known for this statement.hasStatementType
in interface ISPO
public final StatementEnum getStatementType()
ISPO
getStatementType
in interface ISPO
StatementEnum
type -or- null
if the
statement type has not been specified.public final void setStatementType(StatementEnum type)
ISPO
setStatementType
in interface ISPO
type
- The statement type.public final void setUserFlag(boolean userFlag)
ISPO
SPO
user flagsetUserFlag
in interface ISPO
public final boolean isAxiom()
BigdataStatement
true
if the statement is an axiom that is not present as
an explicit assertion.isAxiom
in interface BigdataStatement
isAxiom
in interface ISPO
public final boolean isInferred()
BigdataStatement
true
if the statement is an inference that is not present
as an explicit assertion or an axiom.isInferred
in interface BigdataStatement
isInferred
in interface ISPO
public final boolean isExplicit()
BigdataStatement
true
if the statement is an explicit assertion.isExplicit
in interface BigdataStatement
isExplicit
in interface ISPO
public final boolean getUserFlag()
ISPO
true
IFF the SPO
user flag is setgetUserFlag
in interface ISPO
public boolean equals(Object o)
public boolean equals(org.openrdf.model.Statement stmt)
Statement
interface, which specifies
that only the (s,p,o) positions are to be considered.public final int hashCode()
public final IV s()
ISPO
#NULL
.public final IV p()
ISPO
#NULL
.public final IV o()
ISPO
#NULL
.public final IV c()
ISPO
#NULL
. The semantics of the returned value depend on the database
mode. For triples, it is unused. For triples+SIDs, it is the statement
identifier as assigned by the lexicon. For quads, it is the context (aka
named graph) and #NULL
iff the context was not bound.public IV get(int index)
ISPO
public final boolean isFullyBound()
ISPO
#NULL
.
Note: SPO
s are sometimes used to represent triple patterns, e.g.,
in the tail of a Justification
. This method will return
true
if the "triple pattern" is fully bound and
false
if there are any unbound positions.
Note: BigdataStatement
s are not fully bound when they are
instantiated during parsing until their term identifiers have been
resolved against a database's lexicon.
isFullyBound
in interface ISPO
public final IV getStatementIdentifier()
ISPO
ISPO.c()
, but will throw an exception if the 4th position is not
bound.
Statement identifiers are a unique per-triple identifier assigned when a
statement is first asserted against the database and are are defined iff
AbstractTripleStore.Options#STATEMENT_IDENTIFIERS
was specified.
getStatementIdentifier
in interface ISPO
public final boolean hasStatementIdentifier()
ISPO
hasStatementIdentifier
in interface ISPO
public final boolean isOverride()
ISPO
true
the statement will be written onto the database
with exactly its current ISPO.getStatementType()
(default
false
).
Note: This feature is used by TruthMaintenance
when we need to
downgrade an ISPO
from "Explicit" to "Inferred". Normally, a
statement is automatically upgraded from "Inferred" to "Explicit" so
without ISPO.setOverride(boolean)
you could not downgrade the
StatementEnum
in the database without first deleting the
statement (which would also delete its justifications).
isOverride
in interface ISPO
public final void setOverride(boolean override)
ISPO
setOverride
in interface ISPO
override
- the new value.public String toString(IRawTripleStore storeIsIgnored)
toString()
since the
Value
s are already resolved.public boolean isModified()
isModified
in interface ISPO
public void setModified(ModifiedEnum modified)
ISPO
StatementEnum
in the database updated.setModified
in interface ISPO
public ModifiedEnum getModified()
ISPO
StatementEnum
in the database updated.getModified
in interface ISPO
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.