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

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

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

revision 1.4 by mudyc, Wed Mar 26 12:18:51 2003 UTC revision 1.5 by mudyc, Wed Mar 26 14:00:25 2003 UTC
# Line 1  Line 1 
1  //(c): Matti Katila  //(c): Matti Katila
2    
3  package org.fenfire.util;  package org.fenfire.util;
4    import org.fenfire.vocab.*;
5  import com.hp.hpl.mesa.rdf.jena.vocabulary.RDF;  import com.hp.hpl.mesa.rdf.jena.vocabulary.RDF;
6  import com.hp.hpl.mesa.rdf.jena.model.*;  import com.hp.hpl.mesa.rdf.jena.model.*;
7  import com.hp.hpl.mesa.rdf.jena.common.*;  import com.hp.hpl.mesa.rdf.jena.common.*;
# Line 53  public static final String rcsid = "$Id$ Line 54  public static final String rcsid = "$Id$
54          pa("Exception ocurred!: "+e);          pa("Exception ocurred!: "+e);
55          throw new Error("ShortRDF has RDFException!");          throw new Error("ShortRDF has RDFException!");
56      }}      }}
57    
58    
59        /** Check if node is specified type
60         */
61        public static boolean isNodeType(Model model, RDFNode node, RDFNode type)
62        { try {
63            Selector selector = new SelectorImpl((Resource)node, RDF.type, (RDFNode)null);
64            StmtIterator iter = model.listStatements(selector);
65            while (iter.hasNext()) {
66                Statement stmt = iter.next();
67                if ((RDFNode)stmt.getObject() == type) return true;
68            }
69            return false;
70        } catch (RDFException e) {
71            pa("Exception ocurred!: "+e);
72            throw new Error("ShortRDF has RDFException!");
73        }}
74    
75  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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