/[fenfire]/fenfire/org/fenfire/loom/ModelUtil.java
ViewVC logotype

Diff of /fenfire/org/fenfire/loom/ModelUtil.java

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

revision 1.2 by benja, Tue Mar 11 22:52:22 2003 UTC revision 1.3 by benja, Sat Mar 15 21:57:59 2003 UTC
# Line 51  public class ModelUtil { Line 51  public class ModelUtil {
51      }      }
52    
53      /** Get the set of all properties of all statements in a model.      /** Get the set of all properties of all statements in a model.
      *  Omitted from this are the 'numeric' properties:  
      *  rdf:_1, rdf:_2 etc.  
54       */       */
55      public static Set getProperties(Model m) throws RDFException {      public static Set getProperties(Model m) throws RDFException {
56          Set properties = new HashSet();          Set properties = new HashSet();
# Line 61  public class ModelUtil { Line 59  public class ModelUtil {
59          for(StmtIterator iter = m.listStatements(); iter.hasNext();) {          for(StmtIterator iter = m.listStatements(); iter.hasNext();) {
60              Statement stmt = iter.next();              Statement stmt = iter.next();
61              Property p = stmt.getPredicate();              Property p = stmt.getPredicate();
62              if(!rdf.isNumericProperty(p))              properties.add(p);
                 properties.add(p);  
63          }          }
64    
65          return properties;          return properties;
66      }      }
67    
68        /**
69         */
70        public static Set getNonNumericProperties(Model m)
71            throws RDFException {
72    
73            Set s = getProperties(m);
74            for(Iterator i=s.iterator(); i.hasNext();)
75                if(RDFVocab.isNumericProperty((Property)i.next()))
76                    i.remove();
77            return s;
78        }
79  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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