How to create multiple relations with same object property? - ontology

I am using protege 5 for developing ontology. I have created has_composition as object property. In my ontology the same object_property is used for different domains and their respective range, like has_composition of A is B and has_composition of C and D is E and F.
How can I model this mapping??

OWL (Ontology Web Language, the ontology that defines ontologies) does not allow to model what you're trying to do.
A workaround I can think of is to use sub-properties. Imagine the following classes:
Pizza
TomatoSauce
ChocolateCake
Chocolate
If you want to define relations such as
A Pizza has_composition TomatoSauce, and
A ChocolateCake has_composition Chocolate
then define the following relations:
has_composition: No domain nor range (or a common superclass such as Dish and Ingredient for example)
has_tomato_sauce: Domain Pizza, range TomatoSauce
has_chocolate: Domain ChocolateCake, range Chocolate
This will allow the reasoner (the software that computes inferences) to infer that if something has_chocolate a_chocolate, then
something rdf:type Chocolate (inferred by the domain of has_chocolate);
something has_composition a_chocolate (because has_chocolate is a sub-property of has_composition).
You can check out this example in this Gist I made.
Download it, open it, and start the reasoner. You will see the inferred statements in yellow.

Related

How to force a class to have exactly one of a given property

I have a class Person, and a set of data properties: First_Name, Surname, Gender, DoB, Country_of_Birth. The data properties have their Domains set to Person. What i would like to set up in my ontology is a rule which states that every Person must have exactly 1 of each of these properties.
So in Protege, I set up Person as a subclass of "First_Name exactly 1 xsd:string", "Surname exactly 1 xsd:string" and so on. I then set up an Individual with a Surname, but no First_Name, Gender etc.
I then run the reasoner. What I would expect is for it to throw a fit about inconsistency (Surname is being assigned to an individual which does not conform to the requirements to be a Person) but no, the reasoner infers that the Individual is a Person despite the fact that it does not have the required properties.
Is this proper behaviour? How do I make the ontology behave in the way that I want it to? Because what I want is for the ontology to be robust against incomplete data (so you can't add a person with no name, for example).
Yes, that is proper behavior due to Protege using the open world assumption rather than the closed world assumption of for example relational databases. Under the open world assumption nothing can be assumed that is not stated explicitly or can be derived from explicitly known information. When you create an individual (possibly of type Person) for which you assigned no First_Name, under the open world assumption the reasoner merely assumes that the First_Name is not known, not that it does not exist (as is the case for the closed world assumption). Hence, the reason why the reasoner gives no inconsistency even though it infers that the individual must be of type Person. To get an inconsistency you have to state that it is known that the individual is both a Person and does not have a First_Name. This can be achieved for an individual john by asserting:
john Type Person
john Type First_Name max 0 xsd:string

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").

Is it possible to have a specialization in EER Model that is purely attribute/condition defined

In EER modelling is it possible and correct to have a disjoint specialization where none of the sub-classes have any specific attributes(local to them) but are entirely grouped on the basis of a defining attribute.For example we can have a USER entity with some attributes of which one is "role".Based on value of role(admin or author or editor) we will have the subclass entities ADMIN ,AUTHOR and EDITOR.None of them has any attributed which are only specific to them.Also please note that the specialization is disjoint and the superclass entity USER has total participation.
And if this is possible, can I convert it to relational model by creating a single relation for the superclass entity USER
Yes, it's possible and valid to do so if you want to record relationships that are restricted to the subtypes. If you don't have subtype-specific attributes or relationships, there's no point in distinguishing subtypes in the ER model. A simple role attribute on the User is sufficient for queries.
If you define subtypes in the ER model, this converts to a relation per subtype in the relational model. If you're looking for something like dependent types, you won't find it in the relational model, which corresponds to first-order logic. ER is even more limited.

OWL Ontology (giving property restrictions)

I am currently working on the OWL Ontology I have a question in regard to property.
To be frankly saying, I don't really see the importance of giving a property restriction to class.
For example,
Product (class) has manufacturer (property) some Manufacturer.
In this case this means that one product has at least one manufacturer.
However, then why not just do object property assertions by
a plastic model (an individual of the product) has manufacturer (object property) DOCOMO (an instance of the manufacturer) ?
Do I have to do both? enve if I don't do the first thing, the reasoner says there is no problem. Why Do i have to do both?
Property restriction asserts something about a set of individuals, not just a single individual. Consider the property restriction:
Every man likes a woman. (i.e. "man subClassOf like some woman")
vs the property assertion:
John likes Mary. (i.e. "{John} subClassOf like some {Mary}")
where {John} and {Mary} are classes with a single individual, but man and woman are classes with 0 or more individuals.

Problem in understanding some aspects of "The Pizza Ontology "

I am now reading the guide to building ontology using Protege tutorial that deals with the famous Pizza example. There are two thing that I don't understand in particular.
Shouldn't American/AmericanHot/Margherita/Soho(and all sublclasses mentioned inside the NamedPizza class in the ontology) rather be individuals of the class Pizza? I mean it is natural to think that they are individuals of a class Pizza. Why have they considered these to be subclasses rather than individuals. And how do they plan to make individuals out of it?(like Margherita1, Margherita2, and so on .... If so, why don't they create any such individuals in the individuals tab)?
And why is that they apply closure axiom only to subclasses of NamedPizza and not others?
An ontology can be modeled in different ways and I think the way you are suggesting should result in a correct ontology.
You can use the same rules to define a subclass as in OOP. If the class has a unique property or relation define a new class else instance should be alright.

Resources