1 7 package jena.examples.rdf ; 8 9 import com.hp.hpl.jena.rdf.model.*; 10 import com.hp.hpl.jena.util.FileManager; 11 12 import java.io.*; 13 14 19 public class Tutorial09 extends Object { 20 21 static final String inputFileName1 = "vc-db-3.rdf"; 22 static final String inputFileName2 = "vc-db-4.rdf"; 23 24 public static void main (String args[]) { 25 Model model1 = ModelFactory.createDefaultModel(); 27 Model model2 = ModelFactory.createDefaultModel(); 28 29 InputStream in1 = FileManager.get().open(inputFileName1); 31 if (in1 == null) { 32 throw new IllegalArgumentException ( "File: " + inputFileName1 + " not found"); 33 } 34 InputStream in2 = FileManager.get().open(inputFileName2); 35 if (in2 == null) { 36 throw new IllegalArgumentException ( "File: " + inputFileName2 + " not found"); 37 } 38 39 model1.read( in1, "" ); 41 model2.read( in2, "" ); 42 43 Model model = model1.union(model2); 45 46 model.write(System.out, "RDF/XML-ABBREV"); 48 System.out.println(); 49 } 50 } 51 52 78 | Popular Tags |