Protege reasoner not inferring subclasses of inverse of a property - ontology

I am using protege5-5 and the reasoner HermiT 1.4 3.456.
I have a class Animal containing 2 subclasses Animal1 and Animal2. I have a property eats and a property isEatenBy which is defined as the inverse of eats. When I add in the description of Animal1 that it's subclass of eats some(Animal2), I expect the reasoner to add in the description of Animal2 that it's a subclass of isEatenBy Animal1 but it doesn't.
Any idea what should I do to make that happen or if what I am expecting is not supposed to happen anyway ?

I think there are 3 issues here.
(1) Stating Animal1 SubClassOf eats some Animal2 merely states that there is a subset of individuals of the Animal1 set that eats at least 1 individual that belongs to the set of Animal2. At most you can infer that some individuals of Animal2 are eaten by Animal1. That is that isEatenBy some Animal1 SubClassOf Animal2. In (3) I will explain why you do not get this inference.
Most importantly it cannot infer that all individuals of Animal2 are eaten by Animal1, which is what is needed to infer Animal2 SubClassOf isEatenBy some Animal1.
(2) Inverse roles make claims about individuals. Hence, when you have a statement about specific individuals like eats(animal1, animal2) where animal1 and animal2 are individuals, the reasoner will infer that animal2 isEatenBy animal1.
(3) A class like isEatenBy some Animal1 is sometimes referred to as an anonymous class while classes like Animal, Animal1 and Animal2 are referred to as named classes. Because in general the number of inferences that can be made from a set of axioms is infinite, reasoners restrict their inferences to named classes.
As an example, for your eats property you can define the domain as Animal1 and the range as Animal2. This means that whenever you have eats(x, y), individuals x will be inferred to be of type Animal1 and individual y will be inferred to be of type Animal2.
To now also get an inference that is the equivalent is isEatenBy some Animal1 SubClassOf Animal2, you need to introduce a new class, say AnimalsThatAreEatenByAnimal1 that is equivalent to isEatenBy some Animal1. The reasoner will now infer that AnimalsThatAreEatenByAnimal1 is a subclass of Animal2.
In general, to understand the inferences that a reasoner can make, it crucial to understand the semantics of the axioms you define. For this you can look at the direct semantics. For an introduction on the logic, see An Introduction to Description Logics.

Related

Find the Usage of Certain Object Property in Ontology Using OWLAPI

I'm using pizza ontology, and there is this object property called hasCountryOfOrigin. This object property doesn't have specific domain and range, probably because the domain can be pizza or pizzaTopping. For other object properties, for example hasBase, I can find where it's used with ontology.getAxioms(AxiomType.OBJECT_PROPERTY_DOMAIN) because it has domain and range. So how can I find where hasCountryOfOrigin is used using OWLAPI?
You can use:
Searcher.values(ontology.axioms(AxiomType.OBJECT_PROPERTY_ASSERTION), property);
This will provide all assertions that have property as the property, e.g., all axioms of the form subject property value.
You can then iterate over the axioms and check the types for the subject and object to infer possible domains and ranges from usage.
(Note that these do not force the property to have these classes as domains or ranges; it's just that those classes would not surprise a reasoner or a human looking at the ontology, if they were to be asserted to be domains or ranges of the property.)

Can individual connect to class with object property on Protege?

is there any way individual (instance) connect to class with object property? For example, individual in this case is module name: Web Programming. Object property : isClassified. Class: Network.
I've tried to define Web Programming as class, and it works because the domain and range are both classes. Same goes if I define both Web Programming & Network as individuals, it works. If the domain is a class and the range is individual, it still works. But what if the domain is individual and the range is class? Is there any way I can connect it with object property: isClassifiedIn?
Protégé is an OWL 2 DL editor (since version 4). In OWL 2 DL, an individual cannot be a class, and an object property must relate individuals to individuals only. So what you want cannot be expressed in the way you formulate it. However, you could do two things:
use an annotation property instead of an object property. This may not be ideal because an OWL DL reasoner must ignore annotation properties in the reasoning process. They are just that: annotations, similar to comments in a programming code.
relate the individual to another individual that has the same name as the class. Let me give details about this.
In OWL 2 DL, although it is not possible for individuals to be classes, it is possible for individual names to be class names at the same time. For instance, one can say (in Turtle syntax):
ex:Module a owl:Class .
ex:Network a owl:Class, owl:Thing .
ex:isClassified a owl:ObjectProperty .
ex:webProgramming a ex:Module;
ex:isClassified ex:Network .
Note that ex:webProgramming here is not related to a class. It is related to an individual of type owl:Thing. This individual has nothing to do, a priori, with the class named ex:Network, although it has the same name. This is called "punning" in the OWL 2 specification.
There is a third way: change your knowledge model such that you do not encounter this problem. I do not know your ontology, but it could be hinting at an antipattern that you should avoid.
You have to use "value".
Write your own expression using the class expression editor.
Select the class Than write:
"property" value "individual"

Unknown symbol in ERD

I was searching for the meaning of the symbol marked in red in the image below, but I didn't get anything.
So, do you guys know what it means?
It indicates a supertype/subtype relationship. The notation is used in Microsoft Visio, where it's called a category. A double horizontal line is used to indicate a complete category.
In your image, Jurusan records information about the parent/supertype while Animasi, TKJ, RPL and Otomotif describe children/subtypes.
Here's a video on the topic.
Supertype/subtype hierarchies
It does seem to represent supertypes and subtypes. Often the circle will have either a d or an o inside. The d stands for "disjoint" or non-overlapping and the o would stand for "overlapping". These would be constraints. A d would mean that an instance can only appear in one subtype. An o would imply that an instance can be in multiple subtypes. In your example, I'm assuming the supertype instance in question would come from your Colon Siswa table.
Since no information is included in the circle, we do not know. As for the line beneath the circle, there is an option of 1 line - partial completeness or 2 lines - total completeness. The completeness constraint identifies whether an instance in the supertype has to be in one of the subtypes. A single line implies that a supertype instance does not have to be in the subtype. While a double line (2 lines), implies that an instance HAS to be in the subtype.
Supertypes and subtypes are sometimes organized in a specialization hierarchy. The ER model is sometimes called an "enhanced" or "extended" ER Model or EER in that case.
The model you provided is also missing the subtype discriminator. The subtype discriminator would let us know which attribute (field) determines which subtype the instance would belong too. Since you're familiar with the language your model was created in, it may be obvious how it will be determined which instances from the supertype (parent entity) would fall into which subtypes (child entities).
We sometimes call the relationships shown on a specialization hierarchy a "is a" relationship.
You can find examples of these relationships in the textbook below:
Coronel, C. (2017). Database Systems: Design, Implementation, & Management, 12th Edition. [VitalSource Bookshelf Online]. Retrieved from https://bookshelf.vitalsource.com/#/books/9781337509596/
or the following reading room...not my own, but it is an example from the text above.
Reading Room Notes
cardinality symbol, i think one to many symbol

Data property with value equal to number of individuals in a class?

Is possible to define a data property of a class as the number of individuals of another class, and this number is computed automatically.
There is no functionality for counting already available, far as I know.
It could be implemented for asserted axioms, but I don't think it can be guaranteed to work reliably. The open world assumption and the default non unique name assumption mean that it's impossible to say if there are unknown individuals or if any of the known individuals are sameAs each other.

Conflict of same individuals property and datatype property

I am having a problem with "same individuals property" in protege, when I run a reasoner (pellet 1.5 or fact++)
Lets take ontology example
thing has class sons A and B, A has sons C and D.
B, C and D have individuals of the same class.
Can't I say a individual C is "same individual" as individual B, and then add also individual D is "same individual" as individual B? Which is true, they have different names, but they are same individual.
Why does it only work when I set individual B has "same individual" of type C or D?
The protege error is "InconsistentOntologyException:Fact++.Kernel: inconsistent Ontology" and pellet says ontology is inconsistent.
EDIT: Seems its a more deep rooted problem, this example works, going to keep checking.
EDIT2: After some more experimenting, seems its a conflict with DataType properties.
They all share a DataType properties with same name. In the example domain of property would be A and range string. Any idea how to solve?
Yeah you solved it - you were confusing labels (what you call things) with identity: an instance of a class is unique (you can attach different labels to it - i.e. call it different things) but the instance itself can only exist once - and in your example you effectively asserted that there are "three instances of the same instance"...which, of course, doesn't make any sense.

Resources