src/main/java/org/vivoweb/harvester/ingest/AcademicFetchFromED.java
/**
		 * @param pb the people bean with all the data that has to be inserted from ED
		 * This function inserts inference triples for the people data
		 */
@param pb the people bean with all the data that has to be inserted from ED
This function inserts inference triples for the people data
@param pb the people bean with all the data that has to be inserted from ED This function inserts inference triples for the people data
private void insertInferenceTriples(PeopleBean pb) {
			StringBuilder sb = new StringBuilder();
			sb.append("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n");
			sb.append("PREFIX wcmc: <http://weill.cornell.edu/vivo/ontology/wcmc#> \n");
			sb.append("PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n");
			sb.append("PREFIX vivo: <http://vivoweb.org/ontology/core#> \n");
			sb.append("PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n");
			sb.append("PREFIX obo: <http://purl.obolibrary.org/obo/> \n");
			sb.append("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n");
			sb.append("PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n");
			sb.append( "PREFIX core: <http://vivoweb.org/ontology/core#> \n");
			sb.append("INSERT DATA { GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> { \n");
			/*sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Geo . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Explanatory . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Geographical . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Addressing . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Thing . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Communication . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Calendar . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Identification . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Organizational . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:TimeZone . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Security . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> vitro:mostSpecificType vcard:Title . \n");*/
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type obo:BFO_0000002 . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type obo:BFO_0000031 . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type obo:ARG_2000379 . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type vcard:Kind . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type obo:BFO_0000001 . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type obo:IAO_0000030 . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> rdf:type <http://www.w3.org/2002/07/owl#Thing> . \n");
			sb.append("<" + this.vivoNamespace + "arg2000028-"  + pb.getCwid().trim() + "> vitro:mostSpecificType vcard:Individual . \n");
			sb.append("}}");
			if(ingestType.equals(IngestType.VIVO_API.toString())) {
				try{
					String response = this.vivoClient.vivoUpdateApi(sb.toString());
					log.info(response);
				} catch(Exception  e) {
					log.info("Api Exception", e);
				}
			} else if(ingestType.equals(IngestType.SDB_DIRECT.toString())){
				TDBJenaConnect vivoJena = this.tcf.getConnectionfromPool("dataSet");
				try{
					vivoJena.executeUpdateQuery(sb.toString(),true);
				}
				catch(IOException e) {
					log.error("Error connecting to Jena Database", e);
				}
				if(vivoJena != null)
					this.tcf.returnConnectionToPool(vivoJena, "dataSet");
			} else {
				TDBJenaConnect vivoJena = this.tcf.createNewDataSetConnectionForPool();
				try{
					runTDBSparqlUpdateTemplate(sb.toString(), vivoJena);
				}
				catch(IOException e) {
					log.error("Error connecting to Jena Database", e);
				}
				if(vivoJena != null)
					vivoJena.getDataset().close();
			}
		}
private void insertInferenceTriples ( PeopleBean pb ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" ) ; sb . append ( "PREFIX wcmc: <http://weill.cornell.edu/vivo/ontology/wcmc#> \n" ) ; sb . append ( "PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n" ) ; sb . append ( "PREFIX vivo: <http://vivoweb.org/ontology/core#> \n" ) ; sb . append ( "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n" ) ; sb . append ( "PREFIX obo: <http://purl.obolibrary.org/obo/> \n" ) ; sb . append ( "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" ) ; sb . append ( "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n" ) ; sb . append ( "PREFIX core: <http://vivoweb.org/ontology/core#> \n" ) ; sb . append ( "INSERT DATA { GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> { \n" ) ; /*sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Geo . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Explanatory . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Geographical . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Addressing . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Thing . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Communication . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Calendar . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Identification . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Organizational . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:TimeZone . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> rdf:type vcard:Security . \n");
			sb.append(this.vivoNamespace + "hasTitle-"  + pb.getCwid().trim() + "> vitro:mostSpecificType vcard:Title . \n");*/ sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type obo:BFO_0000002 . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type obo:BFO_0000031 . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type obo:ARG_2000379 . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type vcard:Kind . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type obo:BFO_0000001 . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type obo:IAO_0000030 . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> rdf:type <http://www.w3.org/2002/07/owl#Thing> . \n" ) ; sb . append ( "<" + this . vivoNamespace + "arg2000028-" + pb . getCwid ( ) . trim ( ) + "> vitro:mostSpecificType vcard:Individual . \n" ) ; sb . append ( "}}" ) ; if ( ingestType . equals ( IngestType . VIVO_API . toString ( ) ) ) { try { String response = this . vivoClient . vivoUpdateApi ( sb . toString ( ) ) ; log . info ( response ) ; } catch ( Exception e ) { log . info ( "Api Exception" , e ) ; } } else if ( ingestType . equals ( IngestType . SDB_DIRECT . toString ( ) ) ) { TDBJenaConnect vivoJena = this . tcf . getConnectionfromPool ( "dataSet" ) ; try { vivoJena . executeUpdateQuery ( sb . toString ( ) , true ) ; } catch ( IOException e ) { log . error ( "Error connecting to Jena Database" , e ) ; } if ( vivoJena != null ) this . tcf . returnConnectionToPool ( vivoJena , "dataSet" ) ; } else { TDBJenaConnect vivoJena = this . tcf . createNewDataSetConnectionForPool ( ) ; try { runTDBSparqlUpdateTemplate ( sb . toString ( ) , vivoJena ) ; } catch ( IOException e ) { log . error ( "Error connecting to Jena Database" , e ) ; } if ( vivoJena != null ) vivoJena . getDataset ( ) . close ( ) ; } }
@param pb the people bean with all the data that has to be inserted from ED
 This function inserts inference triples for the people data
@param pb the people bean with all the data that has to be inserted from ED This function inserts inference triples for the people data
//Title Inference Triples //For email and primary title