/[fenfire]/fenfire/org/fenfire/util/RDFUtil.java
ViewVC logotype

Diff of /fenfire/org/fenfire/util/RDFUtil.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by mudyc, Thu Jul 17 16:28:19 2003 UTC revision 1.16 by mudyc, Sat Jul 19 09:04:36 2003 UTC
# Line 99  public class RDFUtil { Line 99  public class RDFUtil {
99      /** Special call for structure linked vocabulary to test if node is linked.      /** Special call for structure linked vocabulary to test if node is linked.
100       * @see STRUCTLINK       * @see STRUCTLINK
101       */       */
102      public boolean isLinked(Graph graph, Object node) {      static public boolean isLinked(Graph graph, Object node) {
103          Iterator it = graph.findN_11X_Iter(node, STRUCTLINK.linkedTo);          Iterator it = graph.findN_11X_Iter(node, STRUCTLINK.linkedTo);
104          if (it.hasNext()) return true;          if (it.hasNext()) return true;
105          it = graph.findN_X11_Iter(STRUCTLINK.linkedTo, node);          it = graph.findN_X11_Iter(STRUCTLINK.linkedTo, node);
# Line 107  public class RDFUtil { Line 107  public class RDFUtil {
107          return false;          return false;
108      }      }
109    
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
     /** Split node to two nodes. Enfilade is splitted in ind,  
      * i.e. (node, [foobar]) will be with ind 2 be splitted to  
      * (node, [foo]) and (split, [bar]). All properties will  
      * be copied to split.  
      *  
      * @return the new node  
      * @deprecated  
      */  
     static public Object splitNode(Fen fen, Object node, int ind) {  
         Object split = Nodes.N();  
   
         Enfilade1D enf = (Enfilade1D)fen.txtfunc.f(fen.constgraph, node);  
         if (ind < 0 || ind >= enf.length())  
             throw new Error("Ind is too short or long! "+ind);  
   
         Enfilade1D toEnf = enf.sub(ind, enf.length());  
         Enfilade1D fromEnf = enf.sub(0, ind);  
         fen.txt.set(node, fromEnf);  
         fen.txt.set(split, toEnf);  
   
         Iterator iter = fen.graph.findN_1XA_Iter(node);  
         while (iter.hasNext()) {  
             Object predicate = iter.next();  
             if (predicate != FF.content) {  
                 Iterator it = fen.graph.findN_11X_Iter(node, predicate);  
                 while (it.hasNext()) {  
                     Object object = it.next();  
                     if (dbg) p("Pred: " + predicate);  
                     if (dbg) p("   Obj: "+object);  
                     fen.graph.add(split, predicate, object);  
                 }  
             }  
         }  
         return split;  
     }  
110  }  }
111    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26