Can individual connect to class with object property on Protege? - ontology

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"

Related

how to import data (instances) into an existing ontology in protoge

Can anyone tell me the steps that are required to populate an Ontology?
I have created a domain-specific Ontology (TBox = Terminological knowledge) which consists of defined classes and relations.
On the other hand, I have an IFC file (The Industry Foundation Classes) which has the instances.
I have converted the IFC file to IFC OWL and have understood that I need to map the classes into the newly created ontology.
However, I don't understand how I can get the instances of the associated classes and relations into my created ontology.
You have created two ontology files, one with the tbox and one with the abox. Usually, in this scenario the abox would use an owl:imports annotation to refer to the tbox, and would not, itself, need class declarations - it would use the IRIs for the classes already declared in the tbox. In protégé, creating an imports is straightforward.
A common issue is incorrect IRIs: if you've created your abox without initially importing the tbox, it's possible the classes you used do not match the tbox classes (e.g., the abox classes use the abox IRI as their base IRI instead of the tbox).

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

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.

Protege Ontology Help Sub class, Sibling Class

quick question ive got a couple of sibling classes which include sub classes now what i want to do is connect a sub classes to two diffrent sibling classes, is this possible? also i want it to show in the owlviz.
example
sibling class:
rules
goals
sub class:
collect
so i want sub class collect to feature or be connected in both of the sibling classes. as the software does let me type the same name in each sibling class.
thanks
I don't quite understand the question. You can just assert the fact that collect is a subclass of both rules and goals straight from the Protege User Interface.
Make sure all of your classes are present in your isA hierarchy
Select the class collect
In Protege 4, click on the little "+" icon next to the "Superclasses" section in the Class Description Window
Assert "rules" as a superclass
Repeat and assert "goals" as a superclass.
Now "collect is a subclass of both "rules" and "goals".
AS an aside, it is not normally considered good practice to have multiple asserted inheritance in ontologies. For large ontologies, this can become a maintenance nightmare. If all you need is a small practical solution to a problem, then ok.
The visualisation of your ontology can also be done Protege - you need Graphviz installed first and point Protege to the location of the graphviz executable on your system.
Hope this helps!

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