public interface ISPO extends IElement, org.openrdf.model.Statement
long
term
identifiers assigned by a lexicon. The 4th position is either unused
(triples), the statement identifier (triples with the provenance mode
enabled), or the context/named graph position of a quad. This interface
treats all four positions as "data" and requires the caller to be aware of
the database mode (triples, triples+SIDs, or quads). The (s,p,o) of the
interface are immutable. The (c) position is mutable because its value is not
knowable until after the other three values have been bound in the
triples+SIDs database mode. When using this interface for a quads mode
database, the context position SHOULD be set by the appropriate constructor
and NOT modified thereafter.
Two additional data are carried by this interface for use with inference and
truth maintenance. First, this interface may also carry an indication of
whether the triple/quad is an explicit statement, an inferred statement or an
axiom. Second, the isOverride()
flag is used during truth
maintenance when an explicit statement is retracted and we need to downgrade
the statement in the database to an inference because it is still provable by
other statements in the knowledge base.
Modifier and Type | Method and Description |
---|---|
IV |
c()
The term identifier for the SID/context position (slot 3) -or-
#NULL . |
IV |
get(int index)
Return the s,p,o, or c value corresponding to the given index.
|
ModifiedEnum |
getModified()
Return the state of the transient modified flag.
|
IV |
getStatementIdentifier()
The statement identifier (optional).
|
StatementEnum |
getStatementType()
|
boolean |
getUserFlag()
Return
true IFF the SPO user flag is set |
boolean |
hasStatementIdentifier()
|
boolean |
hasStatementType()
Return
true iff the statement type is known. |
boolean |
isAxiom()
|
boolean |
isExplicit()
|
boolean |
isFullyBound()
Return true iff all position (s,p,o) are non-
#NULL . |
boolean |
isInferred()
|
boolean |
isModified() |
boolean |
isOverride()
When
true the statement will be written onto the database
with exactly its current 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(IRawTripleStore db)
Method may be used to externalize the
BigdataValue s in the
ISPO . |
IV s()
#NULL
.IV p()
#NULL
.IV o()
#NULL
.IV c()
#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.AbstractTripleStore.Options#STATEMENT_IDENTIFIERS
,
AbstractTripleStore.Options#QUADS
IV get(int index)
boolean isFullyBound()
#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.
StatementEnum getStatementType()
StatementEnum
type -or- null
if the
statement type has not been specified.void setStatementType(StatementEnum type)
type
- The statement type.IllegalArgumentException
- if type is null
.IllegalStateException
- if the statement type is already set to a different non-
null
value.boolean hasStatementType()
true
iff the statement type is known.
true
iff the statement type is known for this statement.boolean isExplicit()
boolean getUserFlag()
true
IFF the SPO
user flag is setvoid setUserFlag(boolean userFlag)
SPO
user flaguserFlag
- boolean isInferred()
boolean isAxiom()
IV getStatementIdentifier()
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.
IllegalStateException
- unless a statement identifier is assigned to this
ISPO
.boolean hasStatementIdentifier()
void setOverride(boolean override)
override
- the new value.boolean isOverride()
true
the statement will be written onto the database
with exactly its current 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 setOverride(boolean)
you could not downgrade the
StatementEnum
in the database without first deleting the
statement (which would also delete its justifications).
void setModified(ModifiedEnum modified)
StatementEnum
in the database updated.ModifiedEnum getModified()
StatementEnum
in the database updated.boolean isModified()
String toString(IRawTripleStore db)
BigdataValue
s in the
ISPO
.db
- The database whose lexicon will be used.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.