summaryrefslogtreecommitdiff
path: root/src/runtime/java/org
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2020-07-08 21:12:01 +0200
committerkrangelov <kr.angelov@gmail.com>2020-07-08 21:12:01 +0200
commit33818076ff553510b5e4a4d0295388d07ece2ec4 (patch)
treeb381152f5f8f8bb7847ed59ff75c0ae00af1f3ef /src/runtime/java/org
parent47d1da0845814b947113a6786555e6d2672f6533 (diff)
drop the SG library completely.
Diffstat (limited to 'src/runtime/java/org')
-rw-r--r--src/runtime/java/org/grammaticalframework/sg/SG.java56
-rw-r--r--src/runtime/java/org/grammaticalframework/sg/SGError.java11
-rw-r--r--src/runtime/java/org/grammaticalframework/sg/TripleResult.java53
3 files changed, 0 insertions, 120 deletions
diff --git a/src/runtime/java/org/grammaticalframework/sg/SG.java b/src/runtime/java/org/grammaticalframework/sg/SG.java
deleted file mode 100644
index 64dd6b511..000000000
--- a/src/runtime/java/org/grammaticalframework/sg/SG.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.grammaticalframework.sg;
-
-import java.io.Closeable;
-import org.grammaticalframework.pgf.*;
-
-/** This class represents a connection to a semantic graph database.
- * The semantic graph is a graph represented as a set of tripples
- * of abstract expressions. The graph can be used for instance to store
- * semantic information for entities in a GF grammar.
- */
-public class SG implements Closeable {
- /** Opens a new database file. */
- public static native SG openSG(String path) throws SGError;
-
- /** Closes an already opened database. */
- public native void close() throws SGError;
-
- /** Reads a triple in the format &lt;expr,expr,expr&gt; and returns it as an array. */
- public static native Expr[] readTriple(String s) throws PGFError;
-
- /** Simple triple queries.
- * Each of the arguments subj, pred and obj could be null.
- * A null argument is interpreted as a wild card.
- * If one of the arguments is not null then only triples with matching values
- * will be retrieved.
- *
- * @return An iterator over the matching triples.
- */
- public native TripleResult queryTriple(Expr subj, Expr pred, Expr obj) throws SGError;
-
- /** Starts a new transaction. */
- public native void beginTrans() throws SGError;
-
- /** Commits the transaction. */
- public native void commit() throws SGError;
-
- /** Rollbacks all changes made in the current transaction. */
- public native void rollback() throws SGError;
-
- /** Inserts a new triple.
- * @return an unique id that identifies this triple in the database
- */
- public native long insertTriple(Expr subj, Expr pred, Expr obj) throws SGError;
-
- //////////////////////////////////////////////////////////////////
- // private stuff
- private long ref;
-
- private SG(long ref) {
- this.ref = ref;
- }
-
- static {
- System.loadLibrary("jpgf");
- }
-}
diff --git a/src/runtime/java/org/grammaticalframework/sg/SGError.java b/src/runtime/java/org/grammaticalframework/sg/SGError.java
deleted file mode 100644
index 8b03caab7..000000000
--- a/src/runtime/java/org/grammaticalframework/sg/SGError.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.grammaticalframework.sg;
-
-/** This exception is thrown if an error occurs in the semantic graph.
- */
-public class SGError extends RuntimeException {
- private static final long serialVersionUID = -6098784400143861939L;
-
- public SGError(String message) {
- super(message);
- }
-}
diff --git a/src/runtime/java/org/grammaticalframework/sg/TripleResult.java b/src/runtime/java/org/grammaticalframework/sg/TripleResult.java
deleted file mode 100644
index 5570fd93b..000000000
--- a/src/runtime/java/org/grammaticalframework/sg/TripleResult.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.grammaticalframework.sg;
-
-import java.io.Closeable;
-import org.grammaticalframework.pgf.Expr;
-
-/** This class is used to iterate over a list of triples.
- * To move to the next triple, call {@link TripleResult#hasNext}.
- * When you do not need the iterator anymore then call {@link TripleResult#close}
- * to release the allocated resources.
- */
-public class TripleResult implements Closeable {
- public native boolean hasNext();
-
- /** Closes the iterator and releases the allocated resources. */
- public native void close();
-
- /** Each triple has an unique integer key. You can get the key for
- * the current triple by calling {@link TripleResult#getKey}.
- */
- public long getKey() {
- return key;
- }
-
- /** This is the first element of the current triple. */
- public Expr getSubject() {
- return subj;
- }
-
- /** This is the second element of the current triple. */
- public Expr getPredicate() {
- return pred;
- }
-
- /** This is the third element of the current triple. */
- public Expr getObject() {
- return obj;
- }
-
- //////////////////////////////////////////////////////////////////
- // private stuff
- private long ref;
- private long key;
- private Expr subj;
- private Expr pred;
- private Expr obj;
-
- private TripleResult(long ref, Expr subj, Expr pred, Expr obj) {
- this.ref = ref;
- this.subj = subj;
- this.pred = pred;
- this.obj = obj;
- }
-}