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.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: September 27, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles