In this example we are going to generate our first RDF( Resource Description File). This example generates a RDF file with the use of "Jena". Jena is a java API to create and manipulate RDF graphs.
To create RDF file we do need to import following packages:
To create model we have used createDefaultModel() of ModelFactory, which in turn returns an object of Model interface.
Model model = ModelFactory.createDefaultModel();
To create resource we have used createResource() method of Model interface. Now we can add properties in this model resource by using the "addProperty()" method.
To run the example you have to follow these steps:
You will get following output on your command prompt.
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: September 27, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles