0
votes

I have an existing ontology and some XML files. I want to extract the data from the existing XML files and store them in (a new RDF file) RDF triples using Jena. How can I make the mapping between XML and existing ontology to extract the data? I thought of using XSLT but i think there will be a better way to do it. I've read some examples on how to Read/Write RDF files here but i cannot find any tutorials on how to perform the mapping.

Any help would be much appreciated.

Thank you

1

1 Answers

0
votes

Since an XML document can define any information structure you like, there's no completely general purpose method for converting an XML document to an RDF document. So you'll have to define the mapping based on what you know of the XML document's structure and meaning. XSLT is a perfectly good way to encode that mapping; personally I would tend to write a Ruby script but that's just because I'm more comfortable in Ruby than XSLT.

You may find the old GRDDL document from W3C helpful in terms of giving you some hints and directions. As far as I know, there are no maintained GRDDL processors still in existence. There was one in Jena a long time back, but it was not maintained so we deprecated and then removed it some years ago.