|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.model.BigdataStatementImpl
public class BigdataStatementImpl
Implementation reveals whether a statement is explicit, inferred, or an axiom
and the internal term identifiers for the subject, predicate, object, the
context bound on that statement (when present). When statement identifiers
are enabled, the context position (if bound) will be a blank node that
represents the statement having that subject, predicate, and object and its
term identifier, when assigned, will report 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.
| Field Summary | |
|---|---|
protected BigdataResource |
c
|
protected BigdataValue |
o
|
protected BigdataURI |
p
|
protected BigdataResource |
s
|
| Constructor Summary | |
|---|---|
BigdataStatementImpl(BigdataResource subject,
BigdataURI predicate,
BigdataValue object,
BigdataResource context,
StatementEnum type,
boolean userFlag)
Used by BigdataValueFactory |
|
| Method Summary | |
|---|---|
IV |
c()
The term identifier for the SID/context position (slot 3) -or- #NULL. |
boolean |
equals(Object o)
|
boolean |
equals(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()
Whether the statement is StatementEnum.Explicit,
StatementEnum.Inferred or an StatementEnum.Axiom. |
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()
true IFF AbstractTripleStore#isStatement(IV)
returns true for ISPO.c(). |
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 |
setStatementIdentifier(boolean sidable)
Mark whether or not the SPO will permit the statement identifier
to be lazily materialized (default false). |
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
Values are already resolved. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final BigdataResource s
protected final BigdataURI p
protected final BigdataValue o
protected final BigdataResource c
| Constructor Detail |
|---|
public BigdataStatementImpl(BigdataResource subject,
BigdataURI predicate,
BigdataValue object,
BigdataResource context,
StatementEnum type,
boolean userFlag)
BigdataValueFactory
| Method Detail |
|---|
public final BigdataResource getSubject()
BigdataStatement
getSubject in interface BigdataStatementgetSubject in interface Statementpublic final BigdataURI getPredicate()
BigdataStatement
getPredicate in interface BigdataStatementgetPredicate in interface Statementpublic final BigdataValue getObject()
BigdataStatement
getObject in interface BigdataStatementgetObject in interface Statementpublic final BigdataResource getContext()
BigdataStatement
getContext in interface BigdataStatementgetContext in interface Statementpublic final boolean hasStatementType()
ISPOtrue iff the statement type is known.
true iff the statement type is known for this statement.
hasStatementType in interface ISPOpublic final StatementEnum getStatementType()
ISPOStatementEnum.Explicit,
StatementEnum.Inferred or an StatementEnum.Axiom.
getStatementType in interface ISPOStatementEnum type -or- null if the
statement type has not been specified.public final void setStatementType(StatementEnum type)
ISPO
setStatementType in interface ISPOtype - The statement type.public final void setUserFlag(boolean userFlag)
ISPOSPO user flag
setUserFlag in interface ISPOpublic final boolean isAxiom()
BigdataStatementtrue if the statement is an axiom that is not present as
an explicit assertion.
isAxiom in interface BigdataStatementisAxiom in interface ISPOpublic final boolean isInferred()
BigdataStatementtrue if the statement is an inference that is not present
as an explicit assertion or an axiom.
isInferred in interface BigdataStatementisInferred in interface ISPOpublic final boolean isExplicit()
BigdataStatementtrue if the statement is an explicit assertion.
isExplicit in interface BigdataStatementisExplicit in interface ISPOpublic final boolean getUserFlag()
ISPOtrue IFF the SPO user flag is set
getUserFlag in interface ISPOpublic boolean equals(Object o)
equals in interface Statementequals in class Objectpublic boolean equals(Statement stmt)
Statement interface, which specifies
that only the (s,p,o) positions are to be considered.
public final int hashCode()
hashCode in interface StatementhashCode in class Objectpublic String toString()
toString in class Objectpublic final IV s()
ISPO#NULL.
s in interface ISPOpublic final IV p()
ISPO#NULL.
p in interface ISPOpublic final IV o()
ISPO#NULL.
o in interface ISPOpublic 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.
c in interface ISPOAbstractTripleStore.Options#STATEMENT_IDENTIFIERS,
AbstractTripleStore.Options#QUADSpublic IV get(int index)
ISPO
get in interface IElementget in interface ISPOindex - The legal values are: s=0, p=1, o=2, c=3.
public final boolean isFullyBound()
ISPO#NULL.
Note: SPOs 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: BigdataStatements 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 ISPOpublic final void setStatementIdentifier(boolean sidable)
ISPOSPO will permit the statement identifier
to be lazily materialized (default false).
setStatementIdentifier in interface ISPOpublic final IV getStatementIdentifier()
ISPOISPO.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 ISPOpublic final boolean hasStatementIdentifier()
ISPOtrue IFF AbstractTripleStore#isStatement(IV)
returns true for ISPO.c().
hasStatementIdentifier in interface ISPOpublic final boolean isOverride()
ISPOtrue 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 ISPOpublic final void setOverride(boolean override)
ISPO
setOverride in interface ISPOoverride - the new value.public String toString(IRawTripleStore storeIsIgnored)
toString() since the
Values are already resolved.
toString in interface ISPOstoreIsIgnored - The database whose lexicon will be used.public boolean isModified()
isModified in interface ISPOpublic void setModified(ModifiedEnum modified)
ISPOStatementEnum in the database updated.
setModified in interface ISPOpublic ModifiedEnum getModified()
ISPOStatementEnum in the database updated.
getModified in interface ISPO
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||