Permalink
Browse files

cleaning up example 5

  • Loading branch information...
1 parent d9da390 commit 419bc58d8f501fca9179451ea040c55fababf8c1 @gigasquid committed Jul 7, 2011
Showing with 4 additions and 14 deletions.
  1. +4 −14 example_5.rb
View
@@ -1,31 +1,21 @@
require 'javalib/jena-2.6.4.jar'
-require 'javalib/arq-2.8.7.jar'
require 'javalib/icu4j-3.4.4.jar'
require 'javalib/iri-0.8.jar'
require 'javalib/log4j-1.2.13.jar'
-require 'javalib/lucene-core-2.3.1.jar'
require 'javalib/slf4j-api-1.5.8.jar'
require 'javalib/slf4j-log4j12-1.5.8.jar'
-require 'javalib/stax-api-1.0.1.jar'
-require 'javalib/wstx-asl-3.2.9.jar'
require 'javalib/xercesImpl-2.7.1.jar'
require 'java'
java_import 'com.hp.hpl.jena.rdf.model.ModelFactory'
java_import 'com.hp.hpl.jena.util.FileManager'
java_import 'java.io.InputStream'
-#Creating a model
-m = ModelFactory.create_default_model
-
-#Finding the input file using the Jena File Manager
+#Tutorial 5 - read RDF XML from a file and write it to standard out
+model = ModelFactory.create_default_model
input_file = FileManager.get.open "sample_input.rdf"
-
-#read the RDF/XML file
-m.read(input_file, nil)
-
-#write the RDF file out in a different format
-m.write(java.lang.System::out, "N-TRIPLE")
+model.read(input_file, nil)
+model.write(java.lang.System::out, "N-TRIPLE")

0 comments on commit 419bc58

Please sign in to comment.