sparqlGraphLibrary/src/main/java/com/ge/research/semtk/ontologyTools/OntologyPath.java
public ArrayList<ClassInstance> calcMissingInstances(ArrayList<ClassInstance> instanceList) {
		HashMap<String, Integer> classHashClone = (HashMap<String, Integer>) this.classHash.clone();
		ArrayList<ClassInstance> ret = new ArrayList<ClassInstance>();
		
		for (ClassInstance instance : instanceList) {
			// is instance in classHashClone
			if (classHashClone.containsKey(instance.classUri) && classHashClone.get(instance.classUri) > 0) {
				// remove instance from the classHashClone
				classHashClone.put(instance.classUri, classHashClone.get(instance.classUri) - 1);
			} else {
				// add instance to return
				ret.add(instance);
			}
		}
		return ret;
	}
/**
	 * Return copy of classList with classes from the path removed
	 * @param classList
	 * @return
	 */
Return copy of classList with classes from the path removed
@param classList
@return
Return copy of classList with classes from the path removed @param classList @return
public ArrayList<ClassInstance> calcMissingInstances(ArrayList<ClassInstance> instanceList) {
		HashMap<String, Integer> classHashClone = (HashMap<String, Integer>) this.classHash.clone();
		ArrayList<ClassInstance> ret = new ArrayList<ClassInstance>();
		for (ClassInstance instance : instanceList) {
			if (classHashClone.containsKey(instance.classUri) && classHashClone.get(instance.classUri) > 0) {
				classHashClone.put(instance.classUri, classHashClone.get(instance.classUri) - 1);
			} else {
				ret.add(instance);
			}
		}
		return ret;
	}
public ArrayList < ClassInstance > calcMissingInstances ( ArrayList < ClassInstance > instanceList ) { HashMap < String , Integer > classHashClone = ( HashMap < String , Integer > ) this . classHash . clone ( ) ; ArrayList < ClassInstance > ret = new ArrayList < ClassInstance > ( ) ; for ( ClassInstance instance : instanceList ) { if ( classHashClone . containsKey ( instance . classUri ) && classHashClone . get ( instance . classUri ) > 0 ) { classHashClone . put ( instance . classUri , classHashClone . get ( instance . classUri ) - 1 ) ; } else { ret . add ( instance ) ; } } return ret ; }
Return copy of classList with classes from the path removed
 @param classList
 @return
Return copy of classList with classes from the path removed @param classList @return
// is instance in classHashClone // remove instance from the classHashClone // add instance to return