简体   繁体   中英

How to deal with class instances in Jena?

In an ontology, suppose we have a class named "function" it has two instances "func1" and "func2" and suppose that the class has a data property "d".

My first problem is: how can I create individuals corresponding to either "func1" or "func2"?

My second problem is: In the inference, with Jena rules, I want to check if individuals created for "func1" have "d" greater than some value and if individuals created for "func2" have "d" greater than another value.

I already know how to work with classes, properties and individuals but when I got to the part having instances I got stuck.

It appears that Jena Library has no support for instances, which means that you can't use getInstance() and create individuals for that instance.

Instead of having instances func1 and func2 , you can make them as subclasses for the class function . This way, you can use getOntClass() and createIndividual() or getIndividual() as usual.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM