sparqlGraphLibrary/src/main/java/com/ge/research/semtk/ontologyTools/OntologyInfo.java
private boolean promoteEndClass(OntologyPath path, OntologyClass oParent) throws Exception {
		Triple lastTriple = path.getTriple(path.getLength()-1);
		String parentName = oParent.getName();
		
		if (path.getEndClassName().equals(lastTriple.getSubject())) {
			// promote subject of last triple
			if (this.getInheritedPropertyByUri(oParent, lastTriple.getPredicate()) != null) {
				// parent has property
				lastTriple.setSubject(parentName);
				path.setEndClassName(parentName);
				return true;
			} else {
				return false;
			}
			
		} else {
			// promote object of last triple
			OntologyClass oSubject = this.getClass(lastTriple.getSubject());
			OntologyProperty oPred = this.getInheritedPropertyByUri(oSubject, lastTriple.getPredicate());
			if (this.classIsInRange(oParent, oPred.getRange())) {
				// parent is in range of property
				lastTriple.setObject(parentName);
				path.setEndClassName(parentName);
				return true;
			} else {
				return false;
			}
		}
	}
/**
	 * Promote endClass of a Path to the named parent class name  IF ONTOLOGY ALLOWS.
	 * @param path
	 * @param parentName
	 * @return boolean - true if successful
	 * @throws Exception 
	 */
Promote endClass of a Path to the named parent class name  IF ONTOLOGY ALLOWS.
@param path
@param parentName
@return boolean - true if successful
@throws Exception
Promote endClass of a Path to the named parent class name IF ONTOLOGY ALLOWS . @param path @param parentName @return boolean - true if successful @throws Exception
private boolean promoteEndClass(OntologyPath path, OntologyClass oParent) throws Exception {
		Triple lastTriple = path.getTriple(path.getLength()-1);
		String parentName = oParent.getName();
		if (path.getEndClassName().equals(lastTriple.getSubject())) {
			if (this.getInheritedPropertyByUri(oParent, lastTriple.getPredicate()) != null) {
				lastTriple.setSubject(parentName);
				path.setEndClassName(parentName);
				return true;
			} else {
				return false;
			}
		} else {
			OntologyClass oSubject = this.getClass(lastTriple.getSubject());
			OntologyProperty oPred = this.getInheritedPropertyByUri(oSubject, lastTriple.getPredicate());
			if (this.classIsInRange(oParent, oPred.getRange())) {
				lastTriple.setObject(parentName);
				path.setEndClassName(parentName);
				return true;
			} else {
				return false;
			}
		}
	}
private boolean promoteEndClass ( OntologyPath path , OntologyClass oParent ) throws Exception { Triple lastTriple = path . getTriple ( path . getLength ( ) - 1 ) ; String parentName = oParent . getName ( ) ; if ( path . getEndClassName ( ) . equals ( lastTriple . getSubject ( ) ) ) { if ( this . getInheritedPropertyByUri ( oParent , lastTriple . getPredicate ( ) ) != null ) { lastTriple . setSubject ( parentName ) ; path . setEndClassName ( parentName ) ; return true ; } else { return false ; } } else { OntologyClass oSubject = this . getClass ( lastTriple . getSubject ( ) ) ; OntologyProperty oPred = this . getInheritedPropertyByUri ( oSubject , lastTriple . getPredicate ( ) ) ; if ( this . classIsInRange ( oParent , oPred . getRange ( ) ) ) { lastTriple . setObject ( parentName ) ; path . setEndClassName ( parentName ) ; return true ; } else { return false ; } } }
Promote endClass of a Path to the named parent class name  IF ONTOLOGY ALLOWS.
Promote endClass of a Path to the named parent class name IF ONTOLOGY ALLOWS .
// promote subject of last triple // parent has property // promote object of last triple // parent is in range of property