Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExRIOT_6.java
- package fr.inrialpes.exmo.evolvement;
- import java.io.BufferedReader;
- import java.io.ByteArrayInputStream;
- import java.io.File;
- import java.io.FileReader;
- import java.io.IOException;
- import com.hp.hpl.jena.rdf.model.Model;
- import com.hp.hpl.jena.rdf.model.ModelFactory;
- import com.hp.hpl.jena.rdf.model.Statement;
- import com.hp.hpl.jena.rdf.model.StmtIterator;
- public class Reader {
- public static void main(String[] args) throws IOException {
- FileReader in = new FileReader(new File("changeset/removed.nt"));
- BufferedReader file = new BufferedReader(in);
- String line = "";
- int i = 0;
- final Model model = ModelFactory.createDefaultModel();
- Statement st = null;
- while ((line = file.readLine()) != null) {
- i++;
- Model m = model.read(new ByteArrayInputStream(line.getBytes()), null, "N-TRIPLE");
- StmtIterator it = m.listStatements();
- while (it.hasNext()) {
- st = it.next();
- }
- System.out.println(st.toString() + "|" + i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement