@@ -76,10 +76,12 @@ |
||
| 76 | 76 | */ |
| 77 | 77 | public function getUriSpace() |
| 78 | 78 | { |
| 79 | - if ($this->urispace === null) // initialize cache |
|
| 79 | + if ($this->urispace === null) { |
|
| 80 | + // initialize cache |
|
| 80 | 81 | { |
| 81 | 82 | $this->urispace = $this->resource->getLiteral('void:uriSpace')->getValue(); |
| 82 | 83 | } |
| 84 | + } |
|
| 83 | 85 | |
| 84 | 86 | return $this->urispace; |
| 85 | 87 | } |
@@ -598,6 +598,9 @@ |
||
| 598 | 598 | return $bydate; |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | + /** |
|
| 602 | + * @param string $lang |
|
| 603 | + */ |
|
| 601 | 604 | public function getTitle($lang=null) { |
| 602 | 605 | return $this->config->getTitle($lang); |
| 603 | 606 | } |
@@ -10,6 +10,9 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class VocabularyCategory extends DataObject |
| 12 | 12 | { |
| 13 | + /** |
|
| 14 | + * @param Model $model |
|
| 15 | + */ |
|
| 13 | 16 | public function __construct($model, $resource) |
| 14 | 17 | { |
| 15 | 18 | if (!($model instanceof Model)) { |
@@ -55,6 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Steps back, restoring the previous character or statement read() to the input buffer. |
| 58 | + * @param string $chars |
|
| 58 | 59 | */ |
| 59 | 60 | protected function unread($chars) |
| 60 | 61 | { |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | * Returns information (as a graph) for one or more concept URIs |
| 454 | 454 | * @param mixed $uris concept URI (string) or array of URIs |
| 455 | 455 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
| 456 | - * @param \Vocabulary[]|null $vocabs vocabularies to target |
|
| 456 | + * @param Vocabulary[] $vocabs vocabularies to target |
|
| 457 | 457 | * @return \Concept[] |
| 458 | 458 | */ |
| 459 | 459 | public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) { |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | |
| 674 | 674 | /** |
| 675 | 675 | * Generate a VALUES clause for limiting the targeted graphs. |
| 676 | - * @param Vocabulary[]|null $vocabs array of Vocabulary objects to target |
|
| 676 | + * @param Vocabulary[] $vocabs array of Vocabulary objects to target |
|
| 677 | 677 | * @return string VALUES clause, or "" if not necessary to limit |
| 678 | 678 | */ |
| 679 | 679 | protected function formatValuesGraph($vocabs) { |
@@ -853,6 +853,7 @@ discard block |
||
| 853 | 853 | * @param string $searchLang language code used for matching labels (null means any language) |
| 854 | 854 | * @param string[] $props properties to target e.g. array('skos:prefLabel','skos:altLabel') |
| 855 | 855 | * @param boolean $unique restrict results to unique concepts (default: false) |
| 856 | + * @param string $filterGraph |
|
| 856 | 857 | * @return string sparql query |
| 857 | 858 | */ |
| 858 | 859 | protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph) |
@@ -1118,6 +1119,7 @@ discard block |
||
| 1118 | 1119 | /** |
| 1119 | 1120 | * Generates sparql query clauses used for creating the alphabetical index. |
| 1120 | 1121 | * @param string $letter the letter (or special class) to search for |
| 1122 | + * @param string $lang |
|
| 1121 | 1123 | * @return array of sparql query clause strings |
| 1122 | 1124 | */ |
| 1123 | 1125 | private function formatFilterConditions($letter, $lang) { |
@@ -46,12 +46,16 @@ discard block |
||
| 46 | 46 | $this->client = new EasyRdf\Sparql\Client($endpoint); |
| 47 | 47 | |
| 48 | 48 | // set graphClause so that it can be used by all queries |
| 49 | - if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable) |
|
| 49 | + if ($this->isDefaultEndpoint()) { |
|
| 50 | + // default endpoint; query any graph (and catch it in a variable) |
|
| 50 | 51 | { |
| 51 | 52 | $this->graphClause = "GRAPH $graph"; |
| 52 | - } elseif ($graph) // query a specific graph |
|
| 53 | + } |
|
| 54 | + } elseif ($graph) { |
|
| 55 | + // query a specific graph |
|
| 53 | 56 | { |
| 54 | 57 | $this->graphClause = "GRAPH <$graph>"; |
| 58 | + } |
|
| 55 | 59 | } else // query the default graph |
| 56 | 60 | { |
| 57 | 61 | $this->graphClause = ""; |
@@ -100,8 +104,9 @@ discard block |
||
| 100 | 104 | } |
| 101 | 105 | } |
| 102 | 106 | foreach ($graphs as $graph) { |
| 103 | - if($graph !== NULL) |
|
| 104 | - $clause .= "FROM NAMED <$graph> "; |
|
| 107 | + if($graph !== NULL) { |
|
| 108 | + $clause .= "FROM NAMED <$graph> "; |
|
| 109 | + } |
|
| 105 | 110 | } |
| 106 | 111 | return $clause; |
| 107 | 112 | } |
@@ -1847,8 +1852,7 @@ discard block |
||
| 1847 | 1852 | if (sizeof($ret) > 0) { |
| 1848 | 1853 | // existing concept, with children |
| 1849 | 1854 | return $ret; |
| 1850 | - } |
|
| 1851 | - else { |
|
| 1855 | + } else { |
|
| 1852 | 1856 | // nonexistent concept |
| 1853 | 1857 | return null; |
| 1854 | 1858 | } |
@@ -79,10 +79,12 @@ |
||
| 79 | 79 | if ($sortable !== null) { |
| 80 | 80 | uksort($sortable, array($this, 'mycompare')); |
| 81 | 81 | foreach ($sortable as $prop => $vals) { |
| 82 | - if (is_array($prop)) // the ConceptProperty objects have their own sorting methods |
|
| 82 | + if (is_array($prop)) { |
|
| 83 | + // the ConceptProperty objects have their own sorting methods |
|
| 83 | 84 | { |
| 84 | 85 | ksort($sortable[$prop]); |
| 85 | 86 | } |
| 87 | + } |
|
| 86 | 88 | } |
| 87 | 89 | } |
| 88 | 90 | return $sortable; |
@@ -50,6 +50,7 @@ discard block |
||
| 50 | 50 | * @param Vocabulary $vocab |
| 51 | 51 | * @param EasyRdf\Resource $resource |
| 52 | 52 | * @param EasyRdf\Graph $graph |
| 53 | + * @param string|null $clang |
|
| 53 | 54 | */ |
| 54 | 55 | public function __construct($model, $vocab, $resource, $graph, $clang) |
| 55 | 56 | { |
@@ -526,6 +527,7 @@ discard block |
||
| 526 | 527 | |
| 527 | 528 | /** |
| 528 | 529 | * Gets the groups/arrays the concept belongs to. |
| 530 | + * @param boolean $includeArrays |
|
| 529 | 531 | */ |
| 530 | 532 | public function getReverseResources($includeArrays) { |
| 531 | 533 | $groups = array(); |
@@ -312,8 +312,7 @@ discard block |
||
| 312 | 312 | foreach ($res->propertyUris() as $prop) { |
| 313 | 313 | $this->addPropertyValues($res, $prop, $seen); |
| 314 | 314 | } |
| 315 | - } |
|
| 316 | - else { |
|
| 315 | + } else { |
|
| 317 | 316 | foreach ($props as $prop) { |
| 318 | 317 | if ($res->hasProperty($prop)) { |
| 319 | 318 | $this->addPropertyValues($res, $prop, $seen); |
@@ -850,8 +849,7 @@ discard block |
||
| 850 | 849 | if (!in_array($vocabUriSpace, $context, true)) { |
| 851 | 850 | if (!isset($context[$vocabPrefix])) { |
| 852 | 851 | $context[$vocabPrefix] = $vocabUriSpace; |
| 853 | - } |
|
| 854 | - else if ($context[$vocabPrefix] !== $vocabUriSpace) { |
|
| 852 | + } else if ($context[$vocabPrefix] !== $vocabUriSpace) { |
|
| 855 | 853 | $i = 2; |
| 856 | 854 | while (isset($context[$vocabPrefix . $i]) && $context[$vocabPrefix . $i] !== $vocabUriSpace) { |
| 857 | 855 | $i += 1; |
@@ -3,6 +3,9 @@ |
||
| 3 | 3 | class LabelSkosXL extends DataObject |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | + /** |
|
| 7 | + * @param Model $model |
|
| 8 | + */ |
|
| 6 | 9 | public function __construct($model, $resource) |
| 7 | 10 | { |
| 8 | 11 | parent::__construct($model, $resource); |
@@ -69,8 +69,9 @@ |
||
| 69 | 69 | public function getSearchTerm() |
| 70 | 70 | { |
| 71 | 71 | $term = $this->request->getQueryParamRaw('q') ? $this->request->getQueryParamRaw('q') : $this->request->getQueryParamRaw('query'); |
| 72 | - if (!$term && $this->rest) |
|
| 73 | - $term = $this->request->getQueryParamRaw('label'); |
|
| 72 | + if (!$term && $this->rest) { |
|
| 73 | + $term = $this->request->getQueryParamRaw('label'); |
|
| 74 | + } |
|
| 74 | 75 | $term = trim($term); // surrounding whitespace is not considered significant |
| 75 | 76 | if ($this->rest) { |
| 76 | 77 | return $term; |
@@ -400,7 +400,9 @@ discard block |
||
| 400 | 400 | $hits[] = $res; |
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | - if (sizeof($hits) > 0) return $hits; |
|
| 403 | + if (sizeof($hits) > 0) { |
|
| 404 | + return $hits; |
|
| 405 | + } |
|
| 404 | 406 | |
| 405 | 407 | // case 2: case-insensitive match on preferred label |
| 406 | 408 | foreach ($results as $res) { |
@@ -408,7 +410,9 @@ discard block |
||
| 408 | 410 | $hits[] = $res; |
| 409 | 411 | } |
| 410 | 412 | } |
| 411 | - if (sizeof($hits) > 0) return $hits; |
|
| 413 | + if (sizeof($hits) > 0) { |
|
| 414 | + return $hits; |
|
| 415 | + } |
|
| 412 | 416 | |
| 413 | 417 | if ($lang === null) { |
| 414 | 418 | // case 1A: exact match on preferred label in any language |
@@ -419,7 +423,9 @@ discard block |
||
| 419 | 423 | $hits[] = $res; |
| 420 | 424 | } |
| 421 | 425 | } |
| 422 | - if (sizeof($hits) > 0) return $hits; |
|
| 426 | + if (sizeof($hits) > 0) { |
|
| 427 | + return $hits; |
|
| 428 | + } |
|
| 423 | 429 | |
| 424 | 430 | // case 2A: case-insensitive match on preferred label in any language |
| 425 | 431 | foreach ($results as $res) { |
@@ -429,7 +435,9 @@ discard block |
||
| 429 | 435 | $hits[] = $res; |
| 430 | 436 | } |
| 431 | 437 | } |
| 432 | - if (sizeof($hits) > 0) return $hits; |
|
| 438 | + if (sizeof($hits) > 0) { |
|
| 439 | + return $hits; |
|
| 440 | + } |
|
| 433 | 441 | } |
| 434 | 442 | |
| 435 | 443 | // case 3: exact match on alternate label |
@@ -438,7 +446,9 @@ discard block |
||
| 438 | 446 | $hits[] = $res; |
| 439 | 447 | } |
| 440 | 448 | } |
| 441 | - if (sizeof($hits) > 0) return $hits; |
|
| 449 | + if (sizeof($hits) > 0) { |
|
| 450 | + return $hits; |
|
| 451 | + } |
|
| 442 | 452 | |
| 443 | 453 | |
| 444 | 454 | // case 4: case-insensitive match on alternate label |
@@ -447,7 +457,9 @@ discard block |
||
| 447 | 457 | $hits[] = $res; |
| 448 | 458 | } |
| 449 | 459 | } |
| 450 | - if (sizeof($hits) > 0) return $hits; |
|
| 460 | + if (sizeof($hits) > 0) { |
|
| 461 | + return $hits; |
|
| 462 | + } |
|
| 451 | 463 | |
| 452 | 464 | return $hits; |
| 453 | 465 | } |