Package ai.chatur.cortex
Record Class ProvenancedStatement
java.lang.Object
java.lang.Record
ai.chatur.cortex.ProvenancedStatement
- Record Components:
predicate- the property of the statementobject- the value of the statementcreated- when the statement was approved into the knowledge graph, ornullfor statements without recorded provenance (those whose origin isStatementOrigin.ONTOLOGYorStatementOrigin.INFERRED)origin- where the statement came fromliteral- whether the object is a literaldatatype- the datatype IRI of a literal object, ornullfor a resourcelanguage- the language tag of a language-tagged literal object, ornullfor a resource or a literal without one
public record ProvenancedStatement(Term predicate, Term object, String created, StatementOrigin origin, boolean literal, String datatype, String language)
extends Record
A statement about a resource together with its provenance, as returned by
CortexQuery.describe(String).
predicate and object carry the display form; literal,
datatype, and language carry what Term cannot, so that a statement whose origin
is StatementOrigin.ASSERTED can be round-tripped back to RDF as a BranchChange.
They mirror BranchStatement, which exists for the same reason on the branch side.
-
Constructor Summary
ConstructorsConstructorDescriptionProvenancedStatement(Term predicate, Term object, String created, StatementOrigin origin, boolean literal, String datatype, String language) Creates an instance of aProvenancedStatementrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncreated()Returns the value of thecreatedrecord component.datatype()Returns the value of thedatatyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.language()Returns the value of thelanguagerecord component.booleanliteral()Returns the value of theliteralrecord component.object()Returns the value of theobjectrecord component.origin()Returns the value of theoriginrecord component.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ProvenancedStatement
public ProvenancedStatement(Term predicate, Term object, String created, StatementOrigin origin, boolean literal, String datatype, String language) Creates an instance of aProvenancedStatementrecord class.- Parameters:
predicate- the value for thepredicaterecord componentobject- the value for theobjectrecord componentcreated- the value for thecreatedrecord componentorigin- the value for theoriginrecord componentliteral- the value for theliteralrecord componentdatatype- the value for thedatatyperecord componentlanguage- the value for thelanguagerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
object
Returns the value of theobjectrecord component.- Returns:
- the value of the
objectrecord component
-
created
Returns the value of thecreatedrecord component.- Returns:
- the value of the
createdrecord component
-
origin
Returns the value of theoriginrecord component.- Returns:
- the value of the
originrecord component
-
literal
public boolean literal()Returns the value of theliteralrecord component.- Returns:
- the value of the
literalrecord component
-
datatype
Returns the value of thedatatyperecord component.- Returns:
- the value of the
datatyperecord component
-
language
Returns the value of thelanguagerecord component.- Returns:
- the value of the
languagerecord component
-