sparqlGraphLibrary/src/main/java/com/ge/research/semtk/belmont/Node.java
public void validateAgainstModel(OntologyInfo oInfo) throws Exception {
		OntologyClass oClass = oInfo.getClass(this.fullURIname);
		
		if (oClass == null) {
			throw new ValidationException("Class URI does not exist in the model: " + this.fullURIname);
		}
		
		// build hash of ontology properties for this class
		HashMap<String, OntologyProperty> oPropHash = new HashMap<>();
		for (OntologyProperty op : oInfo.getInheritedProperties(oClass)) {
			oPropHash.put(op.getNameStr(), op);
		}
		
		// check each property's URI and range
		for (PropertyItem myPropItem : this.props) {
			// domain
			if (! oPropHash.containsKey(myPropItem.getUriRelationship())) {
				throw new ValidationException(String.format("Node %s contains property %s which does not exist in the model",
									this.getSparqlID(), myPropItem.getUriRelationship()));
			}
			
			// range
			OntologyRange oRange = oPropHash.get(myPropItem.getUriRelationship()).getRange();
			if (! oRange.getFullName().equals(myPropItem.getValueTypeURI())) {
				throw new ValidationException(String.format("Node %s, property %s has type %s which doesn't match %s in model", 
									this.getSparqlID(), myPropItem.getUriRelationship(), myPropItem.getValueTypeURI(), oRange.getFullName()));
			}
		}
		
		// check node items
		for (NodeItem myNodeItem : this.nodes) {
			if (myNodeItem.getConnected()) {
				// domain
				if (! oPropHash.containsKey(myNodeItem.getUriConnectBy())) {
					throw new ValidationException(String.format("Node %s contains node connection %s which does not exist in the model",
										this.getSparqlID(), myNodeItem.getUriConnectBy()));
				}
				
				// range
				// Raghava's bug is right here
				OntologyProperty oProp = oPropHash.get(myNodeItem.getUriConnectBy());
				OntologyRange oRange = oProp.getRange();
				if (! myNodeItem.getUriValueType().equals(oRange.getFullName())) {
					ArrayList<OntologyProperty> d = oInfo.getInheritedProperties(oClass);
					throw new ValidationException(String.format("Node %s contains node connection %s with type %s which doesn't match %s in model", 
										this.getSparqlID(), myNodeItem.getUriConnectBy(), myNodeItem.getUriValueType(), oRange.getFullName()));
				}
				
				// connected node types
				for (Node n : myNodeItem.getNodeList()) {
					OntologyClass rangeClass = oInfo.getClass(oRange.getFullName());
					OntologyClass myNodeClass = oInfo.getClass(n.getFullUriName());
					if (!oInfo.classIsA(myNodeClass, rangeClass)) {
						throw new ValidationException(String.format("Node %s, node connection %s connects to node %s with type %s which isn't a type of %s in model", 
								this.getSparqlID(), myNodeItem.getUriConnectBy(), n.getSparqlID(), n.getFullUriName(), oRange.getFullName()));
					}
				}
			}
		}
	}
/**
	 * Validates that all nodeItems and propertyItems exist in the model
	 * @param oInfo
	 * @throws Exception
	 */
Validates that all nodeItems and propertyItems exist in the model
@param oInfo
@throws Exception
Validates that all nodeItems and propertyItems exist in the model @param oInfo @throws Exception
public void validateAgainstModel(OntologyInfo oInfo) throws Exception {
		OntologyClass oClass = oInfo.getClass(this.fullURIname);
		if (oClass == null) {
			throw new ValidationException("Class URI does not exist in the model: " + this.fullURIname);
		}
		HashMap<String, OntologyProperty> oPropHash = new HashMap<>();
		for (OntologyProperty op : oInfo.getInheritedProperties(oClass)) {
			oPropHash.put(op.getNameStr(), op);
		}
		for (PropertyItem myPropItem : this.props) {
			if (! oPropHash.containsKey(myPropItem.getUriRelationship())) {
				throw new ValidationException(String.format("Node %s contains property %s which does not exist in the model",
									this.getSparqlID(), myPropItem.getUriRelationship()));
			}
			OntologyRange oRange = oPropHash.get(myPropItem.getUriRelationship()).getRange();
			if (! oRange.getFullName().equals(myPropItem.getValueTypeURI())) {
				throw new ValidationException(String.format("Node %s, property %s has type %s which doesn't match %s in model", 
									this.getSparqlID(), myPropItem.getUriRelationship(), myPropItem.getValueTypeURI(), oRange.getFullName()));
			}
		}
		for (NodeItem myNodeItem : this.nodes) {
			if (myNodeItem.getConnected()) {
				if (! oPropHash.containsKey(myNodeItem.getUriConnectBy())) {
					throw new ValidationException(String.format("Node %s contains node connection %s which does not exist in the model",
										this.getSparqlID(), myNodeItem.getUriConnectBy()));
				}
				OntologyProperty oProp = oPropHash.get(myNodeItem.getUriConnectBy());
				OntologyRange oRange = oProp.getRange();
				if (! myNodeItem.getUriValueType().equals(oRange.getFullName())) {
					ArrayList<OntologyProperty> d = oInfo.getInheritedProperties(oClass);
					throw new ValidationException(String.format("Node %s contains node connection %s with type %s which doesn't match %s in model", 
										this.getSparqlID(), myNodeItem.getUriConnectBy(), myNodeItem.getUriValueType(), oRange.getFullName()));
				}
				for (Node n : myNodeItem.getNodeList()) {
					OntologyClass rangeClass = oInfo.getClass(oRange.getFullName());
					OntologyClass myNodeClass = oInfo.getClass(n.getFullUriName());
					if (!oInfo.classIsA(myNodeClass, rangeClass)) {
						throw new ValidationException(String.format("Node %s, node connection %s connects to node %s with type %s which isn't a type of %s in model", 
								this.getSparqlID(), myNodeItem.getUriConnectBy(), n.getSparqlID(), n.getFullUriName(), oRange.getFullName()));
					}
				}
			}
		}
	}
public void validateAgainstModel ( OntologyInfo oInfo ) throws Exception { OntologyClass oClass = oInfo . getClass ( this . fullURIname ) ; if ( oClass == null ) { throw new ValidationException ( "Class URI does not exist in the model: " + this . fullURIname ) ; } HashMap < String , OntologyProperty > oPropHash = new HashMap < > ( ) ; for ( OntologyProperty op : oInfo . getInheritedProperties ( oClass ) ) { oPropHash . put ( op . getNameStr ( ) , op ) ; } for ( PropertyItem myPropItem : this . props ) { if ( ! oPropHash . containsKey ( myPropItem . getUriRelationship ( ) ) ) { throw new ValidationException ( String . format ( "Node %s contains property %s which does not exist in the model" , this . getSparqlID ( ) , myPropItem . getUriRelationship ( ) ) ) ; } OntologyRange oRange = oPropHash . get ( myPropItem . getUriRelationship ( ) ) . getRange ( ) ; if ( ! oRange . getFullName ( ) . equals ( myPropItem . getValueTypeURI ( ) ) ) { throw new ValidationException ( String . format ( "Node %s, property %s has type %s which doesn't match %s in model" , this . getSparqlID ( ) , myPropItem . getUriRelationship ( ) , myPropItem . getValueTypeURI ( ) , oRange . getFullName ( ) ) ) ; } } for ( NodeItem myNodeItem : this . nodes ) { if ( myNodeItem . getConnected ( ) ) { if ( ! oPropHash . containsKey ( myNodeItem . getUriConnectBy ( ) ) ) { throw new ValidationException ( String . format ( "Node %s contains node connection %s which does not exist in the model" , this . getSparqlID ( ) , myNodeItem . getUriConnectBy ( ) ) ) ; } OntologyProperty oProp = oPropHash . get ( myNodeItem . getUriConnectBy ( ) ) ; OntologyRange oRange = oProp . getRange ( ) ; if ( ! myNodeItem . getUriValueType ( ) . equals ( oRange . getFullName ( ) ) ) { ArrayList < OntologyProperty > d = oInfo . getInheritedProperties ( oClass ) ; throw new ValidationException ( String . format ( "Node %s contains node connection %s with type %s which doesn't match %s in model" , this . getSparqlID ( ) , myNodeItem . getUriConnectBy ( ) , myNodeItem . getUriValueType ( ) , oRange . getFullName ( ) ) ) ; } for ( Node n : myNodeItem . getNodeList ( ) ) { OntologyClass rangeClass = oInfo . getClass ( oRange . getFullName ( ) ) ; OntologyClass myNodeClass = oInfo . getClass ( n . getFullUriName ( ) ) ; if ( ! oInfo . classIsA ( myNodeClass , rangeClass ) ) { throw new ValidationException ( String . format ( "Node %s, node connection %s connects to node %s with type %s which isn't a type of %s in model" , this . getSparqlID ( ) , myNodeItem . getUriConnectBy ( ) , n . getSparqlID ( ) , n . getFullUriName ( ) , oRange . getFullName ( ) ) ) ; } } } } }
Validates that all nodeItems and propertyItems exist in the model
 @param oInfo
 @throws Exception
Validates that all nodeItems and propertyItems exist in the model @param oInfo @throws Exception
// build hash of ontology properties for this class // check each property's URI and range // domain // range // check node items // domain // range // Raghava's bug is right here // connected node types