@@ -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); |
@@ -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(); |
@@ -169,6 +169,8 @@ |
||
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | 171 | * Return the mapping as a JSKOS-compatible array. |
| 172 | + * @param string $lang |
|
| 173 | + * @param string $hrefLink |
|
| 172 | 174 | * @return array |
| 173 | 175 | */ |
| 174 | 176 | public function asJskos($queryExVocabs = true, $lang = null, $hrefLink = null) |
@@ -266,6 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | /** |
| 268 | 268 | * Returns skosmos:marcSourcecode value set in config.ttl. |
| 269 | + * @param string $lang |
|
| 269 | 270 | * @return string marcsource name |
| 270 | 271 | */ |
| 271 | 272 | public function getMarcSourceCode($lang = null) |
@@ -275,7 +276,7 @@ discard block |
||
| 275 | 276 | |
| 276 | 277 | /** |
| 277 | 278 | * Returns a boolean value set in the config.ttl config. |
| 278 | - * @return array array of concept class URIs (can be empty) |
|
| 279 | + * @return string[] array of concept class URIs (can be empty) |
|
| 279 | 280 | */ |
| 280 | 281 | public function getIndexClasses() |
| 281 | 282 | { |
@@ -284,7 +285,7 @@ discard block |
||
| 284 | 285 | |
| 285 | 286 | /** |
| 286 | 287 | * Returns skosmos:externalProperty values set in the config.ttl config. |
| 287 | - * @return array array of external property URIs (can be empty) |
|
| 288 | + * @return string[] array of external property URIs (can be empty) |
|
| 288 | 289 | */ |
| 289 | 290 | public function getExtProperties() |
| 290 | 291 | { |
@@ -410,6 +411,7 @@ discard block |
||
| 410 | 411 | |
| 411 | 412 | /** |
| 412 | 413 | * Returns the vocabulary dc:type value(s) with their labels and uris, if set in the vocabulary configuration. |
| 414 | + * @param string $lang |
|
| 413 | 415 | * @return array of objects or an empty array |
| 414 | 416 | */ |
| 415 | 417 | public function getTypes($lang = null) |
@@ -23,6 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Initializes the Model object. |
| 26 | + * @param Model $model |
|
| 26 | 27 | */ |
| 27 | 28 | public function __construct($model) |
| 28 | 29 | { |
@@ -290,7 +291,7 @@ discard block |
||
| 290 | 291 | * Sends HTTP headers. Simply calls PHP built-in header function. But being |
| 291 | 292 | * a function here, it can easily be tested/mocked. |
| 292 | 293 | * |
| 293 | - * @param $header string header to be sent |
|
| 294 | + * @param string $header string header to be sent |
|
| 294 | 295 | */ |
| 295 | 296 | protected function sendHeader($header) |
| 296 | 297 | { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * Returns the graph instance |
| 155 | - * @return object EasyRDF graph instance. |
|
| 155 | + * @return string|null EasyRDF graph instance. |
|
| 156 | 156 | */ |
| 157 | 157 | public function getGraph() { |
| 158 | 158 | return $this->graph; |
@@ -287,6 +287,7 @@ discard block |
||
| 287 | 287 | /** |
| 288 | 288 | * Counts the number of concepts in a easyRDF graph with a specific language. |
| 289 | 289 | * @param array $langs Languages to query for |
| 290 | + * @param string[] $classes |
|
| 290 | 291 | * @return Array containing count of concepts for each language and property. |
| 291 | 292 | */ |
| 292 | 293 | public function countLangConcepts($langs, $classes = null) { |
@@ -471,7 +472,7 @@ discard block |
||
| 471 | 472 | * Returns information (as a graph) for one or more concept URIs |
| 472 | 473 | * @param mixed $uris concept URI (string) or array of URIs |
| 473 | 474 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
| 474 | - * @param \Vocabulary[]|null $vocabs vocabularies to target |
|
| 475 | + * @param Vocabulary[] $vocabs vocabularies to target |
|
| 475 | 476 | * @return \EasyRdf\Graph |
| 476 | 477 | */ |
| 477 | 478 | public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) { |
@@ -487,7 +488,7 @@ discard block |
||
| 487 | 488 | |
| 488 | 489 | /** |
| 489 | 490 | * Returns information (as an array of Concept objects) for one or more concept URIs |
| 490 | - * @param mixed $uris concept URI (string) or array of URIs |
|
| 491 | + * @param string $uris concept URI (string) or array of URIs |
|
| 491 | 492 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
| 492 | 493 | * @param \Vocabulary[] $vocabs vocabularies to target |
| 493 | 494 | * @param string|null $clang content language |
@@ -705,7 +706,7 @@ discard block |
||
| 705 | 706 | |
| 706 | 707 | /** |
| 707 | 708 | * Generate a VALUES clause for limiting the targeted graphs. |
| 708 | - * @param Vocabulary[]|null $vocabs array of Vocabulary objects to target |
|
| 709 | + * @param Vocabulary[] $vocabs array of Vocabulary objects to target |
|
| 709 | 710 | * @return string VALUES clause, or "" if not necessary to limit |
| 710 | 711 | */ |
| 711 | 712 | protected function formatValuesGraph($vocabs) { |
@@ -887,6 +888,7 @@ discard block |
||
| 887 | 888 | * @param string $searchLang language code used for matching labels (null means any language) |
| 888 | 889 | * @param string[] $props properties to target e.g. array('skos:prefLabel','skos:altLabel') |
| 889 | 890 | * @param boolean $unique restrict results to unique concepts (default: false) |
| 891 | + * @param string $filterGraph |
|
| 890 | 892 | * @return string sparql query |
| 891 | 893 | */ |
| 892 | 894 | protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph) |
@@ -1161,6 +1163,7 @@ discard block |
||
| 1161 | 1163 | /** |
| 1162 | 1164 | * Generates sparql query clauses used for creating the alphabetical index. |
| 1163 | 1165 | * @param string $letter the letter (or special class) to search for |
| 1166 | + * @param string $lang |
|
| 1164 | 1167 | * @return array of sparql query clause strings |
| 1165 | 1168 | */ |
| 1166 | 1169 | private function formatFilterConditions($letter, $lang) { |
@@ -1328,6 +1331,7 @@ discard block |
||
| 1328 | 1331 | /** |
| 1329 | 1332 | * Query for the first characters (letter or otherwise) of the labels in the particular language. |
| 1330 | 1333 | * @param string $lang language |
| 1334 | + * @param string[] $classes |
|
| 1331 | 1335 | * @return array array of characters |
| 1332 | 1336 | */ |
| 1333 | 1337 | public function queryFirstCharacters($lang, $classes = null) { |
@@ -1650,7 +1654,7 @@ discard block |
||
| 1650 | 1654 | /** |
| 1651 | 1655 | * Query a single transitive property of a concept. |
| 1652 | 1656 | * @param string $uri |
| 1653 | - * @param array $props the property/properties. |
|
| 1657 | + * @param string[] $props the property/properties. |
|
| 1654 | 1658 | * @param string $lang |
| 1655 | 1659 | * @param string $fallbacklang language to use if label is not available in the preferred language |
| 1656 | 1660 | * @param integer $limit |
@@ -97,6 +97,9 @@ discard block |
||
| 97 | 97 | return $this->returnJson($ret); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + /** |
|
| 101 | + * @param Request $request |
|
| 102 | + */ |
|
| 100 | 103 | private function constructSearchParameters($request) |
| 101 | 104 | { |
| 102 | 105 | $parameters = new ConceptSearchParameters($request, $this->model->getConfig(), true); |
@@ -112,6 +115,10 @@ discard block |
||
| 112 | 115 | return $parameters; |
| 113 | 116 | } |
| 114 | 117 | |
| 118 | + /** |
|
| 119 | + * @param Request $request |
|
| 120 | + * @param ConceptSearchParameters $parameters |
|
| 121 | + */ |
|
| 115 | 122 | private function transformSearchResults($request, $results, $parameters) |
| 116 | 123 | { |
| 117 | 124 | // before serializing to JSON, get rid of the Vocabulary object that came with each resource |
@@ -420,6 +427,10 @@ discard block |
||
| 420 | 427 | return $this->returnJson($ret); |
| 421 | 428 | } |
| 422 | 429 | |
| 430 | + /** |
|
| 431 | + * @param string $label |
|
| 432 | + * @param string $lang |
|
| 433 | + */ |
|
| 423 | 434 | private function findLookupHits($results, $label, $lang) |
| 424 | 435 | { |
| 425 | 436 | $hits = array(); |
@@ -481,6 +492,9 @@ discard block |
||
| 481 | 492 | return $hits; |
| 482 | 493 | } |
| 483 | 494 | |
| 495 | + /** |
|
| 496 | + * @param string $lang |
|
| 497 | + */ |
|
| 484 | 498 | private function transformLookupResults($lang, $hits) |
| 485 | 499 | { |
| 486 | 500 | if (sizeof($hits) == 0) { |
@@ -555,6 +569,9 @@ discard block |
||
| 555 | 569 | return $this->returnJson($ret); |
| 556 | 570 | } |
| 557 | 571 | |
| 572 | + /** |
|
| 573 | + * @param Request $request |
|
| 574 | + */ |
|
| 558 | 575 | private function redirectToVocabData($request) { |
| 559 | 576 | $urls = $request->getVocab()->getConfig()->getDataURLs(); |
| 560 | 577 | if (sizeof($urls) == 0) { |
@@ -580,6 +597,10 @@ discard block |
||
| 580 | 597 | } |
| 581 | 598 | } |
| 582 | 599 | |
| 600 | + /** |
|
| 601 | + * @param string $results |
|
| 602 | + * @param string $format |
|
| 603 | + */ |
|
| 583 | 604 | private function returnDataResults($results, $format) { |
| 584 | 605 | if ($format == 'application/ld+json' || $format == 'application/json') { |
| 585 | 606 | // further compact JSON-LD document using a context |
@@ -791,6 +812,12 @@ discard block |
||
| 791 | 812 | return $this->returnJson($ret); |
| 792 | 813 | } |
| 793 | 814 | |
| 815 | + /** |
|
| 816 | + * @param string $uri |
|
| 817 | + * @param string $lang |
|
| 818 | + * @param string $propname |
|
| 819 | + * @param string $propuri |
|
| 820 | + */ |
|
| 794 | 821 | private function transformPropertyResults($uri, $lang, $objects, $propname, $propuri) |
| 795 | 822 | { |
| 796 | 823 | $results = array(); |
@@ -805,6 +832,14 @@ discard block |
||
| 805 | 832 | ); |
| 806 | 833 | } |
| 807 | 834 | |
| 835 | + /** |
|
| 836 | + * @param string $uri |
|
| 837 | + * @param string $lang |
|
| 838 | + * @param string $tpropname |
|
| 839 | + * @param string $tpropuri |
|
| 840 | + * @param string $dpropname |
|
| 841 | + * @param string $dpropuri |
|
| 842 | + */ |
|
| 808 | 843 | private function transformTransitivePropertyResults($uri, $lang, $objects, $tpropname, $tpropuri, $dpropname, $dpropuri) |
| 809 | 844 | { |
| 810 | 845 | $results = array(); |
@@ -1095,6 +1130,7 @@ discard block |
||
| 1095 | 1130 | * @param Request $request |
| 1096 | 1131 | * @param int $offset starting index offset |
| 1097 | 1132 | * @param int $limit maximum number of concepts to return |
| 1133 | + * @param string $prop |
|
| 1098 | 1134 | * @return object json-ld wrapped list of changed concepts |
| 1099 | 1135 | */ |
| 1100 | 1136 | private function changedConcepts($request, $prop, $offset, $limit) |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * Get the localname of a concept in the vocabulary. If the URI is not |
| 132 | 132 | * in the URI space of this vocabulary, return the full URI. |
| 133 | 133 | * |
| 134 | - * @param $uri string full URI of concept |
|
| 134 | + * @param string $uri string full URI of concept |
|
| 135 | 135 | * @return string local name of concept, or original full URI if the local name cannot be determined |
| 136 | 136 | */ |
| 137 | 137 | public function getLocalName($uri) |
@@ -303,6 +303,8 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | 305 | * Counts the statistics of the vocabulary. |
| 306 | + * @param string $array |
|
| 307 | + * @param string $group |
|
| 306 | 308 | * @return array of the concept/group counts |
| 307 | 309 | */ |
| 308 | 310 | public function getStatistics($lang = '', $array=null, $group=null) |
@@ -342,6 +344,7 @@ discard block |
||
| 342 | 344 | /** |
| 343 | 345 | * Gets the child relations of a concept and whether these children have more children. |
| 344 | 346 | * @param string $uri |
| 347 | + * @param string $lang |
|
| 345 | 348 | */ |
| 346 | 349 | public function getConceptChildren($uri, $lang) |
| 347 | 350 | { |
@@ -450,6 +453,8 @@ discard block |
||
| 450 | 453 | /** |
| 451 | 454 | * Lists the concepts available in the concept group. |
| 452 | 455 | * @param $clname |
| 456 | + * @param string $glname |
|
| 457 | + * @param string $clang |
|
| 453 | 458 | * @return array |
| 454 | 459 | */ |
| 455 | 460 | public function listConceptGroupContents($glname, $clang) |
@@ -476,7 +481,7 @@ discard block |
||
| 476 | 481 | /** |
| 477 | 482 | * Returns the letters of the alphabet which have been used in this vocabulary. |
| 478 | 483 | * The returned letters may also include specials such as '0-9' (digits) and '!*' (special characters). |
| 479 | - * @param $clang content language |
|
| 484 | + * @param string $clang content language |
|
| 480 | 485 | * @return array array of letters |
| 481 | 486 | */ |
| 482 | 487 | public function getAlphabet($clang) |
@@ -511,6 +516,7 @@ discard block |
||
| 511 | 516 | * Also the special tokens '0-9' (digits), '!*' (special characters) and '*' |
| 512 | 517 | * (everything) are supported. |
| 513 | 518 | * @param $letter letter (or special token) to search for |
| 519 | + * @param string $clang |
|
| 514 | 520 | */ |
| 515 | 521 | public function searchConceptsAlphabetical($letter, $limit = null, $offset = null, $clang = null) |
| 516 | 522 | { |
@@ -626,6 +632,9 @@ discard block |
||
| 626 | 632 | return $this->getSparql()->queryChangeList($prop, $clang, $offset, $limit); |
| 627 | 633 | } |
| 628 | 634 | |
| 635 | + /** |
|
| 636 | + * @param string $lang |
|
| 637 | + */ |
|
| 629 | 638 | public function getTitle($lang=null) { |
| 630 | 639 | return $this->config->getTitle($lang); |
| 631 | 640 | } |
@@ -234,6 +234,11 @@ discard block |
||
| 234 | 234 | )); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | + /** |
|
| 238 | + * @param string $fromName |
|
| 239 | + * @param string|null $fromEmail |
|
| 240 | + * @param string $sender |
|
| 241 | + */ |
|
| 237 | 242 | private function createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender) |
| 238 | 243 | { |
| 239 | 244 | $headers = "MIME-Version: 1.0" . "\r\n"; |
@@ -255,6 +260,7 @@ discard block |
||
| 255 | 260 | * @param string $fromName senders own name. |
| 256 | 261 | * @param string $fromEmail senders email address. |
| 257 | 262 | * @param string $fromVocab which vocabulary is the feedback related to. |
| 263 | + * @param string $toMail |
|
| 258 | 264 | */ |
| 259 | 265 | public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null) |
| 260 | 266 | { |
@@ -534,6 +540,7 @@ discard block |
||
| 534 | 540 | |
| 535 | 541 | /** |
| 536 | 542 | * Invokes a very generic errorpage. |
| 543 | + * @param string $message |
|
| 537 | 544 | */ |
| 538 | 545 | public function invokeGenericErrorPage($request, $message = null) |
| 539 | 546 | { |