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 31 32 33 34 35 36 37
| package internet;
import java.io.InputStream;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.util.FileManager;
/**
*
* @author PC
*/
public class Internet {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
// create an empty model
Model model = ModelFactory.createDefaultModel();
String inputFileName = "pizza.owl";
// use the FileManager to find the input file
InputStream in = FileManager.get().open(inputFileName );
if (in == null) {
throw new IllegalArgumentException("File: " + inputFileName
+ " not found");
}
model.read(in, "", "RDF/XML");
// write it to standard out
model.write(System.out);
}
} |
Partager