Revision: 15050
          http://gate.svn.sourceforge.net/gate/?rev=15050&view=rev
Author:   markagreenwood
Date:     2012-01-14 22:32:17 +0000 (Sat, 14 Jan 2012)
Log Message:
-----------
some code cleanup

Modified Paths:
--------------
    gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/Utils.java

Modified: gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/Utils.java
===================================================================
--- gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/Utils.java        
2012-01-14 22:31:36 UTC (rev 15049)
+++ gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/Utils.java        
2012-01-14 22:32:17 UTC (rev 15050)
@@ -78,9 +78,7 @@
   public static OClass createOClass(Ontology ontology,
           OntologyService owlim, String uri, byte classType) {
     OClass aClass = null; //(OClass)ontology.getOResourceFromMap(uri);
-    if(aClass != null) {
-      return aClass;
-    }
+    
     switch(classType) {
       case OConstants.HAS_VALUE_RESTRICTION:
         aClass = new HasValueRestrictionImpl(new OBNodeIDImpl(uri), ontology,
@@ -171,28 +169,17 @@
   
   /**
    * Creates a new instance of Ontology Instance
-   * 
-   * @param repositoryID
-   * @param ontology
-   * @param ontologyService
-   * @param uri
-   * @return
    */
-  public static OInstance createOInstance(
-          Ontology ontology, OntologyService owlim, String uri) {
-    OResource aResource = null; //= ontology.getOResourceFromMap(uri);
-    if(aResource instanceof OInstance || aResource == null){
-      OInstance anInstance = (OInstance)aResource;
-      if(anInstance != null) return anInstance;
-      anInstance = new OInstanceImpl(ontology.createOURI(uri), ontology,
-              owlim);
-      //ontology.addOResourceToMap(uri, anInstance);
-      return anInstance;
-    }else{
-      throw new GateOntologyException("Expecting " + uri + 
-              " to be an instance but it is a \"" + 
-              aResource.getClass().getCanonicalName() + "\" instead!");
-    }
+  public static OInstance createOInstance(Ontology ontology,
+      OntologyService owlim, String uri) {
+    OResource aResource = null; // = ontology.getOResourceFromMap(uri);
+
+    OInstance anInstance = (OInstance)aResource;
+    if(anInstance != null) return anInstance;
+    anInstance = new OInstanceImpl(ontology.createOURI(uri), ontology, owlim);
+    // ontology.addOResourceToMap(uri, anInstance);
+    return anInstance;
+
   }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to