How to use SPARQL update in Jena SDB

49 views Asked by At

I saved the following RDF/XML documents in a triple store(Jena SDB)

<rdf:RDF 
xmlns:ex="http://www.example#" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml:base="http://www.test#">

<ex:cat rdf:ID="_101">
   <ex:name>Milk</ex:name>
</ex:cat>
<ex:dog rdf:ID="_2001">
   <ex:name>Lub</ex:name>
</ex:dog>
</rdf:RDF>

To

ex:_101 rdf:type ex:cat
ex:_101 ex:name "Milk"
ex:_201 rdf:type ex:dog
ex:_201 ex:name "Lub"

Then I want to change ex:name to ex:aliasname using SPARQL update Query :

DELETE { ?s ex:name ?o }
INSERT { ?s ex:aliasname ?o }
WHERE { ?s ex:name ?o }

Wish

ex:_101 rdf:type ex:cat
ex:_101 ex:aliasname "Milk"
ex:_201 rdf:type ex:dog
ex:_201 ex:aliasname "Lub"

But I don't know how to apply this. I'm referring to the following site. https://www.w3.org/TR/sparql11-update/ https://jena.apache.org/documentation/query/update.html I'd appreciate any advice or link you give me Thank you in advance

0

There are 0 answers