Commit d20415f9 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

la til utskriftsmetode

parent 57766fb5
......@@ -3,10 +3,12 @@ package com.nesstar.rdf;
import au.com.bytecode.opencsv.CSVReader;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.util.List;
/**
......@@ -27,7 +29,7 @@ public class Main {
}
}
private void doStuff() {
private Main doStuff() {
model.setNsPrefix("foaf", FOAF_NAMESPACE);
// todo: build a model
......@@ -35,9 +37,20 @@ public class Main {
for (String[] record : records) {
// todo: do stuff with records (phone, surname, fist name, seksjon, avdeling, e-mail)
}
return this;
}
private String dumpModelAsTurtle() {
RDFWriter rdfWriter = model.getWriter("N3");
StringWriter stringWriter = new StringWriter();
rdfWriter.write(model, stringWriter, null);
return stringWriter.toString();
}
public static void main(String args[]) throws IOException {
new Main().doStuff();
Main m = new Main().doStuff();
System.out.print(m.dumpModelAsTurtle());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment