sparqlGraphLibrary/src/main/java/com/ge/research/semtk/ontologyTools/OntologyInfo.java
public void loadProperties(String classList[], String propertyList[], String rangeList[]) throws Exception{
		 
		final boolean DEBUG_RANGE = false;   // print message when range is changed to superclass of two different ranges
		
		// loop through and make the property, pull class...
		for(int i = 0; i < classList.length; i += 1){
			//////////////// new bug 5/2021 needs looking at properties query ////////////////////
			// skip rows with empty range if there's another identical one with range
			// seems to be caused by sadl "with values of type { A or B } "
			boolean skipRow = false;
			if (rangeList[i].isEmpty()) {
				for (int j=0; j < classList.length; j++) {
					if (classList[j].equals(classList[i]) && propertyList[j].equals(propertyList[i]) && !rangeList[j].isEmpty()) {
						skipRow = true;
						break;
					}
				}
			}
			if (skipRow) {
				continue;
			}
			
			////////////////////////////////////
			
			OntologyProperty prop = null;
			
			// get prop from propertyHash, or create it
			if (this.propertyHash.containsKey(propertyList[i])) {
				prop = this.propertyHash.get(propertyList[i]);
				
				// if property exists, and range is different 
				// (ignore this if prop RANGE is already defaultClass or new range is empty)
				if (! prop.getRangeStr().equals(rangeList[i]) && !prop.getRange().isDefaultClass() && !rangeList[i].isEmpty()) {
					String superClass = this.findLowestCommonSuperclass(prop.getRangeStr(), rangeList[i]);
					
					if (superClass != null) {
						// Set range to common superclass of different range classes
						// ignore subclass restrictions on ranges for now, until complex ranges are implemented
						// Paul Aug 2020
						
						if (DEBUG_RANGE) {
							LocalLogger.logToStdOut(classList[i] + "->" + propertyList[i] + ": prev: " + prop.getRangeStr() + " curr: " + rangeList[i] + " new super" + superClass);
						}
						
						// make the change
						prop.setRange(new OntologyRange(superClass));
						
					} else {
						// throw error
						throw new Exception(String.format("SemTk doesn't handle complex ranges.\nClass %s property domain %s\nrange 1: %s\nrange 2: %s",
										  classList[i], 
										  propertyList[i], 
										  this.propertyHash.get(propertyList[i]).getRangeStr(),
										  rangeList[i]));
					}
				}
			} else {
				// if property doesn't exist, create it
				prop = new OntologyProperty(propertyList[i], rangeList[i]);
				this.propertyHash.put(propertyList[i], prop);
			}

			if (classList[i].trim().isEmpty()) {
				// Property has no domain/class. 
				this.orphanProps.put(propertyList[i], prop);
				
			} else {
				// Add property to the class
				OntologyClass c = this.classHash.get(classList[i]);
				if(c == null){
					throw new Exception("Cannot find class " + classList[i] + " in the ontology");
				}			
				c.addProperty(prop);
			}			
		}
		
		// clean up orphans.  Owl may  it once with no domain, and another time with.
		Set<String> toDel = new HashSet<String>();
		for (String orphan : this.orphanProps.keySet()) {
			if (this.getPropertyDomain(this.orphanProps.get(orphan)).size() > 0) {
				toDel.add(orphan);
			}
		}
		
		for (String k : toDel) {
			this.orphanProps.remove(k);
		}
	}
/**
	 * process the results of the properties sparql query and loads them into the properties hashmap
	 * in the OntologyInfo object.
	 * 
	 * Properties (data or object) are attached to cl
	 */
process the results of the properties sparql query and loads them into the properties hashmap
in the OntologyInfo object.

Properties (data or object) are attached to cl
process the results of the properties sparql query and loads them into the properties hashmap in the OntologyInfo object . Properties ( data or object ) are attached to cl
public void loadProperties(String classList[], String propertyList[], String rangeList[]) throws Exception{
		final boolean DEBUG_RANGE = false;   
		for(int i = 0; i < classList.length; i += 1){
			boolean skipRow = false;
			if (rangeList[i].isEmpty()) {
				for (int j=0; j < classList.length; j++) {
					if (classList[j].equals(classList[i]) && propertyList[j].equals(propertyList[i]) && !rangeList[j].isEmpty()) {
						skipRow = true;
						break;
					}
				}
			}
			if (skipRow) {
				continue;
			}
			OntologyProperty prop = null;
			if (this.propertyHash.containsKey(propertyList[i])) {
				prop = this.propertyHash.get(propertyList[i]);
				if (! prop.getRangeStr().equals(rangeList[i]) && !prop.getRange().isDefaultClass() && !rangeList[i].isEmpty()) {
					String superClass = this.findLowestCommonSuperclass(prop.getRangeStr(), rangeList[i]);
					if (superClass != null) {
						if (DEBUG_RANGE) {
							LocalLogger.logToStdOut(classList[i] + "->" + propertyList[i] + ": prev: " + prop.getRangeStr() + " curr: " + rangeList[i] + " new super" + superClass);
						}
						prop.setRange(new OntologyRange(superClass));
					} else {
						throw new Exception(String.format("SemTk doesn't handle complex ranges.\nClass %s property domain %s\nrange 1: %s\nrange 2: %s",
										  classList[i], 
										  propertyList[i], 
										  this.propertyHash.get(propertyList[i]).getRangeStr(),
										  rangeList[i]));
					}
				}
			} else {
				prop = new OntologyProperty(propertyList[i], rangeList[i]);
				this.propertyHash.put(propertyList[i], prop);
			}
			if (classList[i].trim().isEmpty()) {
				this.orphanProps.put(propertyList[i], prop);
			} else {
				OntologyClass c = this.classHash.get(classList[i]);
				if(c == null){
					throw new Exception("Cannot find class " + classList[i] + " in the ontology");
				}			
				c.addProperty(prop);
			}			
		}
		Set<String> toDel = new HashSet<String>();
		for (String orphan : this.orphanProps.keySet()) {
			if (this.getPropertyDomain(this.orphanProps.get(orphan)).size() > 0) {
				toDel.add(orphan);
			}
		}
		for (String k : toDel) {
			this.orphanProps.remove(k);
		}
	}
public void loadProperties ( String classList [ ] , String propertyList [ ] , String rangeList [ ] ) throws Exception { final boolean DEBUG_RANGE = false ; for ( int i = 0 ; i < classList . length ; i += 1 ) { boolean skipRow = false ; if ( rangeList [ i ] . isEmpty ( ) ) { for ( int j = 0 ; j < classList . length ; j ++ ) { if ( classList [ j ] . equals ( classList [ i ] ) && propertyList [ j ] . equals ( propertyList [ i ] ) && ! rangeList [ j ] . isEmpty ( ) ) { skipRow = true ; break ; } } } if ( skipRow ) { continue ; } OntologyProperty prop = null ; if ( this . propertyHash . containsKey ( propertyList [ i ] ) ) { prop = this . propertyHash . get ( propertyList [ i ] ) ; if ( ! prop . getRangeStr ( ) . equals ( rangeList [ i ] ) && ! prop . getRange ( ) . isDefaultClass ( ) && ! rangeList [ i ] . isEmpty ( ) ) { String superClass = this . findLowestCommonSuperclass ( prop . getRangeStr ( ) , rangeList [ i ] ) ; if ( superClass != null ) { if ( DEBUG_RANGE ) { LocalLogger . logToStdOut ( classList [ i ] + "->" + propertyList [ i ] + ": prev: " + prop . getRangeStr ( ) + " curr: " + rangeList [ i ] + " new super" + superClass ) ; } prop . setRange ( new OntologyRange ( superClass ) ) ; } else { throw new Exception ( String . format ( "SemTk doesn't handle complex ranges.\nClass %s property domain %s\nrange 1: %s\nrange 2: %s" , classList [ i ] , propertyList [ i ] , this . propertyHash . get ( propertyList [ i ] ) . getRangeStr ( ) , rangeList [ i ] ) ) ; } } } else { prop = new OntologyProperty ( propertyList [ i ] , rangeList [ i ] ) ; this . propertyHash . put ( propertyList [ i ] , prop ) ; } if ( classList [ i ] . trim ( ) . isEmpty ( ) ) { this . orphanProps . put ( propertyList [ i ] , prop ) ; } else { OntologyClass c = this . classHash . get ( classList [ i ] ) ; if ( c == null ) { throw new Exception ( "Cannot find class " + classList [ i ] + " in the ontology" ) ; } c . addProperty ( prop ) ; } } Set < String > toDel = new HashSet < String > ( ) ; for ( String orphan : this . orphanProps . keySet ( ) ) { if ( this . getPropertyDomain ( this . orphanProps . get ( orphan ) ) . size ( ) > 0 ) { toDel . add ( orphan ) ; } } for ( String k : toDel ) { this . orphanProps . remove ( k ) ; } }
process the results of the properties sparql query and loads them into the properties hashmap
 in the OntologyInfo object.
process the results of the properties sparql query and loads them into the properties hashmap in the OntologyInfo object .
// print message when range is changed to superclass of two different ranges // loop through and make the property, pull class... //////////////// new bug 5/2021 needs looking at properties query //////////////////// // skip rows with empty range if there's another identical one with range // seems to be caused by sadl "with values of type { A or B } " //////////////////////////////////// // get prop from propertyHash, or create it // if property exists, and range is different  // (ignore this if prop RANGE is already defaultClass or new range is empty) // Set range to common superclass of different range classes // ignore subclass restrictions on ranges for now, until complex ranges are implemented // Paul Aug 2020 // make the change // throw error // if property doesn't exist, create it // Property has no domain/class.  // Add property to the class // clean up orphans.  Owl may  it once with no domain, and another time with.