Class StatementValueObject
- All Implemented Interfaces:
Serializable, Comparable<StatementValueObject>, Identifiable
Statement, typically part of a FactorValueBasicValueObject.
The REST representation was settled by #814,
closed in dff752727c: the predicate* / object* slots are public, and a
compound statement's second clause reaches clients flattened by
AbstractFactorValueValueObjectSerializer rather than through the second* fields —
see those fields for why they stay off the wire. This javadoc previously said the question was
still open; it has not been since November 2023.
- Author:
- poirigui
- See Also:
-
Field Summary
Fields inherited from class IdentifiableValueObject
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintcompareTo(StatementValueObject other) booleanA unique ontology identifier (i.e.The predicate and object halves are absent rather than null when nothing was said.The second clause of a compound statement (e.g.A unique ontology identifier (i.e.com.fasterxml.jackson.databind.JsonNodeVerbatim provenance backing this statement — a JSON array of{quote, source, location, …}items the curation agents emitted.inthashCode()voidsetCategory(String category) voidsetCategoryUri(String categoryUri) voidsetEvidenceCode(String evidenceCode) voidvoidsetObjectId(String objectId) A unique ontology identifier (i.e.voidsetObjectUri(String objectUri) voidsetPredicate(String predicate) The predicate and object halves are absent rather than null when nothing was said.voidsetPredicateUri(String predicateUri) voidsetSecondObject(String secondObject) voidsetSecondObjectUri(String secondObjectUri) voidsetSecondPredicate(String secondPredicate) The second clause of a compound statement (e.g.voidsetSecondPredicateUri(String secondPredicateUri) voidsetSubject(String subject) voidsetSubjectId(String subjectId) A unique ontology identifier (i.e.voidsetSubjectUri(String subjectUri) voidsetSupportingEvidence(com.fasterxml.jackson.databind.JsonNode supportingEvidence) Verbatim provenance backing this statement — a JSON array of{quote, source, location, …}items the curation agents emitted.toString()Methods inherited from class IdentifiableValueObject
getId, setId
-
Constructor Details
-
StatementValueObject
public StatementValueObject() -
StatementValueObject
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<StatementValueObject>
-
getCategory
-
getCategoryUri
-
getSubject
-
getSubjectUri
-
getPredicate
The predicate and object halves are absent rather than null when nothing was said.This is the rule
AbstractFactorValueValueObjectSerializer#writeStatementalready applies when it emits the same VO by hand on the factor-value path — "null reads as 'this was cleared', and a subject-only statement has nothing to clear" — and these four annotations make the bean path agree with it. Before, the two serializations of one type disagreed about the commonest statement there is.The subject and category halves keep their nulls, on the same serializer's reasoning: they describe a term that IS there, and
subjectUri: nullsays it is ungrounded.Measured on
GET /datasets/3937/samples:predicate,predicateUri,object,objectUri,objectId,subjectIdandidwere null on all 5,291 statements in the response, costing 587,301 of 5,265,852 bytes — 11.2% — to say nothing seven times over. -
getPredicateUri
-
getObject
-
getObjectUri
-
getSecondPredicate
The second clause of a compound statement (e.g. the"for 12 weeks"of"HFD for 12 weeks").These four are withheld because
AbstractFactorValueValueObjectSerializeralready puts them on the wire, flattened: a statement with a second object is emitted as two entries in thestatementsarray sharing one subject, the second carrying this clause under the genericpredicate/objectkeys. Serializing the raw fields as well would publish the same clause twice under two names. That flattening arrived with the fields' exposure indff752727c("Serialize statements", fix #814), which is why the first four slots are public here and these are not.AnnotationValueObjectexposes its ownsecond*fields directly, and that is not an inconsistency: it is serialized as a plain bean with no flattener, so direct fields are the only way to carry the compound shape there. -
getSecondPredicateUri
-
getSecondObject
-
getSecondObjectUri
-
getSubjectId
A unique ontology identifier (i.e. IRI) for this subject.Assigned by
AbstractFactorValueValueObjectSerializer, which is the only thing that populates it; nothing sets it on the bean path, so it is null on every statementGET /datasets/{id}/samplesreturns. Absent rather than null for that reason. -
getObjectId
A unique ontology identifier (i.e. IRI) for this object. Assigned and omitted on the same terms assubjectId. -
getSupportingEvidence
@Nullable public com.fasterxml.jackson.databind.JsonNode getSupportingEvidence()Verbatim provenance backing this statement — a JSON array of{quote, source, location, …}items the curation agents emitted. Gemma stores and serves it opaquely; the agents repo owns the schema.A
Statementis aCharacteristic, so the storage (theSUPPORTING_EVIDENCEcolumn) has always existed — it was simply never surfaced here, which left the design read path unable to answer "where did this factor value's term come from" even for rows that recorded it. Null means "nothing recorded", the expected reading for most rows.Provenance rather than identity, so it is excluded from equals/hashCode and from
COMPARATOR: the same statement with and without recorded evidence is the same statement, and the comparator's ordering is relied upon to assign annotation ids. -
getEvidenceCode
How this statement was arrived at, as aGOEvidenceCodename (IC,IEA,IIA,TAS, …). The uppercase enum name is the wire form this field carries everywhere it appears —AnnotationValueObject#evidenceCodeandPublicationAssociationValueObject#evidenceCodespell it the same way.Storage is the
EVIDENCE_CODEcolumnStatementinherits fromCharacteristic; likesupportingEvidenceit was never surfaced here, so a design write could not say who decided and a design read could not tell a curator's call from a program's.Provenance rather than identity, so it is excluded from equals/hashCode and from
COMPARATORfor the same reasonsupportingEvidenceis: the comparator's ordering assigns annotation ids. -
setCategory
-
setCategoryUri
-
setSubject
-
setSubjectUri
-
setPredicate
The predicate and object halves are absent rather than null when nothing was said.This is the rule
AbstractFactorValueValueObjectSerializer#writeStatementalready applies when it emits the same VO by hand on the factor-value path — "null reads as 'this was cleared', and a subject-only statement has nothing to clear" — and these four annotations make the bean path agree with it. Before, the two serializations of one type disagreed about the commonest statement there is.The subject and category halves keep their nulls, on the same serializer's reasoning: they describe a term that IS there, and
subjectUri: nullsays it is ungrounded.Measured on
GET /datasets/3937/samples:predicate,predicateUri,object,objectUri,objectId,subjectIdandidwere null on all 5,291 statements in the response, costing 587,301 of 5,265,852 bytes — 11.2% — to say nothing seven times over. -
setPredicateUri
-
setObject
-
setObjectUri
-
setSecondPredicate
The second clause of a compound statement (e.g. the"for 12 weeks"of"HFD for 12 weeks").These four are withheld because
AbstractFactorValueValueObjectSerializeralready puts them on the wire, flattened: a statement with a second object is emitted as two entries in thestatementsarray sharing one subject, the second carrying this clause under the genericpredicate/objectkeys. Serializing the raw fields as well would publish the same clause twice under two names. That flattening arrived with the fields' exposure indff752727c("Serialize statements", fix #814), which is why the first four slots are public here and these are not.AnnotationValueObjectexposes its ownsecond*fields directly, and that is not an inconsistency: it is serialized as a plain bean with no flattener, so direct fields are the only way to carry the compound shape there. -
setSecondPredicateUri
-
setSecondObject
-
setSecondObjectUri
-
setSubjectId
A unique ontology identifier (i.e. IRI) for this subject.Assigned by
AbstractFactorValueValueObjectSerializer, which is the only thing that populates it; nothing sets it on the bean path, so it is null on every statementGET /datasets/{id}/samplesreturns. Absent rather than null for that reason. -
setObjectId
A unique ontology identifier (i.e. IRI) for this object. Assigned and omitted on the same terms assubjectId. -
setSupportingEvidence
public void setSupportingEvidence(@Nullable com.fasterxml.jackson.databind.JsonNode supportingEvidence) Verbatim provenance backing this statement — a JSON array of{quote, source, location, …}items the curation agents emitted. Gemma stores and serves it opaquely; the agents repo owns the schema.A
Statementis aCharacteristic, so the storage (theSUPPORTING_EVIDENCEcolumn) has always existed — it was simply never surfaced here, which left the design read path unable to answer "where did this factor value's term come from" even for rows that recorded it. Null means "nothing recorded", the expected reading for most rows.Provenance rather than identity, so it is excluded from equals/hashCode and from
COMPARATOR: the same statement with and without recorded evidence is the same statement, and the comparator's ordering is relied upon to assign annotation ids. -
setEvidenceCode
How this statement was arrived at, as aGOEvidenceCodename (IC,IEA,IIA,TAS, …). The uppercase enum name is the wire form this field carries everywhere it appears —AnnotationValueObject#evidenceCodeandPublicationAssociationValueObject#evidenceCodespell it the same way.Storage is the
EVIDENCE_CODEcolumnStatementinherits fromCharacteristic; likesupportingEvidenceit was never surfaced here, so a design write could not say who decided and a design read could not tell a curator's call from a program's.Provenance rather than identity, so it is excluded from equals/hashCode and from
COMPARATORfor the same reasonsupportingEvidenceis: the comparator's ordering assigns annotation ids. -
toString
- Overrides:
toStringin classIdentifiableValueObject<Statement>
-
equals
- Overrides:
equalsin classIdentifiableValueObject<Statement>
-
canEqual
- Overrides:
canEqualin classIdentifiableValueObject<Statement>
-
hashCode
public int hashCode()- Overrides:
hashCodein classIdentifiableValueObject<Statement>
-