To infer that
"Every patient being treated by an oncologist has cancer"
You can create, using Protégé, a Paciente_com_Cancer
class and set it equal to (Equivalent To):
Patient and (eh_medical_patient_Medical_Onologist)
Thus, an individual p
of the ontology will belong to class Paciente_com_Cancer
if:
-
p
belong to class Paciente
; and
-
p
has property eh_paciente_do_medico
with an individual m
; and
-
m
belong to class Medico_Oncologista
To improve the ontology, we can make one more inference by associating the patient p
with the name of the disease cancer
:
create a property tem_doenca
create instance cancer
belonging to class Doença
Create a rule using the Semantic Web Rule Language (SWRL):
Patient_with_Cancer (? p) - > has_world (? p, cancer)
Translating ... if p
belongs to class Paciente_com_Cancer
, then p
co_de tem_doenca
.
At the end of the answer is the OWL ontology code I made using Protégé. I've put the ontology here also if you want to download it. I turned the reasoner (algorithm that uses logic to fetch the inferences) Pellet and inferences worked out!
To test the ontology, I created the following facts:
Andre is a Medical_Onologist.
Cancer is a Disease.
John is a patient.
John is a patient of the doctor andre
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 has_doenca 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)))
)