@@ -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)) { |
@@ -39,11 +39,11 @@ |
||
| 39 | 39 | return $html; |
| 40 | 40 | } |
| 41 | 41 | /** |
| 42 | - * Validate honeypot is empty |
|
| 43 | - * |
|
| 44 | - * @param mixed $value |
|
| 45 | - * @return boolean |
|
| 46 | - */ |
|
| 42 | + * Validate honeypot is empty |
|
| 43 | + * |
|
| 44 | + * @param mixed $value |
|
| 45 | + * @return boolean |
|
| 46 | + */ |
|
| 47 | 47 | public function validateHoneypot($value) |
| 48 | 48 | { |
| 49 | 49 | if ($this->disabled) { |
@@ -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 | { |
@@ -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); |
@@ -124,8 +124,8 @@ |
||
| 124 | 124 | */ |
| 125 | 125 | public function getEnvLang() |
| 126 | 126 | { |
| 127 | - // get language from locale, same as used by gettext, set by Controller |
|
| 128 | - return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore |
|
| 127 | + // get language from locale, same as used by gettext, set by Controller |
|
| 128 | + return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | abstract class BaseConfig extends DataObject |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * Returns a boolean value based on a literal value from the config.ttl configuration. |
|
| 12 | - * @param string $property the property to query |
|
| 13 | - * @param boolean $default the default value if the value is not set in configuration |
|
| 14 | - */ |
|
| 10 | + /** |
|
| 11 | + * Returns a boolean value based on a literal value from the config.ttl configuration. |
|
| 12 | + * @param string $property the property to query |
|
| 13 | + * @param boolean $default the default value if the value is not set in configuration |
|
| 14 | + */ |
|
| 15 | 15 | protected function getBoolean($property, $default = false) |
| 16 | 16 | { |
| 17 | 17 | $val = $this->getResource()->getLiteral($property); |
@@ -10,6 +10,11 @@ |
||
| 10 | 10 | /** property type */ |
| 11 | 11 | private $type; |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param Model $model |
|
| 15 | + * @param Vocabulary $vocab |
|
| 16 | + * @param Resource $resource |
|
| 17 | + */ |
|
| 13 | 18 | public function __construct($model, $vocab, $resource, $literal, $prop) |
| 14 | 19 | { |
| 15 | 20 | parent::__construct($model, $vocab, $resource); |
@@ -517,13 +517,13 @@ |
||
| 517 | 517 | |
| 518 | 518 | $defaultPropLabel = $this->model->getDefaultSparql()->queryLabel($longUri, ''); |
| 519 | 519 | |
| 520 | - if($envLangLabels) { |
|
| 521 | - $proplabel = $envLangLabels[$this->getEnvLang()]; |
|
| 520 | + if($envLangLabels) { |
|
| 521 | + $proplabel = $envLangLabels[$this->getEnvLang()]; |
|
| 522 | 522 | } else { |
| 523 | - if($defaultPropLabel) { |
|
| 524 | - $proplabel = $defaultPropLabel['']; |
|
| 525 | - } |
|
| 526 | - } |
|
| 523 | + if($defaultPropLabel) { |
|
| 524 | + $proplabel = $defaultPropLabel['']; |
|
| 525 | + } |
|
| 526 | + } |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | // look for superproperties in the current graph |
@@ -74,6 +74,7 @@ discard block |
||
| 74 | 74 | * @param Vocabulary $vocab |
| 75 | 75 | * @param EasyRdf\Resource $resource |
| 76 | 76 | * @param EasyRdf\Graph $graph |
| 77 | + * @param string|null $clang |
|
| 77 | 78 | */ |
| 78 | 79 | public function __construct($model, $vocab, $resource, $graph, $clang) |
| 79 | 80 | { |
@@ -738,6 +739,7 @@ discard block |
||
| 738 | 739 | |
| 739 | 740 | /** |
| 740 | 741 | * Gets the groups/arrays the concept belongs to. |
| 742 | + * @param boolean $includeArrays |
|
| 741 | 743 | */ |
| 742 | 744 | private function getCollections($includeArrays) { |
| 743 | 745 | $groups = array(); |
@@ -289,6 +289,7 @@ discard block |
||
| 289 | 289 | /** |
| 290 | 290 | * Counts the number of concepts in a easyRDF graph with a specific language. |
| 291 | 291 | * @param array $langs Languages to query for |
| 292 | + * @param string[] $classes |
|
| 292 | 293 | * @return Array containing count of concepts for each language and property. |
| 293 | 294 | */ |
| 294 | 295 | public function countLangConcepts($langs, $classes = null) { |
@@ -473,7 +474,7 @@ discard block |
||
| 473 | 474 | * Returns information (as a graph) for one or more concept URIs |
| 474 | 475 | * @param mixed $uris concept URI (string) or array of URIs |
| 475 | 476 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
| 476 | - * @param \Vocabulary[]|null $vocabs vocabularies to target |
|
| 477 | + * @param Vocabulary[] $vocabs vocabularies to target |
|
| 477 | 478 | * @return \EasyRdf\Graph |
| 478 | 479 | */ |
| 479 | 480 | public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) { |
@@ -489,7 +490,7 @@ discard block |
||
| 489 | 490 | |
| 490 | 491 | /** |
| 491 | 492 | * Returns information (as an array of Concept objects) for one or more concept URIs |
| 492 | - * @param mixed $uris concept URI (string) or array of URIs |
|
| 493 | + * @param string $uris concept URI (string) or array of URIs |
|
| 493 | 494 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
| 494 | 495 | * @param \Vocabulary[] $vocabs vocabularies to target |
| 495 | 496 | * @param string|null $clang content language |
@@ -704,7 +705,7 @@ discard block |
||
| 704 | 705 | |
| 705 | 706 | /** |
| 706 | 707 | * Generate a VALUES clause for limiting the targeted graphs. |
| 707 | - * @param Vocabulary[]|null $vocabs array of Vocabulary objects to target |
|
| 708 | + * @param Vocabulary[] $vocabs array of Vocabulary objects to target |
|
| 708 | 709 | * @return string VALUES clause, or "" if not necessary to limit |
| 709 | 710 | */ |
| 710 | 711 | protected function formatValuesGraph($vocabs) { |
@@ -884,6 +885,7 @@ discard block |
||
| 884 | 885 | * @param string $searchLang language code used for matching labels (null means any language) |
| 885 | 886 | * @param string[] $props properties to target e.g. array('skos:prefLabel','skos:altLabel') |
| 886 | 887 | * @param boolean $unique restrict results to unique concepts (default: false) |
| 888 | + * @param string $filterGraph |
|
| 887 | 889 | * @return string sparql query |
| 888 | 890 | */ |
| 889 | 891 | protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph) |
@@ -1158,6 +1160,7 @@ discard block |
||
| 1158 | 1160 | /** |
| 1159 | 1161 | * Generates sparql query clauses used for creating the alphabetical index. |
| 1160 | 1162 | * @param string $letter the letter (or special class) to search for |
| 1163 | + * @param string $lang |
|
| 1161 | 1164 | * @return array of sparql query clause strings |
| 1162 | 1165 | */ |
| 1163 | 1166 | private function formatFilterConditions($letter, $lang) { |
@@ -1325,6 +1328,7 @@ discard block |
||
| 1325 | 1328 | /** |
| 1326 | 1329 | * Query for the first characters (letter or otherwise) of the labels in the particular language. |
| 1327 | 1330 | * @param string $lang language |
| 1331 | + * @param string[] $classes |
|
| 1328 | 1332 | * @return array array of characters |
| 1329 | 1333 | */ |
| 1330 | 1334 | public function queryFirstCharacters($lang, $classes = null) { |
@@ -1647,7 +1651,7 @@ discard block |
||
| 1647 | 1651 | /** |
| 1648 | 1652 | * Query a single transitive property of a concept. |
| 1649 | 1653 | * @param string $uri |
| 1650 | - * @param array $props the property/properties. |
|
| 1654 | + * @param string[] $props the property/properties. |
|
| 1651 | 1655 | * @param string $lang |
| 1652 | 1656 | * @param string $fallbacklang language to use if label is not available in the preferred language |
| 1653 | 1657 | * @param integer $limit |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @param string $query |
| 66 | 66 | * @return string |
| 67 | - */ |
|
| 67 | + */ |
|
| 68 | 68 | protected function generateQueryPrefixes($query) |
| 69 | 69 | { |
| 70 | 70 | // Check for undefined prefixes |
@@ -239,9 +239,9 @@ discard block |
||
| 239 | 239 | $gcl = $this->graphClause; |
| 240 | 240 | $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept'); |
| 241 | 241 | |
| 242 | - $quote_string = function($val) { return "'$val'"; }; |
|
| 243 | - $quoted_values = array_map($quote_string, $langs); |
|
| 244 | - $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; |
|
| 242 | + $quote_string = function($val) { return "'$val'"; }; |
|
| 243 | + $quoted_values = array_map($quote_string, $langs); |
|
| 244 | + $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; |
|
| 245 | 245 | |
| 246 | 246 | $values = $this->formatValues('?type', $classes, 'uri'); |
| 247 | 247 | $valuesProp = $this->formatValues('?prop', $props, null); |
@@ -1812,7 +1812,7 @@ discard block |
||
| 1812 | 1812 | |
| 1813 | 1813 | /** |
| 1814 | 1814 | * Generates a sparql query for finding the hierarchy for a concept. |
| 1815 | - * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal. |
|
| 1815 | + * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal. |
|
| 1816 | 1816 | * @param string $uri concept uri. |
| 1817 | 1817 | * @param string $lang |
| 1818 | 1818 | * @param string $fallback language to use if label is not available in the preferred language |
@@ -1889,10 +1889,10 @@ discard block |
||
| 1889 | 1889 | $ret[$uri]['exact'] = $row->exact->getUri(); |
| 1890 | 1890 | } |
| 1891 | 1891 | if (isset($row->tops)) { |
| 1892 | - $topConceptsList=explode(" ", $row->tops->getValue()); |
|
| 1893 | - // sort to garantee an alphabetical ordering of the URI |
|
| 1894 | - sort($topConceptsList); |
|
| 1895 | - $ret[$uri]['tops'] = $topConceptsList; |
|
| 1892 | + $topConceptsList=explode(" ", $row->tops->getValue()); |
|
| 1893 | + // sort to garantee an alphabetical ordering of the URI |
|
| 1894 | + sort($topConceptsList); |
|
| 1895 | + $ret[$uri]['tops'] = $topConceptsList; |
|
| 1896 | 1896 | } |
| 1897 | 1897 | if (isset($row->children)) { |
| 1898 | 1898 | if (!isset($ret[$uri]['narrower'])) { |