gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] fenfire docs/pegboard/swamp_rdf_api--tjl/peg.rs...


From: Tuomas J. Lukka
Subject: [Gzz-commits] fenfire docs/pegboard/swamp_rdf_api--tjl/peg.rs...
Date: Thu, 10 Apr 2003 07:56:53 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Tuomas J. Lukka <address@hidden>        03/04/10 07:56:52

Modified files:
        docs/pegboard/swamp_rdf_api--tjl: peg.rst 
Added files:
        org/fenfire/swamp: ConstGraph.java Graph.java Nodes.java 
                           NotUniqueError.java 
        org/fenfire/swamp/impl: HashGraph.java 

Log message:
        Starting swamp

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/docs/pegboard/swamp_rdf_api--tjl/peg.rst.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/swamp/ConstGraph.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/swamp/Graph.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/swamp/Nodes.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/swamp/NotUniqueError.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/swamp/impl/HashGraph.java?rev=1.1

Patches:
Index: fenfire/docs/pegboard/swamp_rdf_api--tjl/peg.rst
diff -u fenfire/docs/pegboard/swamp_rdf_api--tjl/peg.rst:1.7 
fenfire/docs/pegboard/swamp_rdf_api--tjl/peg.rst:1.8
--- fenfire/docs/pegboard/swamp_rdf_api--tjl/peg.rst:1.7        Wed Apr  9 
15:30:50 2003
+++ fenfire/docs/pegboard/swamp_rdf_api--tjl/peg.rst    Thu Apr 10 07:56:52 2003
@@ -3,9 +3,9 @@
 =============================================================
 
 :Author:   Tuomas J. Lukka
-:Last-Modified: $Date: 2003/04/09 19:30:50 $
-:Revision: $Revision: 1.7 $
-:Status:   Current
+:Last-Modified: $Date: 2003/04/10 11:56:52 $
+:Revision: $Revision: 1.8 $
+:Status:   Current, Partially preliminarily implemented (since in its own 
package)
 
 This document outlines the main issues in the Jena api
 currently in use and proposes a lightweight api of our own
@@ -14,6 +14,7 @@
 Issues
 ======
 
+
 - Are there any APIs out there that already support our needs?
 
 - Do we want implicit or explicit observers?
@@ -114,7 +115,16 @@
 - What should the resource mapper and its methods be called? RMap? 
   Nodes?
 
-    Still open, under consideration.
+    RESOLVED: Nodes. It's the most descriptive.
+
+- Could we use e.g. int instead of Object for resources?
+
+    RESOLVED: Can't do - with ints you won't know if there
+    are any external references to it.
+
+    With Object, you can use Weak maps to allow garbage collection
+    but also allow the retaining of resource objects between
+    different graphs.
 
 - For returning multiple values, should we use Iterators or something
   else?  ::
@@ -127,7 +137,14 @@
       use simultaneously
 
     Thinking.
+
+- What about queries with more than one component? Say, "give me all triples",
+  or "give me all property-value pairs for the given subject node"
+
+- Why is the new API called swamp?
     
+    RESOLVED: Fenfires spring out of swamps ;)
+
 Problems with jena
 ==================
 
@@ -175,16 +192,17 @@
 The global resource mapper (has to be global since resources are 
model-agnostic)
 is simple: The name must be short because it's so widely used. ::
 
-    public class RMap {
-       public static Object toModel(String res);
-       public static Object toModel(String res, int offs, int len);
-       public static Object toModel(char[] res, int offs, int len);
+    public class Nodes {
+       public static Object get(String res);
+       public static Object get(String res, int offs, int len);
+       public static Object get(char[] res, int offs, int len);
 
        public static String toString(Object res);
 
        /** Append the string version of the resource to the given buffer.
         * In order to avoid creating too many String objects
-        * when serializing a space, we
+        * when serializing a space.
+        */
        public static void appendToString(Object res, StringBuffer buf);
     }
 
@@ -193,7 +211,7 @@
 the toModel method overloaded with different parameter types allows the most 
efficient
 creation of resources without conversions.
 
-We *may* want to make RMap internally redirectable in the future to allow
+We *may* want to make Nodes internally redirectable in the future to allow
 alternate implementations; the static interface will not change.
 
 The model object
@@ -203,27 +221,27 @@
 To avoid this, we'll drop the semantics (subject,predicate,object) for now
 and name all methods according to a general scheme. ::
 
-    public interface ConstFirstOrderGraph {
-       public Object find1_11X(Object subject, Object predicate);
-       public Object find1_X11(Object predicate, Object subject);
+    public interface ConstGraph {
+       Object find1_11X(Object subject, Object predicate);
+       Object find1_X11(Object predicate, Object subject);
        ...
-       public Iterator findN_11X(Object subject, Object predicate);
+       Iterator findN_11X_Iter(Object subject, Object predicate);
        ...
     }
 
-    public interface FirstOrderGraph extends ConstFirstOrderGraph {
-       public void set1_11X(Object subject, Object predicate, Object object);
-       public void set1_X11(Object subject, Object predicate, Object object);
+    public interface Graph extends ConstGraph {
+       void set1_11X(Object subject, Object predicate, Object object);
+       void set1_X11(Object subject, Object predicate, Object object);
        ...
 
-       public void rm_1XX(Object subject);
-       public void rm_11X(Object subject, Object predicate);
-       public void rm_X11(Object predicate, Object object);
+       void rm_1XX(Object subject);
+       void rm_11X(Object subject, Object predicate);
+       void rm_X11(Object predicate, Object object);
        ...
 
        /** Add the given triple to the model.
         */
-       public void add(Object subject, Object predicate, Object object);
+       void add(Object subject, Object predicate, Object object);
     }
 
 The functions are built by the following format:
@@ -241,6 +259,16 @@
        and return. Even if there are none, the iterator is created.
        Only a single X may be used.
 
+       For instance, ::
+
+           findN_1XA(node)
+
+       returns all properties that the node has, and
+
+           findN_XAA()
+
+       finds all nodes that are the subject of any triple.
+
     set1
        Remove the other occurrences of the matching triples, replace them with 
the given
        new one. For example, if triples (a,b,c) and (a,b,d) and (a,e,d) are in 
the model,
@@ -250,6 +278,7 @@
 
        the model will have the triples (a,b,g) and (a,e,d).
        Only a single X may be used (restriction may be lifted in the future).
+       Only 1 and X may be used. 
     
     rm
        Remove the matching triples from the model. Any amount of Xs may be 
used.
@@ -261,6 +290,9 @@
     X
        Requested / set
 
+    A
+       Ignored - may be any
+
 The uniqueness exception
 ------------------------
 
@@ -273,5 +305,6 @@
        public final Object object;
     }
 
+The wildcards are set to null.
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]