public function TripalWebServiceResource::getURI

3.x TripalWebServiceResource.inc public TripalWebServiceResource::getURI($id)

Retrieves the IRI for an entity of a given ID in this web service.

Parameters

$id: The unique identifier for the resource.

1 call to TripalWebServiceResource::getURI()
TripalWebServiceResource::setID in tripal_ws/includes/TripalWebServiceResource.inc
Set's the unique identifier for the resource.

File

tripal_ws/includes/TripalWebServiceResource.inc, line 228

Class

TripalWebServiceResource

Code

public function getURI($id) {
  // If this is a key/value pair for an id and if the vocab portion is
  // an underscore then this represents a blank node and we don't want
  // to add the full path.
  $matches = array();
  if (preg_match('/^(.*?):(.*?)$/', $id, $matches)) {
    $vocab = $matches[1];
    if ($vocab == '_') {
      return $id;
    }
    return $id;
  }
  else {
    return $this->service_path . '/' . $id;
  }
}