aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/data/WriteToNTriple.java
diff options
context:
space:
mode:
authoryzhou <yzhou@krr-linux.cs.ox.ac.uk>2015-04-30 17:36:35 +0100
committeryzhou <yzhou@krr-linux.cs.ox.ac.uk>2015-04-30 17:36:35 +0100
commit0d8f240c9c0a64f2285324e5a517161e45c698fc (patch)
treef4b4f7078e3be02011b9812cd8791c657a135993 /test/uk/ac/ox/cs/data/WriteToNTriple.java
parent68ae342b2a4923bc7b3f378c6a489f2355d85279 (diff)
downloadACQuA-0d8f240c9c0a64f2285324e5a517161e45c698fc.tar.gz
ACQuA-0d8f240c9c0a64f2285324e5a517161e45c698fc.zip
downgrade owl api and reorganised src files
Diffstat (limited to 'test/uk/ac/ox/cs/data/WriteToNTriple.java')
-rw-r--r--test/uk/ac/ox/cs/data/WriteToNTriple.java57
1 files changed, 0 insertions, 57 deletions
diff --git a/test/uk/ac/ox/cs/data/WriteToNTriple.java b/test/uk/ac/ox/cs/data/WriteToNTriple.java
deleted file mode 100644
index 27e69b9..0000000
--- a/test/uk/ac/ox/cs/data/WriteToNTriple.java
+++ /dev/null
@@ -1,57 +0,0 @@
1package uk.ac.ox.cs.data;
2
3import java.io.FileInputStream;
4import java.io.FileOutputStream;
5import java.io.IOException;
6
7import org.openrdf.model.Statement;
8import org.openrdf.rio.RDFHandler;
9import org.openrdf.rio.RDFHandlerException;
10import org.openrdf.rio.RDFParseException;
11import org.openrdf.rio.RDFParser;
12import org.openrdf.rio.RDFWriter;
13import org.openrdf.rio.ntriples.NTriplesWriter;
14import org.openrdf.rio.turtle.TurtleParser;
15
16
17public class WriteToNTriple {
18
19 public static void main(String... args) throws RDFParseException, RDFHandlerException, IOException {
20 if (args.length == 0)
21 args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/bio2rdf/reactome/data/data.ttl",
22 "http://www.biopax.org/release/biopax-level3.owl#"};
23
24 RDFParser parser = new TurtleParser();
25 final RDFWriter writer = new NTriplesWriter(new FileOutputStream(args[0].replace(".ttl", ".nt")));
26
27 parser.setRDFHandler(new RDFHandler() {
28
29 @Override
30 public void startRDF() throws RDFHandlerException {
31 writer.startRDF();
32 }
33
34 @Override
35 public void handleStatement(Statement arg0) throws RDFHandlerException {
36 writer.handleStatement(arg0);
37 }
38
39 @Override
40 public void handleNamespace(String arg0, String arg1) throws RDFHandlerException {
41 writer.handleNamespace(arg0, arg1);
42 }
43
44 @Override
45 public void handleComment(String arg0) throws RDFHandlerException {
46 writer.handleComment(arg0);
47 }
48
49 @Override
50 public void endRDF() throws RDFHandlerException {
51 writer.endRDF();
52 }
53 });
54
55 parser.parse(new FileInputStream(args[0]), args[1]);
56 }
57}