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