From 17bd9beaf7f358a44e5bf36a5855fe6727d506dc Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Tue, 10 May 2022 18:17:06 +0100 Subject: [pagoda] Move project to Scala This commit includes a few changes: - The repository still uses Maven to manage dependency but it is now a Scala project. - The code has been ported from OWLAPI 3.4.10 to 5.1.20 - A proof of concept program using both RSAComb and PAGOdA has been added. --- src/uk/ac/ox/cs/pagoda/util/TurtleHelper.java | 56 --------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/uk/ac/ox/cs/pagoda/util/TurtleHelper.java (limited to 'src/uk/ac/ox/cs/pagoda/util/TurtleHelper.java') diff --git a/src/uk/ac/ox/cs/pagoda/util/TurtleHelper.java b/src/uk/ac/ox/cs/pagoda/util/TurtleHelper.java deleted file mode 100644 index 6887b9f..0000000 --- a/src/uk/ac/ox/cs/pagoda/util/TurtleHelper.java +++ /dev/null @@ -1,56 +0,0 @@ -package uk.ac.ox.cs.pagoda.util; - -import java.io.*; - -public class TurtleHelper { - - public static void simplify(String tempFile, String outputPath) throws IOException { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(tempFile))); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputPath))); - - String line, sub = null, pred = null, obj = null; - char lastSymbol = '.', symbol; - String[] seg; - while ((line = reader.readLine()) != null) { - if (line.trim().isEmpty() || line.startsWith("#") || line.startsWith("@base")) - continue; - - if (line.startsWith("@")) { - writer.write(line); - writer.newLine(); - continue; - } - - - symbol = line.charAt(line.length() - 1); - - if (lastSymbol == '.') { - seg = line.split(" "); - sub = seg[0]; - pred = seg[1]; - obj = seg[2]; - } - else if (lastSymbol == ';') { - line = line.substring(sub.length() + 1); - seg = line.split(" "); - pred = seg[0]; - obj = seg[1]; - } - else if (lastSymbol == ',') { - line = line.substring(sub.length() + pred.length() + 2); - obj = line.substring(0, line.lastIndexOf(' ')); - } - else Utility.logError("ERROR"); - - lastSymbol = symbol; - if (pred.equals("rdf:type") && obj.startsWith("owl:")) - continue; - - writer.write(sub + " " + pred + " " + obj + " .\n"); - } - - reader.close(); - writer.close(); - } - -} -- cgit v1.2.3