1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.util.FileManager;
import java.io.*;
public class Tutorial09 extends Object {
static final String inputFileName1 = "ton ontologie.owl";
public static void main (String args[]) {
// create an empty model
Model model1 = ModelFactory.createDefaultModel();
// use the class loader to find the input file
InputStream in1 = FileManager.get().open(inputFileName1);
if (in1 == null) {
throw new IllegalArgumentException( "File: " + inputFileName1 + " not found");
}
// read the RDF/XML files
model1.read( in1, "" );
// print the graph as RDF/XML
model.write(System.out, "RDF/XML");
System.out.println();
}
} |