0

我创建了一个简单的本体并正在尝试执行一个SWRLrule(请参阅 owl 文件)。我使用 Pellet 推理器,但没有找到推理的结果。我的规则是:规则:Patient(?x), hasBloodSugar(?x, ?y), hasBloodSugarLevel(?y, 90) -> hasPatientStateLevel(?x, "Normal")。请告诉我我做错了什么?

<?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 -->
4

0 回答 0