Skip to content

Instantly share code, notes, and snippets.

@msalvadores
Created March 26, 2012 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msalvadores/2210565 to your computer and use it in GitHub Desktop.
Save msalvadores/2210565 to your computer and use it in GitHub Desktop.
Java function to pass the api key to BioPortal SPARQL
public ResultSet executeQuery(String queryString) throws Exception {
Query query = QueryFactory.create(queryString) ;
QueryEngineHTTP qexec = QueryExecutionFactory.createServiceRequest(this.service, query)
qexec.addParam("apikey", this.apikey)
ResultSet results = qexec.execSelect() ;
return results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment