Loading Turtle, N3 and TRIG files to a DB2 RDF Store
5 lines of code that will load a turtle, N3 or TRIG file to a DB2 RDF Store
String file = "<turtle/n3/trig file>"; //load the file to memory Model memM = ModelFactory.createDefaultModel(); memM.read(FileManager.get().open(file), "", Lang.guess(file).name()); // connect to the the RDF Store in DB2 Store store = StoreManager.connectStore(connection, "", storeName); Dataset db2DS = RdfStoreFactory.connectDataset(store, conn); // copy triples to DB2 ... [More]
|