I have created an ontology, and I want to update some data property in it. I read SPARQL Update in enter link description here and I found that with SPARQL Update (Insert/Update) I can update RDF triple based on Pellet reasoner. but I'm in doubt that it is useful fo data property.
For example I have a person class with datapropery has-age "30" and has-age-category="child" I create this SPARQL query and I don't have result.
"DELETE ?person nn:has-category-age 'child'\n" "INSERT ?person nn:has-category-age 'adult'\n" "WHERE {\n" "?person rdf:type nn:person.\n" "?person nn:has-age ?age.\n" "?person nn:has-category-age ?category.\n" "FILTER ((has-category-age='child') && (?has-age='30'))\n" "} "; Thanks a lot
my ontology is:
<?xml version="1.0"?>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-class -->
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-class">
<rdfs:domain rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<rdfs:range rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Classroom"/>
</owl:ObjectProperty>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-time -->
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-time">
<rdfs:domain rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Courses"/>
<rdfs:range rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Time"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-age -->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-age">
<rdfs:domain rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</owl:DatatypeProperty>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-category-age -->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#has-category-age">
<rdfs:domain rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Classroom -->
<owl:Class rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Classroom"/>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Courses -->
<owl:Class rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Courses"/>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person -->
<owl:Class rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Time -->
<owl:Class rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Time"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Jihed -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Jihed">
<rdf:type rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<has-age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">30</has-age>
<has-category-age rdf:datatype="http://www.w3.org/2001/XMLSchema#string">child</has-category-age>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Joseph -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Joseph">
<rdf:type rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<has-age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">10</has-age>
<has-category-age rdf:datatype="http://www.w3.org/2001/XMLSchema#string">child</has-category-age>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Ralph -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Ralph">
<rdf:type rdf:resource="http://www.semanticweb.org/hp/ontologies/2017/9/untitled-ontology-563#Person"/>
<has-age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">25</has-age>
<has-category-age rdf:datatype="http://www.w3.org/2001/XMLSchema#string">adult</has-category-age>
</owl:NamedIndividual>