/*
* Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package test.org.mandarax.rdf;
import java.io.FileInputStream;
import java.io.InputStream;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator;
/**
* An utility to import RDF documents, and to print the imported statements
* on System.out. Useful to observe Jena at work.
* @see org.mandarax.rdf.RDFClauseSet
* @author <A HREF="mailto:j.b.dietrich@massey.ac.nz">Jens Dietrich</A> <A HREF="mailto:paschke@in.tum.de">Adrian Paschke</A>
* @version 1.1 <01 August 2004>
* @since 0.1
*/
public class RDFPrint2ConsoleUtil {
public static void main(String[] args) throws Exception {
Model jenaModel = ModelFactory.createDefaultModel();
String input = "src/test/org/mandarax/rdf/testdata/chap0406.rdf"; //args[0];
InputStream in = new FileInputStream(input);
jenaModel.read(in,"");
for (StmtIterator iter = jenaModel.listStatements(); iter.hasNext();) {
System.out.println(iter.nextStatement());
}
}
}
|