Link to home
Start Free TrialLog in
Avatar of vimal darji
vimal darjiFlag for India

asked on

How to generate RDF RML file from XML data?

I want to generate RML file From XML.
Input data in XML format
and output as RDF RML File.
Input:
<Events> ...
 <Exhibition id="398">
 <Venue>STAM</Venue>
  <Location>
   <lat>51.076891</lat>
   <long>3.717222</long>
  </Location>
 </Exhibition> ...
</Events>

Output:

<#EventsMapping>
  rml:logicalSource [
    rml:source "http://ex.com/events.xml";
    rml:referenceFormulation ql:XPath;
    rml:iterator "/Events/Exhibition" ];

  rr:subjectMap [
    rr:template "http://ex.com/{@id}" ];
 
rr:predicateObjectMap [
    rr:predicate ex:location;
    rr:objectMap [
      rr:parentTriplesMap <#LocationMapping> ] ].

give me your kind suggestions for generating RML file from XML data and if possible suggest in java for the library if available.
Also, Suggestions accepted.
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Hi,
I have a common strategy for generating RDF from XML
- step one: I use XSLT for creating and RDF-XMLM version of the RDF
- step two: I use apache jena for different serialisations of the RDF XML
Avatar of vimal darji

ASKER

Hi, thanks for reply Geert Bormans. Before I am using the same way as you suggested but now in our functionality, we need to map with RML file then convert it to RDF so that I need to generate RML file first for mapping purpose. as you see in my example I need the same mapping file from XML input.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.