On 07/09/2023 15:54, mbk wrote:

Hi!

We generate a RDF/XML file which has all its resources with the 'rdf:about' attribute. We would like to replace this attribute with 'rdf:id'

Using apache-jena 3.17.0 We create ressource with model.createResource(uri,res) where uri is an UUID with prefix '_' (_04f2f0d3-10f4-4248-a7fc-fc8243ec7250) and res os a ressource from a vocabulary. The ressource node in generated file has rdf:about atribute. We like to have rdf:ID instead

Hi,

Is that a URI of <_:04f2f0d3-10f4-4248-a7fc-fc8243ec7250> or <_04f2f0d3-10f4-4248-a7fc-fc8243ec7250

The first is not a legal URI - the scheme name "_" isn't legal. It's not a blank node either because the argument string is interpreted as a URI.

The second is a relative URI which when used in RDF/XML will be resolved against the base URI.

You should use a full URI in a call to model.createResource.

rdf:ID (on nodes) will become an URI fragment and also be resolved.

rdf:ID="abc" is much the same as rdf:about="#abc".


Do you have an minimal example of what you are trying to achieve and what you currently get?

Is this related to:

https://github.com/apache/jena/issues/2007

> Using apache-jena 3.17.0

released 2020-11-25

For security reasons (including with RDF/XML), you should upgrade to Jena 4.9.0

    Andy


Thanks


Reply via email to