0

I have created a simple ontology and am trying to execute an SWRLrule (Please see the owl file). I use Pellet reasoner, but I didn't find the result of the inference. my rule is: Rule: Patient(?x), hasBloodSugar(?x, ?y), hasBloodSugarLevel(?y, 90) -> hasPatientStateLevel(?x, "Normal").Please tell me what I've done wrong?

<?xml version="1.0"?>

<!DOCTYPE Ontology [
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>


<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.semanticweb.org/acer/ontologies/2015/10/medicalOntology"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     ontologyIRI="http://www.semanticweb.org/acer/ontologies/2015/10/medicalOntology">
    <Prefix name="" IRI="http://www.semanticweb.org/acer/ontologies/2015/10/medicalOntology#"/>
    <Prefix name="p1" IRI="http://example.org/file1#"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="onto" IRI="http://www.semanticweb.org/acer/ontologies/2015/10/untitled-ontology-104#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Prefix name="swrl" IRI="http://www.w3.org/2003/11/swrl#"/>
    <Prefix name="swrlb" IRI="http://www.w3.org/2003/11/swrlb#"/>
    <Prefix name="Ontology" IRI="http://www.semanticweb.org/acer/ontologies/2015/10/"/>
    <Declaration>
        <Class abbreviatedIRI="onto:BloodPressure"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:BloodSugar"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:Doctor"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:HealthStatue"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:Patient"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:Person"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:Temperature"/>
    </Declaration>
    <Declaration>
        <Class abbreviatedIRI="onto:VitalBodyMeasurement"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="#hasBloodSugar"/>
    </Declaration>
    <Declaration>
        <ObjectProperty abbreviatedIRI="onto:hasMeasurement"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#hasBloodSugarLevel"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#hasBloodSugarUnits"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#hasPatientStateLevel"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#BloodSugar001"/>
    </Declaration>
    <Declaration>
        <NamedIndividual IRI="#Patient1"/>
    </Declaration>
    <SubClassOf>
        <Class abbreviatedIRI="onto:BloodPressure"/>
        <Class abbreviatedIRI="onto:VitalBodyMeasurement"/>
    </SubClassOf>
    <SubClassOf>
        <Class abbreviatedIRI="onto:BloodSugar"/>
        <Class abbreviatedIRI="onto:VitalBodyMeasurement"/>
    </SubClassOf>
    <SubClassOf>
        <Class abbreviatedIRI="onto:Doctor"/>
        <Class abbreviatedIRI="onto:Person"/>
    </SubClassOf>
    <SubClassOf>
        <Class abbreviatedIRI="onto:Patient"/>
        <Class abbreviatedIRI="onto:Person"/>
    </SubClassOf>
    <SubClassOf>
        <Class abbreviatedIRI="onto:Temperature"/>
        <Class abbreviatedIRI="onto:VitalBodyMeasurement"/>
    </SubClassOf>
    <ClassAssertion>
        <Class abbreviatedIRI="onto:BloodSugar"/>
        <NamedIndividual IRI="#BloodSugar001"/>
    </ClassAssertion>
    <ClassAssertion>
        <Class abbreviatedIRI="onto:Patient"/>
        <NamedIndividual IRI="#Patient1"/>
    </ClassAssertion>
    <ObjectPropertyAssertion>
        <ObjectProperty IRI="#hasBloodSugar"/>
        <NamedIndividual IRI="#Patient1"/>
        <NamedIndividual IRI="#BloodSugar001"/>
    </ObjectPropertyAssertion>
    <DataPropertyAssertion>
        <DataProperty IRI="#hasBloodSugarLevel"/>
        <NamedIndividual IRI="#BloodSugar001"/>
        <Literal datatypeIRI="&xsd;integer">90</Literal>
    </DataPropertyAssertion>
    <SubObjectPropertyOf>
        <ObjectProperty IRI="#hasBloodSugar"/>
        <ObjectProperty abbreviatedIRI="onto:hasMeasurement"/>
    </SubObjectPropertyOf>
    <ObjectPropertyDomain>
        <ObjectProperty IRI="#hasBloodSugar"/>
        <Class abbreviatedIRI="onto:Patient"/>
    </ObjectPropertyDomain>
    <ObjectPropertyDomain>
        <ObjectProperty abbreviatedIRI="onto:hasMeasurement"/>
        <Class abbreviatedIRI="onto:Patient"/>
    </ObjectPropertyDomain>
    <ObjectPropertyRange>
        <ObjectProperty IRI="#hasBloodSugar"/>
        <Class abbreviatedIRI="onto:BloodSugar"/>
    </ObjectPropertyRange>
    <ObjectPropertyRange>
        <ObjectProperty abbreviatedIRI="onto:hasMeasurement"/>
        <Class abbreviatedIRI="onto:VitalBodyMeasurement"/>
    </ObjectPropertyRange>
    <DataPropertyDomain>
        <DataProperty IRI="#hasBloodSugarLevel"/>
        <Class abbreviatedIRI="onto:BloodSugar"/>
    </DataPropertyDomain>
    <DataPropertyDomain>
        <DataProperty IRI="#hasBloodSugarUnits"/>
        <Class abbreviatedIRI="onto:BloodSugar"/>
    </DataPropertyDomain>
    <DataPropertyDomain>
        <DataProperty IRI="#hasPatientStateLevel"/>
        <Class abbreviatedIRI="onto:Patient"/>
    </DataPropertyDomain>
    <DataPropertyRange>
        <DataProperty IRI="#hasBloodSugarLevel"/>
        <Datatype abbreviatedIRI="xsd:integer"/>
    </DataPropertyRange>
    <DataPropertyRange>
        <DataProperty IRI="#hasBloodSugarUnits"/>
        <Datatype abbreviatedIRI="xsd:string"/>
    </DataPropertyRange>
    <DataPropertyRange>
        <DataProperty IRI="#hasPatientStateLevel"/>
        <Datatype abbreviatedIRI="xsd:string"/>
    </DataPropertyRange>
    <DLSafeRule>
        <Body>
            <ClassAtom>
                <Class abbreviatedIRI="onto:Patient"/>
                <Variable IRI="urn:swrl#x"/>
            </ClassAtom>
            <ObjectPropertyAtom>
                <ObjectProperty IRI="#hasBloodSugar"/>
                <Variable IRI="urn:swrl#x"/>
                <Variable IRI="urn:swrl#y"/>
            </ObjectPropertyAtom>
            <DataPropertyAtom>
                <DataProperty IRI="#hasBloodSugarLevel"/>
                <Variable IRI="urn:swrl#y"/>
                <Literal datatypeIRI="&xsd;integer">90</Literal>
            </DataPropertyAtom>
        </Body>
        <Head>
            <DataPropertyAtom>
                <DataProperty IRI="#hasPatientStateLevel"/>
                <Variable IRI="urn:swrl#x"/>
                <Literal datatypeIRI="&rdf;PlainLiteral">Normal</Literal>
            </DataPropertyAtom>
        </Head>
    </DLSafeRule>
</Ontology>



<!-- Generated by the OWL API (version 3.5.1) http://owlapi.sourceforge.net -->
  • Is this a class exercise? I remember seeing questions about "hasBloodSugar" in the past. Either way, you might find, http://stackoverflow.com/q/21540839/1281433 (blood sugar), http://stackoverflow.com/q/21243879/1281433 (blood pressure), and http://stackoverflow.com/q/20840035/1281433 (blood sugar), http://stackoverflow.com/q/33584240/1281433 (blood sugar) relevant. – Joshua Taylor Nov 12 '15 at 22:46
  • The same question seems to have been asked on the Protege mailing list, too, http://comments.gmane.org/gmane.comp.misc.ontology.protege.owl/41319: **"I'm using protégé 5 beta 17 and I have a problem with SWRL for example: Rule: Patient(?x), hasBloodSugarLevel(?x, ?y), hasBloodSugarLevel(?y, 90) -> hasPatientStateLevel(?x, Normal) I have an error with Normal. and no inference happen. Please see the owl file attached."** – Joshua Taylor Nov 12 '15 at 22:56
  • Tanks for your reply. – Aline Ait Ammeur Nov 14 '15 at 13:55

0 Answers0