1

I have a following rdf:

<rdf:Description rdf:about="http://www.territorio.provincia.tn.it/geodati/resource/corsi_d_acqua_naturali_e_artificiali/4491">
    <geontology:length rdf:datatype="http://www.w3.org/2001/XMLSchema#double">1831.99493639</geontology:length>
    <rdfs:label xml:lang="it">Fiume chiese</rdfs:label>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
    <rdf:type rdf:resource="http://www.territorio.provincia.tn.it/geodati/resource/corsi_d_acqua_naturali_e_artificiali"/>
    <rdfs:label xml:lang="it">4491</rdfs:label>
    <geo:geometry rdf:resource="http://www.territorio.provincia.tn.it/geodati/resource/corsi_d_acqua_naturali_e_artificiali_4491"/>
  </rdf:Description>

My target is to change lastpart of uri change with rdfs: label and rds:label all times contain string only. In the rdf file you see last part of URI is integer so i want to change integer with rdfs:label. So expected output is following:

   <rdf:Description rdf:about="http://www.territorio.provincia.tn.it/geodati/resource/corsi_d_acqua_naturali_e_artificiali/Fiume chiese">
        <geontology:length rdf:datatype="http://www.w3.org/2001/XMLSchema#double">1831.99493639</geontology:length>
        <rdfs:label xml:lang="it">Fiume chiese</rdfs:label>
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
        <rdf:type rdf:resource="http://www.territorio.provincia.tn.it/geodati/resource/corsi_d_acqua_naturali_e_artificiali"/>
        <rdfs:label xml:lang="it">4491</rdfs:label>
        <geo:geometry rdf:resource="http://www.territorio.provincia.tn.it/geodati/resource/corsi_d_acqua_naturali_e_artificiali_4491"/>
      </rdf:Description

>

Could anybody help me to solve this problem?

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
Md. Rashedul Hasan
  • 1,749
  • 2
  • 12
  • 8

1 Answers1

5

Use ResourceUtils.renameResource.

Note that URIs with spaces in are illegal and will give you problems later on.

AndyS
  • 16,345
  • 17
  • 21