简体   繁体   中英

Reasoning over an ontology in jena

I am new in the field of ontologies and reasoning in Jena and I am in desperate need for help to get the logic of how to do the following. I am building and owl ontology with the following classes:

-A person hasInterests Interests - A person hasMessage Message - A message hasCategory Category ( or subclass of message) - A message can be spam or ham ( subclasses of message)

I want to say if the message's category is the same as the person's interests then the message is ham

Q1: I wanted to build the ontology such that the reasoner would infer this so I thought of defining ham as an intersection of class category and interests and that spam is complemet to this intersection class . Is this applicable using a reasoner or shall I need SPARQL queries

Q2:How to create individuals and do the following inference :

  • hana is a person
  • message1 is a message
  • sports is a category
  • movies is an interest

how to infer that since the sport is not equal to movies then message1 is spam.

I am in desperate need to be directed how to implement this and what exactly to refer to to do so for my masters thesis

The easiest way of doing so (I'm a newbie, but I just succeeded to make inference in ontologies x_x), is by creating your ontology with Protégé and thinking about the concepts you want to link... You have categories and interests that are pretty abstract, compared to message and person. You have to think about how to link them, and to which classes they belong. Concrete vs Abstract... Objects vs LivingBeing... Animals vs Plants... It's an example.

When you are okay with these, you can implement them with Protégé (as it's a graphical tool, it's easier at the beginning) : check the "Entities" tab, and the "Classes" subtab. Then, you put rules and properties. (the hardest part) Typically, what is concrete is NOT abstract... so you have to disjoint the two within their properties. And if you expect some relations to make a "real" ontology, you have to define your own properties (a person can "own" objects, for example... but an object does not "owns" a person).

When you have your basic ontology builded. You have to check if some inferences can be done (search within protégé the "reasoner" menu, and activate one of them, and synchronise it regularly).

Finally, you can add individuals inside, and fill their properties (search for a subtab named "Individuals").

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