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