public abstract class Triple extends java.lang.Object implements java.lang.Comparable<Triple>
A triple consists of a subject that is an item, a verb that is also an item, and an object that is a Datum. A Datum may be an item or a data value that is a boolean, an integer, a real number, a piece of text, or a sequence of bytes.
A triple is held in the same source as its subject, and has its own numeric identifier in that source.
Access to a triple is determined by the access levels of its subject, its verb, and its object if that is an item.
Objects that are pieces of text or sequences of bytes can be of arbitrary size. Non-item triples contain summaries of their objects, rather than the objects themselves. Searches in the triple store first find triples with objects whose summaries match the criteria. These objects are then retrieved from the sources to determine whether they match. Objects whose summaries do not meet the criteria are not retrieved.
For triples with objects that are booleans, integers, or real numbers, the value of the object can be determined from its summary. For triples with objects that are items, the object is stored in the triple. It is only text and binary objects that need to be retrieved from the sources.
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Triple t) |
boolean |
equals(java.lang.Object o) |
Id |
getId()
Get the triple's identifier
|
Datum |
getObject(StoreSession session)
Get the triple's object
|
abstract long |
getObjectSummaryValue()
Get the object's summary value.
|
Datum.Type |
getObjectType()
Get the triple's object type
|
abstract long |
getSourceNr()
Get the numeric identifier of triple's source
|
Item |
getSubject()
Get the triple's subject
|
Id |
getSubjectId()
Get the triple's subject identifier
|
long |
getTripleNr()
Get the numeric identifier of the triple in its source
|
Item |
getVerb()
Get the triple's verb
|
Id |
getVerbId()
Get the triple's verb identifier
|
public abstract long getSourceNr()
public long getTripleNr()
public Id getId()
public Id getSubjectId()
public Item getSubject()
public Id getVerbId()
public Item getVerb()
public Datum.Type getObjectType()
public abstract long getObjectSummaryValue()
public Datum getObject(StoreSession session) throws TripleStoreNonFatalException, TripleStoreFatalException, SourceConnectorException, NotInOperationException
session
- the session requesting the operation.
It must have read access to the subject and verb,
and to the object if this is an item.TripleStoreNonFatalException
TripleStoreFatalException
SourceConnectorException
NotInOperationException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object