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.
GenerateRDF.java
import java.io.*;
|
To run the example you have to follow these steps:
You will get following output on your command prompt.

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Generate RDF file in Java
Post your Comment