Permalink
Browse files

Cleaning up example 7

  • Loading branch information...
1 parent 476a5ad commit 9b4f1ceedf0bdca90d69cb2cd5faa6709d875625 @gigasquid committed Jul 7, 2011
Showing with 5 additions and 7 deletions.
  1. +5 −7 example_7.rb
View
12 example_7.rb
@@ -1,13 +1,9 @@
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'
@@ -16,17 +12,19 @@
java_import 'com.hp.hpl.jena.vocabulary.VCARD'
java_import 'java.io.InputStream'
+#Tutorial 7 - selecting the VCARD resources
+
#Creating a model
-m = ModelFactory.create_default_model
+model = ModelFactory.create_default_model
#Finding the input file using the Jena File Manager
input_file = FileManager.get.open "sample_input.rdf"
#read the RDF/XML file
-m.read(input_file, nil)
+model.read(input_file, nil)
#select all the resources with a VCARD.FN property
-iter = m.list_resources_with_property VCARD::FN
+iter = model.list_resources_with_property VCARD::FN
puts "The database contains vcards for:"
while iter.has_next
puts iter.next_resource.get_required_property(VCARD::FN).get_string

0 comments on commit 9b4f1ce

Please sign in to comment.