Iterating Statements of RDF file in Java
Each and every arc in RDF Model represents a statement and each statement have three parts in it as follows :
- Subject
- Predicate
- Object
Subject is the resource from where the arc leaves or we can say that it is a source, Predicate is the label of the leave and Object is the resource to which arc points out or we can say it as sink. It is sometimes called triple (Subject,Predicate,Object). To iterate RDF model statements we need StmtIterator. With Statement object we can access all properties of that Statement such as subject, predicate, object (i.e triple). Full source code of RDFIterator.java is as follows :-
RDFIterator.java
import java.io.*;
.addProperty(VCARD.FN, fullName)
|
To run this program you would have to follow these steps:
- Create and save RDFIterator.java
- Compile RDFIterator.java
- Run RDFIterator class file.
Output:
After executing RDFIterator you will get the
following output.