根据给定的ID更新个人的数据属性

时间:2015-10-08 07:06:54

标签: c# sparql ontology dotnetrdf

我想根据其ID(ActuatorID)更新任何个人的数据属性(AccessState)。我使用1求助。我的代码没有给我任何错误,但它不会改变本体。任何人都可以指出我的错误。提前谢谢

继承我的本体论

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rdf:RDF [
    <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
    <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
    <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>
    <!ENTITY xml 'http://www.w3.org/XML/1998/namespace'>
    <!ENTITY ap 'http://www.semanticweb.org/faiza/ontologies/2014/10/ActuatorProvider#'>
    <!ENTITY owl 'http://www.w3.org/2002/07/owl#'>
    <!ENTITY ace_lexicon 'http://attempto.ifi.uzh.ch/ace_lexicon#'>
]>
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns="http://www.semanticweb.org/faiza/ontologies/2014/10/ActuatorProvider#" xmlns:ap="http://www.semanticweb.org/faiza/ontologies/2014/10/ActuatorProvider#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:ace_lexicon="http://attempto.ifi.uzh.ch/ace_lexicon#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <owl:AnnotationProperty rdf:about="&ace_lexicon;CN_pl">
    <rdf:type rdf:resource="&owl;AnnotationProperty" />
  </owl:AnnotationProperty>
  <owl:AnnotationProperty rdf:about="&ace_lexicon;CN_sg">
    <rdf:type rdf:resource="&owl;AnnotationProperty" />
  </owl:AnnotationProperty>
  <owl:AnnotationProperty rdf:about="&ace_lexicon;PN_sg">
    <rdf:type rdf:resource="&owl;AnnotationProperty" />
  </owl:AnnotationProperty>
  <owl:AnnotationProperty rdf:about="&ace_lexicon;TV_pl">
    <rdf:type rdf:resource="&owl;AnnotationProperty" />
  </owl:AnnotationProperty>
  <owl:AnnotationProperty rdf:about="&ace_lexicon;TV_sg">
    <rdf:type rdf:resource="&owl;AnnotationProperty" />
  </owl:AnnotationProperty>
  <owl:AnnotationProperty rdf:about="&ace_lexicon;TV_vbg">
    <rdf:type rdf:resource="&owl;AnnotationProperty" />
  </owl:AnnotationProperty>
  <owl:Ontology rdf:about="http://www.semanticweb.org/faiza/ontologies/2014/10/ActuatorProvider">
    <rdf:type rdf:resource="&owl;Ontology" />
  </owl:Ontology>
  <owl:Class rdf:about="&ap;APServices">
    <ace_lexicon:CN_pl>APServiceses</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>APServices</ace_lexicon:CN_sg>
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;AccessState">
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:NamedIndividual rdf:about="&ap;ActuatingDevice1">
    <ace_lexicon:PN_sg>ActuatingDevice1</ace_lexicon:PN_sg>
    <ap:AccessState rdf:datatype="&xsd;string">online</ap:AccessState>
    <ap:ActuatorCode rdf:datatype="&xsd;integer">1</ap:ActuatorCode>
    <ap:ActuatorExplain rdf:datatype="&xsd;string">"TemperatureControl"</ap:ActuatorExplain>
    <ap:ActuatorID rdf:datatype="&xsd;string">"SD01"</ap:ActuatorID>
    <ap:ActuatorName rdf:datatype="&xsd;string">"Fan"</ap:ActuatorName>
    <ap:ConnectsTo rdf:resource="&ap;ActuatorMiddleware1" />
    <ap:PowerConsumption rdf:datatype="&xsd;integer">400</ap:PowerConsumption>
    <ap:productTime rdf:datatype="&xsd;dateTime">2015-10-02T00:00:00-05:00</ap:productTime>
    <rdf:type rdf:resource="&ap;Actuating_Device" />
  </owl:NamedIndividual>
  <owl:NamedIndividual rdf:about="&ap;ActuatingDevice2">
    <ace_lexicon:PN_sg>ActuatingDevice2</ace_lexicon:PN_sg>
    <ap:AccessState rdf:datatype="&xsd;string">offline
</ap:AccessState>
    <ap:ActuatorCode rdf:datatype="&xsd;integer">2</ap:ActuatorCode>
    <ap:ActuatorExplain rdf:datatype="&xsd;string">"AirConditioner"</ap:ActuatorExplain>
    <ap:ActuatorID rdf:datatype="&xsd;string">"DS02"</ap:ActuatorID>
    <ap:ActuatorName rdf:datatype="&xsd;string">"LabConditioner"</ap:ActuatorName>
    <ap:ConnectsTo rdf:resource="&ap;ActuatorMiddleware1" />
    <ap:PowerConsumption rdf:datatype="&xsd;integer">1300</ap:PowerConsumption>
  </owl:NamedIndividual>
  <owl:NamedIndividual rdf:about="&ap;ActuatingDevice3">
    <ace_lexicon:PN_sg>ActuatingDevice3</ace_lexicon:PN_sg>
    <ap:ActuatorCode rdf:datatype="&xsd;integer">3</ap:ActuatorCode>
    <ap:ActuatorExplain rdf:datatype="&xsd;string">"Printer"</ap:ActuatorExplain>
    <ap:ActuatorID rdf:datatype="&xsd;string">"PT03"</ap:ActuatorID>
    <ap:ActuatorName rdf:datatype="&xsd;string">"SamsungPrinter"</ap:ActuatorName>
    <ap:ConnectsTo rdf:resource="&ap;ActuatorMiddleware2" />
    <ap:PowerConsumption rdf:datatype="&xsd;integer">120</ap:PowerConsumption>
    <rdf:type rdf:resource="&ap;Actuating_Device" />
  </owl:NamedIndividual>
  <owl:Class rdf:about="&ap;Actuating_Device">
    <ace_lexicon:CN_pl>Actuating_Devices</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuating_Device</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;Device" />
    <rdfs:subClassOf rdf:nodeID="autos10" />
    <rdfs:subClassOf rdf:nodeID="autos11" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;ActuatorCode">
    <ace_lexicon:TV_pl>ActuatorCode</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>ActuatorCodes</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>ActuatorCoded</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;integer" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;ActuatorExplain">
    <ace_lexicon:TV_pl>ActuatorExplain</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>ActuatorExplains</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>ActuatorExplained</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;string" />
    <rdfs:subPropertyOf rdf:resource="&owl;topDataProperty" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;ActuatorID">
    <ace_lexicon:TV_pl>ActuatorID</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>ActuatorIDs</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>ActuatorIDed</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:NamedIndividual rdf:about="&ap;ActuatorMiddleware1">
    <ace_lexicon:PN_sg>ActuatorMiddleware1</ace_lexicon:PN_sg>
    <ap:ConnectsTo rdf:resource="&ap;ActuatorServiceProvider1" />
    <ap:MiddlewareCode rdf:datatype="&xsd;integer">1</ap:MiddlewareCode>
    <ap:MiddlewareID rdf:datatype="&xsd;string">"MW101"</ap:MiddlewareID>
    <ap:MiddlewareRight rdf:datatype="&xsd;string">false</ap:MiddlewareRight>
    <ap:Use rdf:resource="&ap;ControlService1" />
    <rdf:type rdf:resource="&ap;Actuator_Middleware" />
  </owl:NamedIndividual>
  <owl:NamedIndividual rdf:about="&ap;ActuatorMiddleware2">
    <ace_lexicon:PN_sg>ActuatorMiddleware2</ace_lexicon:PN_sg>
    <ap:ConnectsTo rdf:resource="&ap;ActuatorServiceProvider1" />
    <ap:MiddlewareCode rdf:datatype="&xsd;integer">2</ap:MiddlewareCode>
    <ap:MiddlewareID rdf:datatype="&xsd;string">"MW102"</ap:MiddlewareID>
    <ap:MiddlewareRight rdf:datatype="&xsd;string">true</ap:MiddlewareRight>
    <rdf:type rdf:resource="&ap;Actuator_Middleware" />
  </owl:NamedIndividual>
  <owl:Class rdf:about="&ap;ActuatorModel">
    <rdfs:subClassOf rdf:nodeID="autos12" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;ActuatorName">
    <ace_lexicon:TV_pl>ActuatorName</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>ActuatorNames</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>ActuatorNamed</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:NamedIndividual rdf:about="&ap;ActuatorServiceProvider1">
    <ace_lexicon:PN_sg>ActuatorServiceProvider1</ace_lexicon:PN_sg>
    <ap:ConnectsTo rdf:resource="&ap;ActuatorSupportToolbox1" />
    <rdf:type rdf:resource="&ap;Actuator_Service_Provider" />
  </owl:NamedIndividual>
  <owl:NamedIndividual rdf:about="&ap;ActuatorSupportToolbox1">
    <ace_lexicon:PN_sg>ActuatorSupportToolbox1</ace_lexicon:PN_sg>
    <ap:Perform rdf:resource="&ap;Management1" />
    <rdf:type rdf:resource="&ap;Actuator_Support_Toolbox" />
  </owl:NamedIndividual>
  <owl:Class rdf:about="&ap;Actuator_Content_Service">
    <ace_lexicon:CN_pl>Actuator_Content_Services</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Content_Service</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;APServices" />
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_Control_Service">
    <ace_lexicon:CN_pl>Actuator_Control_Services</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Control_Service</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;APServices" />
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_Info_Management">
    <ace_lexicon:CN_pl>Actuator_Info_Managements</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Info_Management</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;Management" />
    <rdfs:subClassOf rdf:nodeID="autos13" />
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_Middleware">
    <ace_lexicon:CN_pl>Actuator_Middlewares</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Middleware</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:nodeID="autos14" />
    <rdfs:subClassOf rdf:nodeID="autos15" />
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_Provider_Service">
    <ace_lexicon:CN_pl>Actuator_Provider_Services</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Provider_Service</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;APServices" />
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_Service_Provider">
    <ace_lexicon:CN_pl>Actuator_Service_Providers</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Service_Provider</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:nodeID="autos16" />
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_State">
    <ace_lexicon:CN_pl>Actuator_States</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_State</ace_lexicon:CN_sg>
  </owl:Class>
  <owl:Class rdf:about="&ap;Actuator_Support_Toolbox">
    <ace_lexicon:CN_pl>Actuator_Support_Toolboxes</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Actuator_Support_Toolbox</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:nodeID="autos17" />
  </owl:Class>
  <owl:ObjectProperty rdf:about="&ap;ConnectsTo">
    <ace_lexicon:TV_pl>ConnectsTo</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>ConnectsToes</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>ConnectsToed</ace_lexicon:TV_vbg>
  </owl:ObjectProperty>
  <owl:NamedIndividual rdf:about="&ap;ControlService1">
    <ace_lexicon:PN_sg>ControlService1</ace_lexicon:PN_sg>
  </owl:NamedIndividual>
  <owl:Class rdf:about="&ap;Device">
    <ace_lexicon:CN_pl>Devices</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Device</ace_lexicon:CN_sg>
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;Field_Key">
    <rdfs:domain rdf:resource="&ap;Time_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Management">
    <ace_lexicon:CN_pl>Managements</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Management</ace_lexicon:CN_sg>
  </owl:Class>
  <owl:NamedIndividual rdf:about="&ap;Management1">
    <ace_lexicon:PN_sg>Management1</ace_lexicon:PN_sg>
  </owl:NamedIndividual>
  <owl:DatatypeProperty rdf:about="&ap;MiddlewareCode">
    <ace_lexicon:TV_pl>MiddlewareCode</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>MiddlewareCodes</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>MiddlewareCoded</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuator_Middleware" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;MiddlewareID">
    <ace_lexicon:TV_pl>MiddlewareID</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>MiddlewareIDs</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>MiddlewareIDed</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuator_Middleware" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;MiddlewareRight">
    <ace_lexicon:TV_pl>MiddlewareRight</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>MiddlewareRights</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>MiddlewareRighted</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuator_Middleware" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Middleware_Access_Management">
    <ace_lexicon:CN_pl>Middleware_Access_Managements</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Middleware_Access_Management</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;Management" />
    <rdfs:subClassOf rdf:nodeID="autos18" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;ModelBlend">
    <rdfs:domain rdf:resource="&ap;ActuatorModel" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;ModelCode">
    <rdfs:domain rdf:resource="&ap;ActuatorModel" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;ModelName">
    <rdfs:domain rdf:resource="&ap;ActuatorModel" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Multistep_Attribute">
    <rdf:type rdf:resource="&owl;Class" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;Multistep_Code">
    <rdfs:domain rdf:resource="&ap;Multistep_Attribute" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Multistep_Explain">
    <rdfs:domain rdf:resource="&ap;Multistep_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Multistep_Name">
    <rdfs:domain rdf:resource="&ap;Multistep_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Mutlistep_Step">
    <rdf:type rdf:resource="&owl;Class" />
  </owl:Class>
  <owl:ObjectProperty rdf:about="&ap;Perform">
    <ace_lexicon:TV_pl>Perform</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>Performs</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>Performed</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuator_Support_Toolbox" />
    <rdfs:range rdf:resource="&ap;Management" />
  </owl:ObjectProperty>
  <owl:DatatypeProperty rdf:about="&ap;PowerConsumption">
    <ace_lexicon:TV_pl>PowerConsumption</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>PowerConsumptions</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>PowerConsumptioned</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;double" />
  </owl:DatatypeProperty>
  <owl:ObjectProperty rdf:about="&ap;Provide">
    <ace_lexicon:TV_pl>Provide</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>Provides</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>Provided</ace_lexicon:TV_vbg>
    <rdfs:domain rdf:resource="&ap;Actuator_Service_Provider" />
    <rdfs:range rdf:resource="&ap;APServices" />
  </owl:ObjectProperty>
  <owl:Class rdf:about="&ap;Range_Attribute">
    <rdf:type rdf:resource="&owl;Class" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;Range_Code">
    <rdfs:domain rdf:resource="&ap;Range_Attribute" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Range_Explain">
    <rdfs:domain rdf:resource="&ap;Range_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Range_Max_Value">
    <rdfs:domain rdf:resource="&ap;Range_Attribute" />
    <rdfs:range rdf:resource="&xsd;float" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Range_Min_Value">
    <rdfs:domain rdf:resource="&ap;Range_Attribute" />
    <rdfs:range rdf:resource="&xsd;float" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Range_Name">
    <rdfs:domain rdf:resource="&ap;Range_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Service_Info_Management">
    <ace_lexicon:CN_pl>Service_Info_Managements</ace_lexicon:CN_pl>
    <ace_lexicon:CN_sg>Service_Info_Management</ace_lexicon:CN_sg>
    <rdfs:subClassOf rdf:resource="&ap;Management" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;Step_Code">
    <rdfs:domain rdf:resource="&ap;Mutlistep_Step" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Step_Name">
    <rdfs:domain rdf:resource="&ap;Mutlistep_Step" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Step_Value">
    <rdfs:domain rdf:resource="&ap;Mutlistep_Step" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;SwitchCode">
    <rdfs:domain rdf:resource="&ap;Switch_Attribute" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Switch_Attribute">
    <rdf:type rdf:resource="&owl;Class" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;Switch_Explain">
    <rdfs:domain rdf:resource="&ap;Switch_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Switch_Name">
    <rdfs:domain rdf:resource="&ap;Switch_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Switch_Off_State">
    <rdfs:domain rdf:resource="&ap;Switch_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Switch_On_State">
    <rdfs:domain rdf:resource="&ap;Switch_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;Time_Attribute">
    <rdf:type rdf:resource="&owl;Class" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;Time_Code">
    <rdfs:domain rdf:resource="&ap;Time_Attribute" />
    <rdfs:range rdf:resource="&xsd;long" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Time_Explain">
    <rdfs:domain rdf:resource="&ap;Time_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;Time_Name">
    <rdfs:domain rdf:resource="&ap;Time_Attribute" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;TypeCode">
    <rdfs:domain rdf:resource="&ap;TypeInformation" />
    <rdfs:range rdf:resource="&xsd;long" />
    <rdfs:subPropertyOf rdf:resource="&owl;topDataProperty" />
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="&ap;TypeId">
    <rdfs:domain rdf:resource="&ap;TypeInformation" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:Class rdf:about="&ap;TypeInformation">
    <rdf:type rdf:resource="&owl;Class" />
  </owl:Class>
  <owl:DatatypeProperty rdf:about="&ap;TypeName">
    <rdfs:domain rdf:resource="&ap;TypeInformation" />
    <rdfs:range rdf:resource="&xsd;string" />
  </owl:DatatypeProperty>
  <owl:ObjectProperty rdf:about="&ap;Use">
    <ace_lexicon:TV_pl>Use</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>Uses</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>Used</ace_lexicon:TV_vbg>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasDuration">
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&ap;Time_Attribute" />
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasModel">
    <rdf:type rdf:resource="&owl;ObjectProperty" />
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasMultistep">
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&ap;Multistep_Attribute" />
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasRange">
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&ap;Range_Attribute" />
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasState">
    <ace_lexicon:TV_pl>hasState</ace_lexicon:TV_pl>
    <ace_lexicon:TV_sg>hasStates</ace_lexicon:TV_sg>
    <ace_lexicon:TV_vbg>hasStated</ace_lexicon:TV_vbg>
    <rdf:type rdf:resource="&owl;FunctionalProperty" />
    <rdfs:domain rdf:resource="&ap;Device" />
    <rdfs:range rdf:resource="&ap;Actuator_State" />
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasStep">
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&ap;Mutlistep_Step" />
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="&ap;hasType">
    <rdfs:domain rdf:resource="&ap;ActuatorModel" />
    <rdfs:range rdf:resource="&ap;TypeInformation" />
  </owl:ObjectProperty>
  <owl:DatatypeProperty rdf:about="&ap;productTime">
    <rdfs:domain rdf:resource="&ap;Actuating_Device" />
    <rdfs:range rdf:resource="&xsd;dateTime" />
  </owl:DatatypeProperty>
  <owl:Restriction rdf:nodeID="autos10">
    <owl:onClass rdf:resource="&ap;ActuatorModel" />
    <owl:onProperty rdf:resource="&ap;hasModel" />
    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos11">
    <owl:onClass rdf:resource="&ap;Actuator_State" />
    <owl:onProperty rdf:resource="&ap;hasState" />
    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos12">
    <owl:onClass rdf:resource="&ap;TypeInformation" />
    <owl:onProperty rdf:resource="&ap;hasType" />
    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos13">
    <owl:onProperty rdf:resource="&ap;Use" />
    <owl:someValuesFrom rdf:resource="&ap;Actuator_Content_Service" />
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos14">
    <owl:maxQualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxQualifiedCardinality>
    <owl:onClass rdf:resource="&ap;Actuator_Service_Provider" />
    <owl:onProperty rdf:resource="&ap;ConnectsTo" />
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos15">
    <owl:onProperty rdf:resource="&ap;Use" />
    <owl:someValuesFrom rdf:resource="&ap;Actuator_Control_Service" />
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos16">
    <owl:onProperty rdf:resource="&ap;ConnectsTo" />
    <owl:someValuesFrom rdf:resource="&ap;Actuator_Support_Toolbox" />
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos17">
    <owl:onProperty rdf:resource="&ap;Perform" />
    <owl:someValuesFrom rdf:resource="&ap;Management" />
  </owl:Restriction>
  <owl:Restriction rdf:nodeID="autos18">
    <owl:onProperty rdf:resource="&ap;Use" />
    <owl:someValuesFrom rdf:resource="&ap;Actuator_Content_Service" />
  </owl:Restriction>
</rdf:RDF>

我在这里使用的代码

string actID = txtActuatorId.Text;
        string actState = txtActautorState.Text;

    TripleStore store = new TripleStore();
    Graph mygraph = new Graph();
    FileLoader.Load(mygraph, "D:/ActuatorServiceProvider.owl", new RdfXmlParser());
    mygraph.BaseUri = null;
    store.Add(mygraph);
    SparqlUpdateParser myparser = new SparqlUpdateParser();
    SparqlParameterizedString querystring = new SparqlParameterizedString();
    querystring.CommandText = "PREFIX  ap: <http://www.semanticweb.org/faiza/ontologies/2014/10/ActuatorProvider> " +
            "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>" +
            "PREFIX owl: <http://www.w3.org/2002/07/owl#>" +
            "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>" +
            "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>" +

     "DELETE {?ind ap:AccessState ?t.} " +
    "INSERT {?ind ap:AccessState \"" + actState + "\"^^xsd:string.} " +
    "WHERE {?ind ap:ActuatorID \"" + actID + "\"^^xsd:string.} ";

    SparqlUpdateCommandSet cmds = myparser.ParseFromString(querystring);
    LeviathanUpdateProcessor processor = new LeviathanUpdateProcessor(store);
    processor.ProcessCommandSet(cmds);
    mygraph.SaveToFile("D:/ActuatorServiceProvider.owl");

1 个答案:

答案 0 :(得分:1)

您的数据看起来有点奇怪,因为您实际上似乎在值中包含双引号,例如:

LinearLayout

这也可以解释为什么您的更新不会发生变化,因为您正在搜索<ap:ActuatorExplain rdf:datatype="&xsd;string">"AirConditioner"</ap:ActuatorExplain> <ap:ActuatorID rdf:datatype="&xsd;string">"DS02"</ap:ActuatorID> <ap:ActuatorName rdf:datatype="&xsd;string">"LabConditioner"</ap:ActuatorName> 而您的数据包含id

您可以通过在查询中添加引号来修复查询,但说实话,您的实际数据似乎已损坏,您应该通过删除不必要的"id"周围值来解决此问题。一旦您的数据得到修复,您的查询就可以正常工作。