I have this xml file, how can I create RDF triple from it using xpath and ModelFactory in java?
<xml>
<person>
<name>Joe</name>
<website url="www.example1.com">contact1</website >
<vote>20</vote>
</person>
<person>
<name>Anna</name>
<website url="www.example2.com">contact2</website>
<vote>80</vote>
</person>
</xml>
Thanks for help
Thanks for replay, I would like to obtain following RDF
<rdf:Description rdf:about="http://www.example.com/xml">
<j.0:hasCritic>Joe</j.0:hasCritic>
<rdf:Description rdf:about=Joe >
<j.0:haswebsite>"www.example1.com"</j.0:haswebsite>
<j.0:hascontact>contact1</j.0:hascontact>
<j.0:hasvote>80</j.0:hasvote>
</rdf:Description>
<j.0:hasCritic>Anna</j.0:hasCritic>
<rdf:Description rdf:about=Anna>
<j.0:haswebsite>"www.example2.com"</j.0:haswebsite>
<j.0:hascontact>contact2</j.0:hascontact>
<j.0:hasvote>20</j.0:hasvote>
</rdf:Description>
Using Jena API you can store this model into rdf database(Triple).
Grddl might be a workable approach, Jena has an implementation which is pretty straightforward to use. Otherwise, just a basic XSLT script could pretty easily transform that snippet into RDF. Hell, you could probably even just write a basic SAX listener and do the transformation there. There's no magical thing that will do it for you, you're going to have to put in some work, but there are options available.