I have instance1
of class1
and instance2
of class2
. Also I have defined HasName(object property)
in my ontology. Now, how can I add the triple (instance1 HasName instance2
) to my ontology by jena?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
In Jena, this can be done by creating an instance of a Statement (a triple, or quad), then committing the statement to an instance of a Model.
For example, consider the following:
Where
subject
,predicate
andobject
are instance elements of your triple with types conforming to the interface for ResourceFactory.createStatement().Here's a way without dealing with intermediate
Statements
.You could also chain some of these calls in a builder-ish pattern.