Skip to content

Commit

Permalink
All parameters now URL encoded, PW methods go through IMS instead of …
Browse files Browse the repository at this point in the history
…expander

Conflicts:
	ops_ims.class.php
  • Loading branch information
antonisloizou authored and stain committed Jul 23, 2015
1 parent 3f42d7a commit 52e9f14
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ops_ims.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OpsIms {



var $expander_variables = array('?cw_uri' , '?ocrs_uri' , '?db_uri' , '?chembl_uri' , '?uniprot_uri' , '?pw_uri' , '?aers_uri');
var $expander_variables = array('?cw_uri' , '?ocrs_uri' , '?db_uri' , '?chembl_uri' , '?uniprot_uri' , '?aers_uri');

function expandQuery ( $query , $input_uri, $lens ) {
$params='';
Expand Down Expand Up @@ -65,8 +65,10 @@ private function expandQueryThroughIMS($query, $input_uri, $lens){
$variableInfoMap[$variableName] = array();
$url = IMS_MAP_ENDPOINT;
$url .= '?rdfFormat=RDF/XML';
$url .= "&targetUriPattern={$pattern}";
$url .= '&overridePredicateURI=http://www.w3.org/2004/02/skos/core#exactMatch';
if ($pattern != '') {
$url .= '&targetUriPattern='.urlencode($pattern);
}
$url .= '&overridePredicateURI='.urlencode('http://www.w3.org/2004/02/skos/core#exactMatch');
$url .= '&lensUri=';
if ($lens==''){
$url .= 'Default';
Expand Down Expand Up @@ -143,7 +145,7 @@ private function handleAvailableResponses($multiHandle, $input_uri, $variableInf

private function handleResponse($varInfo, $multiHandle, $input_uri, $variableName, &$variableInfoMap){
$response = curl_multi_getcontent($varInfo['handle']);
//logDebug("IMS Response: {$response}");
//logDebug("IMS Response: {$response}");
curl_close($varInfo['handle']);
curl_multi_remove_handle($multiHandle, $varInfo['handle']);
//echo $url;
Expand Down Expand Up @@ -191,8 +193,10 @@ function expandBatchQuery( $query , $uriList, $lens) {
$expanded = array();
$urlStart = IMS_MAP_ENDPOINT;
$urlStart .= '?rdfFormat=N-Triples';
$urlStart .= "&targetUriPattern={$pattern}";
$urlStart .= '&overridePredicateURI=http://www.w3.org/2004/02/skos/core#exactMatch';
if ($pattern != '') {
$url .= '&targetUriPattern='.urlencode($pattern);
}
$urlStart .= '&overridePredicateURI='.urlencode('http://www.w3.org/2004/02/skos/core#exactMatch');
$urlStart .= '&lensUri=';
if ($lens==''){
$urlStart .= 'Default';
Expand Down

0 comments on commit 52e9f14

Please sign in to comment.