What is the meaning of "Equivalent To" in Protege? - semantics

I am studying OWL and I am trying to build an Ontology using Protege.
I found an option called Equivalent To in Protege.
What is that option for please? Is it for dividing the space of instances? or is it to set the Object properties that a class can have?

Equivalent to applies to class expressions, object properties and data properties.
Equivalence in class expressions
In class expressions, equivalence means that two classes have the same individuals in any interpretation (i.e., the two classes are alternate names, or equivalent definitions, for the same set of individuals).
Equivalence in data and object properties
For object and data properties, asserting that two properties are equivalent means that their domains and ranges apply to both properties, and that every assertion using one property can be rewritten as using the other.
Example
For example, suppose I declare a hasOwner object property and an ownedBy as equivalent, then: MyCar hasOwner Me implies MyCar ownedBy Me.

Related

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.

Is dcterms:identifier an inverse functional property?

To me, the dcterms:identifier property seems like a legitimate inverse functional property. When two things share the same identifier, I think it is safe to conclude that it is the same thing.
Is there any compelling reason not to define it as such (owl:InverseFunctionalProperty) in my ontology?
If you need to stay in OWL 2 DL, then it's not a good idea to declare data properties to be inverse functional - only object properties can be declared as such without violating the constraints and end up in OWL 2 FULL.
dcterms:identifier has a range of rdfs:Literal defined here
You could use a HasKey axiom to achieve similar results: keys were introduced in OWL 2 for the purpose of identifying one or more properties whose values are identifiers for the referring individuals, and both object and data properties can be used.

Linking an individual through an object property to a class?

I have an ontology that contains the following classes:
"Property", "PropertyType". The "PropertyType" class has two sub classes "ReadableProperty" and "WritetableProperty".
The ontology also contains an object property "hasPropertyType" with the domain "Property" and range "PropertyType".
Is it semantically correct to create the following triples (link an individual of a class to a another class through an object property):
PREFIX exmp:<http://example.org/myontology.owl#>
INSERT DATA{
exmp:someindividual rdf:type exmp:Property, owl:NamedIndividual.
exmp:someindividual exmp:hasPropertyType exmp:WritetableProperty.
}
?
Or should I link the individual of the "Property" class to an individual of the "WritetableProperty" class, and not to the class it self?
As of http://www.w3.org/TR/owl-ref/#Property:
OWL distinguishes between two main categories of properties that an
ontology builder may want to define:
Object properties link individuals to individuals.
Datatype properties link individuals to data values.
So to answer your question: the second option is the correct one.
Don't get confused with defining the Domain and Range for object properties on the terminological level, with the actual assertion of a property.

OWLAPI not returning annotations and instances

In OWLAPI I have a problem with ontology imported through owl:imports statement. The problem is that instances of class and class annotations included in imported ontology are not retrieved and returned.
Lets say I have ontology Rooms and ontology Buildings.
In ontology Rooms I have then following statement which is supposed to load Buildings ontology into Rooms ontology.
<owl:Ontology rdf:about="http://example.com/rooms.xml">
<owl:imports rdf:resource="http://example.com/buildings.xml"/>
</owl:Ontology>
Then in OWLAPI I load ontology Rooms (which should automatically contain Buildings)
manager = OWLManager.createOWLOntologyManager()
roomsOntology = manager.loadOntologyFromOntologyDocument(IRI.create("http://example.com/rooms.xml"))
reasoner = Reasoner.new(roomsOntology)
factory = manager.getOWLDataFactory()
After that retrieving a class from Buildings ontology still works as expected:
buildingClass = factory.getOWLClass(IRI.create("http://example.com/buildings.xml#Building"))
When I want to get instances of class Building (definitions of these instances are included in imported Buildings ontology), then it returns nothing:
instances = buildingClass.getIndividuals(roomsOntology)
Variable 'instances' is empty now.
Same problem is with class annotations if a definition of such a class is included in Buildings ontology.
I'm able to make it work when:
I move instances definitions directly to Rooms ontology (this is not possible in production since I will have 2 separated ontologies anyway)
I use function of Reasoner class (reasoner.getInstances(buildingClass, true) returns instances from both ontologies)
I pass imported ontology to getIndividuals function instead of main (Rooms) ontology (buildingClass.getIndividuals(manager.getImports(roomsOntology)))
Workaround no. 1 is not possible to make for me (it was only for testing purposes). No. 2 and 3 do not work when I need to retrieve annotations, because there is not possible to pass multiple ontologies to OWLClass.getAnnotations function and also Reasoner has no function to get annotations.
Anyway I thought that everything should work without these workarounds since all ontologies, including imported ones, are loaded at the beginning with manager.loadOntologyFromOntologyDocument function.
The issue is that owlClass.getIndividuals(OWLOntology) does not include the imports closure. If you wish to include the imports closure, you need to use another method:
Set<OWLIndividual> getIndividuals(Set<OWLOntology> ontologies);
The set of ontologies can be any set; to use the imports closure, use
ontology.getImportsClosure()
Note that this will return, in all cases, only the individuals asserted to be long to the class. If inference is needed, you will need to use a reasoner, as you mentioned.

Finding variables that share common properties

I'm using Mathematica and have a set of variables (A,B,C,D,...) with properties A=(blue, big, rounded), B=(red, small, spiky), and so forth. Those properties can be common between variables. What would be the best, general way to find all variables that share a common property (of being, for instance, small)? Thanks.
Here's a list of possible properties:
In[1]:= properties={"red","green","blue","big","small","rounded","spiky"};
And here's a list of objects with some of those properties
In[2]:= list={{"blue","big","rounded"},{"red","small","spiky"},
{"red","big","rounded"},{"blue","small","spiky"}};
You can find all objects that have the property of, e.g., being "blue" using Select
In[3]:= Select[list, MemberQ[#,"blue"]&]
Out[3]= {{blue,big,rounded},{blue,small,spiky}}
This could be wrapped up into a function. Although how I would write that function would depend on the data structures and usage that you're planning.
Actually, I just reread you question you have a list of objects with some properties and you want to refer to those objects by name. So you probably want something more like
In[1]:= listProperties["A"]:={"blue","big","rounded"}
listProperties["B"]:={"red","small","spiky"}
listProperties["C"]:={"red","big","rounded"}
listProperties["D"]:={"blue","small","spiky"}
Above I defined some properties that are associated with certain strings. You don't have to use strings in the above or below, and you can create a better structure than that if you want. You could also make a constructor to create the above, such a constructor could also check if the list of properties supplied is of the right form - i.e. does not have contradictory properties, are all in a list of known properties etc...
We then define a function to test if an object/string has a certain property associated with it
In[2]:= hasProperty[obj_, property_]:=MemberQ[listProperties[obj],property]
You might want to return an error or warning message if listProperties[obj] does not have a definition/rule associated with it.
Use Select to find all "objects" in a list that have the associated property "blue":
In[3]:= Select[{"A","B","C","D"}, hasProperty[#,"blue"]&]
Out[3]= {A,D}
There are other ways (probably better ways) to set up such a data structure. But this is one of the simplest ways in Mathematica.