To infer that
"Every patient who is treated by an oncologist has cancer"
you can create, using Protégé, a class Paciente_com_Cancer
and define it as being equivalent to (Equivalent To):
Patient and (eh_patiente_do_medico some Medico_oncologist)
Thus, an individual p
of ontology will belong to the class Paciente_com_Cancer
if:
p
belong to the class Paciente
; and
p
own the property eh_paciente_do_medico
with an individual m
; and
m
belong to the class Medico_Oncologista
To improve ontology, we can make one more inference associating the patient p
the name of the disease cancer
:
- create a property
tem_doenca
- create the instance
cancer
class-owned Doença
create a rule using the Semantic Web Rule Language (SWRL):
Patient_com_cancer(? p) -> tem_disease(? p, cancer)
Translating... if p
belong to the class Paciente_com_Cancer
, then p
tem_doenca
cancer
.
At the end of the answer is the OWL ontology code that I made using Protégé. I put the ontology here also, if you want to download it. I ran the Pellet Reasoner (algorithm that uses logic to find inferences) and the inferences worked!
To test ontology, I created the following facts:
Andre is a Medico_oncologist.
cancer is a disease.
John is a Patient.
John is the doctor’s patient
From this information and from the classes and properties we modeled earlier, the Reasoner algorithm correctly inferred the following:
John is a Patient with cancer.
Joao tem_disease cancer.
Ontology OWL
Prefix(:=<http://www.example.com/hospital#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://www.example.com/hospital>
### As Classes ###
Declaration(Class(:Doenca))
Declaration(Class(:Fisioterapeuta))
Declaration(Class(:Medico))
Declaration(Class(:Medico_Oncologista))
Declaration(Class(:Nutricionista))
Declaration(Class(:Paciente))
Declaration(Class(:Paciente_com_Cancer))
Declaration(Class(:Profissionais))
Declaration(Class(:Psicologo))
### As Propriedades ###
Declaration(ObjectProperty(:eh_paciente_do_medico))
Declaration(ObjectProperty(:tem_doenca))
Declaration(ObjectProperty(:tem_paciente))
### Alguns indivíduos (instâncias das Classes) ###
Declaration(NamedIndividual(:andre))
Declaration(NamedIndividual(:cancer))
Declaration(NamedIndividual(:joao))
### Relações entre as Classes ###
SubClassOf(:Fisioterapeuta :Profissionais)
SubClassOf(:Medico :Profissionais) # Medico é uma subclasse de Profissionais
SubClassOf(:Medico_Oncologista :Medico)
SubClassOf(:Nutricionista :Profissionais)
# Paciente_com_Cancer = Paciente E eh_paciente_do_medico Medico_Oncologista
EquivalentClasses(:Paciente_com_Cancer ObjectIntersectionOf(ObjectSomeValuesFrom(:eh_paciente_do_medico :Medico_Oncologista) :Paciente))
SubClassOf(:Paciente_com_Cancer :Paciente)
SubClassOf(:Psicologo :Profissionais)
InverseObjectProperties(:tem_paciente :eh_paciente_do_medico)
ClassAssertion(:Medico_Oncologista :andre) # andre é um Medico_Oncologista
ClassAssertion(:Doenca :cancer) # cancer é uma Doenca
ClassAssertion(:Paciente :joao) # joao é um Paciente
ObjectPropertyAssertion(:eh_paciente_do_medico :joao :andre) #joao é paciente do medico andre
### Regras ###
# Regra em SWRL: Paciente_com_Cancer(?x) -> tem_doenca(?x, cancer)
# Se fulano pertencer à classe Paciente_com_Cancer, então podemos inferir que: fulano tem_doenca cancer
DLSafeRule(Body(ClassAtom(:Paciente_com_Cancer Variable(<urn:swrl#x>)))Head( ObjectPropertyAtom(:tem_doenca Variable(<urn:swrl#x>) :cancer)))
)
Welcome to Stack Overflow, Icarus! When you can, do the tour to learn a little more about how the site works (it is very fast, and is worth a medal!)
– Daniel