@@ -19,9 +19,9 @@ |
||
| 19 | 19 | |
| 20 | 20 | $graph = new EasyRdf\Graph($this->uri); |
| 21 | 21 | $params1 = http_build_query(array('subject' => $this->uri, 'predicate' => 'rdfs:label')); |
| 22 | - $graph->load($this->ldfEndpoint . '?' . $params1); |
|
| 22 | + $graph->load($this->ldfEndpoint.'?'.$params1); |
|
| 23 | 23 | $params2 = http_build_query(array('object' => $this->uri, 'predicate' => 'schema:about')); |
| 24 | - $graph->load($this->ldfEndpoint . '?' . $params2); |
|
| 24 | + $graph->load($this->ldfEndpoint.'?'.$params2); |
|
| 25 | 25 | return $graph->resource($this->uri); |
| 26 | 26 | } catch (Exception $e) { |
| 27 | 27 | // FIXME proper logging needed |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $opts = array('http' => array('method'=>'HEAD', |
| 19 | 19 | 'user_agent' => 'Skosmos', |
| 20 | 20 | 'timeout' => $timeout)); |
| 21 | - $context = stream_context_create($opts); |
|
| 21 | + $context = stream_context_create($opts); |
|
| 22 | 22 | $fd = fopen($this->uri, 'rb', false, $context); |
| 23 | 23 | $headers = stream_get_meta_data($fd)['wrapper_data']; |
| 24 | 24 | foreach ($headers as $header) { |
@@ -220,18 +220,18 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | $vocabs = $params->getVocabs(); |
| 223 | - $showDeprecated=false; |
|
| 223 | + $showDeprecated = false; |
|
| 224 | 224 | if (sizeof($vocabs) === 1) { // search within vocabulary |
| 225 | 225 | $voc = $vocabs[0]; |
| 226 | 226 | $sparql = $voc->getSparql(); |
| 227 | - $showDeprecated=$voc->getConfig()->getShowDeprecated(); |
|
| 227 | + $showDeprecated = $voc->getConfig()->getShowDeprecated(); |
|
| 228 | 228 | } else { // multi-vocabulary or global search |
| 229 | 229 | $voc = null; |
| 230 | 230 | $sparql = $this->getDefaultSparql(); |
| 231 | 231 | // @TODO : in a global search showDeprecated will always be false and cannot be set globally |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $results = $sparql->queryConcepts($vocabs, $params->getAdditionalFields(), $params->getUnique(), $params,$showDeprecated); |
|
| 234 | + $results = $sparql->queryConcepts($vocabs, $params->getAdditionalFields(), $params->getUnique(), $params, $showDeprecated); |
|
| 235 | 235 | if ($params->getRest() && $results && $params->getSearchLimit() !== 0) { |
| 236 | 236 | $results = array_slice($results, $params->getOffset(), $params->getSearchLimit()); |
| 237 | 237 | } |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | public function getVocabularyCategories() |
| 387 | 387 | { |
| 388 | 388 | $cats = $this->globalConfig->getGraph()->allOfType('skos:Concept'); |
| 389 | - if(empty($cats)) { |
|
| 389 | + if (empty($cats)) { |
|
| 390 | 390 | return array(new VocabularyCategory($this, null)); |
| 391 | 391 | } |
| 392 | 392 | |
@@ -469,9 +469,9 @@ discard block |
||
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | // if there are multiple vocabularies and one is the preferred vocabulary, return it |
| 472 | - if($preferredVocabId != null) { |
|
| 472 | + if ($preferredVocabId != null) { |
|
| 473 | 473 | foreach ($vocabs as $vocab) { |
| 474 | - if($vocab->getId() == $preferredVocabId) { |
|
| 474 | + if ($vocab->getId() == $preferredVocabId) { |
|
| 475 | 475 | // double check that a label exists in the preferred vocabulary |
| 476 | 476 | if ($vocab->getConceptLabel($uri, null) !== null) { |
| 477 | 477 | return $vocab; |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | // using apc cache for the resource if available |
| 554 | 554 | if ($this->globalConfig->getCache()->isAvailable()) { |
| 555 | 555 | // @codeCoverageIgnoreStart |
| 556 | - $key = 'fetch: ' . $uri; |
|
| 556 | + $key = 'fetch: '.$uri; |
|
| 557 | 557 | $resource = $this->globalConfig->getCache()->fetch($key); |
| 558 | 558 | if ($resource === null || $resource === false) { // was not found in cache, or previous request failed |
| 559 | 559 | $resource = $this->resolver->resolve($uri, $this->getConfig()->getHttpTimeout()); |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | */ |
| 575 | 575 | public function getSparqlImplementation($dialect, $endpoint, $graph) |
| 576 | 576 | { |
| 577 | - $classname = $dialect . "Sparql"; |
|
| 577 | + $classname = $dialect."Sparql"; |
|
| 578 | 578 | |
| 579 | 579 | return new $classname($endpoint, $graph, $this); |
| 580 | 580 | } |