Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging multiple RDF documents into one

Tags:

java

rdf

jena

I have got two RDF documents:

  1. http://dublincore.org/2012/06/14/dcterms.rdf
  2. http://xmlns.com/foaf/spec/index.rdf

I would like to merge them into one file, e.g., purl_foaf.rdf. I am working in Java; how can I do this with Jena?

like image 733
Petr Dušek Avatar asked Nov 30 '22 03:11

Petr Dušek


1 Answers

Jena has a built-in command line utility to do this: rdfcat. So, to join those two RDF files together and write the results as Turtle in the file purl_foaf.rdf, do the following from your command line. It should be on one line, but I've split it up for readability:

rdfcat -out Turtle "http://dublincore.org/2012/06/14/dcterms.rdf" \
   "http://xmlns.com/foaf/spec/index.rdf" > purl_foaf.rdf
like image 176
Ian Dickinson Avatar answered Dec 05 '22 13:12

Ian Dickinson