Description Logic representation that requires the modelling of sameness or distiction of two individuals - description-logic

I am trying to model the following statement in Description Logic.
A co-teaching faculty member is any person who is an academic staff and teaches at least one course that is taught by others
The representation that I have thought of is:
CoTeachingFaculty EQUIV Person INTERSECTION AcademicStaff EXISTS teaches.(Course INTERSECTION EXISTS isTaughtBy.TOP)
I have a feeling that this is an incorrect representation as EXISTS isTaughtBy.TOP will connect an individual with itself via the chain x--teaches-->c--isTaughtBy-->x. Thus even if a faculty does not share a course with others, she will belong to the class CoTeachingFaculty.
Thus it is required to establish a chain x--teaches-->c--isTaughtBy-->y where x and y are different. Will it be possible to model this kind of situation in the Description Logic framework?

Yes, you are quite correct that your representation will not have the desired effect.
There are possibly 2 ways that I can think of that will achieve more-or-less what you want:
(1) Introduce a coTeachesWith role which is irreflexive and define teaches as
teaches \sqsubseteq coTeachesWith o teaches. In this way you can state that a lecturer co-teaches with another lecturer and from that you can infer that teach the same courses. The downside is that it will infer that all classes taught by this lecturer are also taught by the co-teaching lecturer - which is likely not what you want.
(2) Another way is to use SWRL rules. With that you can provide a rule as follows:
teaches(?x, ?c) ^ teaches(?y, ?c) ^ differentFrom(?x, ?y) ->
CoTeachingFaculty(?x) ^ CoTeachingFaculty(?y)
Below I provide the OWL Manchester syntax for the ontology applying these 2 options:
Prefix: : http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#
Prefix: owl: http://www.w3.org/2002/07/owl#
Prefix: rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
Prefix: rdfs: http://www.w3.org/2000/01/rdf-schema#
Prefix: xml: http://www.w3.org/XML/1998/namespace
Prefix: xsd: http://www.w3.org/2001/XMLSchema#
Ontology: <http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual>
<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual/0.0.1>
AnnotationProperty: <http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled>
AnnotationProperty: rdfs:comment
AnnotationProperty: rdfs:label
Datatype: xsd:boolean
Datatype: xsd:string
ObjectProperty: coTeachesWith
Characteristics: Irreflexive
Domain: CoTeachingFaculty
Range: CoTeachingFaculty
ObjectProperty: isTaughtBy
Domain: Course
Range: AcademicStaff
ObjectProperty: teaches
SubPropertyChain: coTeachesWith o teaches
Domain: AcademicStaff
Range: Course
Class: AcademicStaff
SubClassOf: Person,
teaches some Course
Class: CoTaughtCourse
EquivalentTo: isTaughtBy min 2 owl:Thing
SubClassOf: Course
Class: CoTeachingFaculty
SubClassOf: AcademicStaff
Class: Course
DisjointWith: Person
Class: Person
DisjointWith: Course
Class: owl:Thing
Individual: course1
Types: Course
Facts:
isTaughtBy lecturer1,
isTaughtBy lecturer2
DifferentFrom: course2
Individual: course2
Types: Course
DifferentFrom: course1
Individual: course3
Individual: lecturer1
Facts: coTeachesWith lecturer2
DifferentFrom: lecturer2
Individual: lecturer2
Facts:
teaches course1,
teaches course2
DifferentFrom: lecturer1
Individual: lecturer3
Facts: teaches course2
DifferentFrom: lecturer4
Individual: lecturer4
Facts: teaches course2
DifferentFrom: lecturer3
DifferentIndividuals:
course1,course2,course3
Rule:
teaches(?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#x>, ?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#c>), teaches(?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#y>, ?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#c>), DifferentFrom (?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#x>, ?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#y>) -> CoTeachingFaculty(?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#x>), CoTeachingFaculty(?<http://www.henrietteharmse.com/turtorial/ontologies/DistinctIndividual#y>)
PS. I did not set teaches to be the inverse of taughtBy because then teaches is no longer a simple role and then cannot be used in a role chain. For details see paper on SROIQ.

Most expressive DLs, and the OWL 2 language, include “number restrictions” on roles, e.g. “A course taught by at least two distinct individuals”. The OWL 2 specification provides a pretty clear example of using its “ObjectMinCardinality” feature to accomplish what you want.

Related

Design an OWL DL ontology using Protoge

I have to design an OWL DL ontology using protoge which models the domain described with natural
language statements given below. Use class axioms and relations to other properties, e.g.
rdfs:subClassOf, owl:inverseOf and etc.
Museum is a Building.
Building consists of one or more Rooms.
Room can have different room types, such as Museum Room, Conference Room, Hotel Room.
Room is composed of Building Elements and Building Materials.
Historical Exhibition is an individual of a Museum Room.
Door, Window and Wall are Building Elements and compose a Room.
Door is externally connected to some Wall or Window.
The material type of a Window is one of Building Materials: Aluminum, Steel, Wood
or Plastic.
However, I do not know how to do this. I tried but I have no clue if I am doing it right/ what I have to do different.
I added Building (with subclass Room whereby room has ubclasses Conference_Room, Hotel_Room, Museum_room), Building_elements (with subclasses Door, Wall, Window) , Building_material (with subclasses Aluminum, Plastic, Steel, Wood), Museum as classes
Next to that, I added Object properties:
Compose_a --> domains : Building_Elemens and Ranges : Rooms
Composed_of --> domains: Rooms, Ranges : Building_material, building_elements
Consists_of --> domains: Building, Ranges: Rooms
externally_connected_to --> domains = Door, Ranges : Wall, Window
is_and_individual --> domains = Historical_exhibition, Ranges = Musem_Room
What am I doing wrong? I don't get a picture when I want to visualize in with OWLviz.
Thanks in Advance!
Picture 1
Picture 2

Updating datatype property value base on SWRL rules

Hi i have made an ontology in protege 4.3 for users , suppose 1 of my ontology subclass of class user are:
1-"Interest" , and class "interest" have subclasses: "onlineGaming","onlineMovie","onlineshoping",... and every subclass has individual: everyday,onceAweek,onceAmonth)
and i have 3 datatype property for every user: (internetspeed,internetTraffic,Price)
data gathered based on a questionnaire
i just need to infer from this ontology how important this 3 datatype property factors is for internet users
i need to make some SWRL rules in protege to Infer user interest weight , for example if a user do onlineMovie everyday add a +3 to internetTraffic dataproperty.
user(?u) ^ hasOnlineMovieInterest(?u , everyday)-> add +3 to user(?u,InternetTraffic)
user(?u) ^ hasOnlineGamingInterest(?u , OnceAweek) and hasOnlineMovieInterest(?u , everyday)-> add +2 to user(?u,internetSpeed)
how should i write this properly in SWRL rules?
and my second question is how can i have the value of this 3 datatype property for every user in sparql and save the result?
Thanks for your help
First of all; it is not clear what you are doing / which technology using, etc., please consider clarifying your question. Moreover, the conceptual made you developed doesn't seem sound. Are you sure this is the best way to represent the information you want? For example, why would a UserInterest be a subClassOf User? I think you mean that UserInterest and UserInterestRate are ranges for an object property that connect User to them, i.e., hasInterest rdfs:domain User and hasInterest rdfs:range UserInterest.
Coming to your questions, do you use Protege? If you use it you can implement these SWRL rules using the SWRL tab in Protege.
After you have implemented this correctly, you can simply use some SPARQL query similar to:
select ?user ?r1 ?r2 ?r3 Where {
?user rdf:type yourNamespacePrefix:User.
?user yourNamespacePrefix:rate1 ?r1.
?user yourNamespacePrefix:rate2 ?r2.
?user yourNamespacePrefix:rate3 ?r3.
}

Create and connect individuals with an OWL DL reasoner

I have an ontology with different type of events.
Therefore I have three classes: A, B, C and a helper class Temp.
I want the reasoner to create a new individual as a subclass of C for every pair of individuals a (rdf:typeOf A) and b (rdf:typeOf B) found. This new Individuals should contain informations about a and b.
In the past I used a jena reasoner with an own rule file to get this result, but now I want to switch over to a standard OWL DL reasoner.
My initial idea is to link a und b such as:
a onto:hasB b
And ad give a the Type Temp with the following restriction for Temp:
hasbB some B
Now I want to create a new individual of type C with a restriction for Temp:
hasC some C
And over this new indivual I can access the informations of a and b.
My Problems are:
How can I get the reasoner to connect a and b?
I don't think the creation of C will work, since its a restriction for Temp, which will never be assigned as a type because of this restriction.
Or am I completly wrong with my approach?
Edit:
To clarify my goal with a better exmple:
I have an ontology with different type of events.
My goal is to connect certain individuals (events) which belong together by forming a new individual (event) describing this relation with the help of a reasoner.
E.g.:
I read an event (individual) which describes an "Alarm" (type) into the ontology.
I read an event (individual) which discribes a "PowerOutage" (type) into the ontology.
These Individuals aren't related at all at this moment.
Now I want a reasoner to create a new event (individual) with the type "PowerManipulation". In fact I want an individual with the type "PowerManipulation" created for every pair (which isn't connected, yet) of individuals with the type "PowerOutage" and "Alarm" found. These new individuals should have references (properties) to the individual which caused their creation (an "Alarm" and a "PowerOutage").
Ontology before the reasoning:
(alarm1 rdf:type "Alarm")
(out1 rdf:type "PowerOutage")
What I want the ontology to look like after the reasoning
(alarm1 rdf:type "Alarm")
(out1 rdf:type "PowerOutage")
(man1 rdf:type "PowerManipulation")
(man1 ont:hasRealtadInd alarm1)
(man1 ont:hasRealtedInd out1)
Priviously I used Jena rules and the Jena reasoner to accomplish this task.
But I want to switch over to a standard OWL DL reasoner.
Is it possible to accomplish this task with basic restrictions?
Or do I need SWRL rules, or SPIN (see Williams answer below)?
You can do this with SPIN constructors quite easily and SPIN inserts.
http://www.w3.org/Submission/2011/SUBM-spin-modeling-20110222/#spin-rules-construct
http://www.w3.org/Submission/2011/SUBM-spin-modeling-20110222/#spin-rules-update
SPIN and OWL can live happily together. Take a look at the groovy library that has extensions for both:
https://github.com/williamgreenly/lescot
Example below:
def model = new GroovyRdfModel()
model.add(""" some turtle data """)
model.add(""" some OWL rules """)
model.add(""" some SPIN rules """)
def inferredModelByOWLReasoning = model.owl()
def inferredModelBySPINRules = model.spin()

REST API naming confusion - how to name a resource that does an assignment?

I'm developing a REST API, and I've got the following tables in the DB: classes, subjects, classes_subjects; and the following resources: http://api.example.com/class resource for the classes table, and http://api.example.com/subject resource for the subjects table.
I would like to assign a subject to a class of students (e.g. assign Literature to class 1), i.e. save the class_id and subject_id in the classes_subjects table, but I've got a hard time figuring out how to name the new resource for the classes_subjects table.
I can't name it http://api.example.com/assign because that would be against REST principles, but it would also be awkward to name it http://api.example.com/classes-subjects
Should I just use the /class resource and use PUT when assigning a subject?
I can't figure out any noun to use for assigning subjects to classes. Does any of you know how to handle this kind of issue?
You can use the following schema:
Get all classes with subject 123:
GET /subjects/123/classes
Associate a class with a subject:
POST /subjects/123/classes?classId=<classId>

how to get individual(s) for given class/individual with given object property using SPARQL

I have simple ontology called "campus.owl".There is a class called"Lecturer" and which has two sub classes ,RegularLecturer and VisitingLecturer.There is a another class called "Student" which is a sibling class of Lecturer class.
I have created individuals for all the classes.
Student class is joind with Lecture class with "has" object property.
problem
I want to get some Lecturer/VisitingLecturer individuals for given student individual. Could you please help me to get this result! Thanks in advance!
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX my: http://www.semanticweb.org/ontologies/2010/5/Ontology1275975684120.owl#
SELECT ?lec WHERE { ?lec..........??? }
any idea..??
Thank in advance!
Something like:
SELECT ?lec WHERE { ?lec a ?lectype.
?lectype <http://www.w3.org/2000/01/rdf-schema#subClassOf> <Lecturer>.
<student> <has> ?lec.}
Should do it.