如何使用Jena的rdfs:label替换lastIndexOf URI更改?

Md.*_*san 1 rdf jena

我有以下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>
Run Code Online (Sandbox Code Playgroud)

我的目标是使用rdfs:label和rds:label更改uri更改的lastpart,所有时间只包含字符串.在rdf文件中,您看到URI的最后一部分是整数,所以我想用rdfs:label更改整数.所以预期产量如下:

   <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

>
Run Code Online (Sandbox Code Playgroud)

有人可以帮我解决这个问题吗?

And*_*dyS 5

使用ResourceUtils.renameResource.

请注意,带有空格的URI是非法的,稍后会给您带来问题.