@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | |
263 | 263 | /** |
264 | 264 | * Used to generate the BIND + FILTER part related to the languages |
265 | - * @param $varnameInput the name of the variable from which to extract the language |
|
266 | - * @param $varnameOutput the name of the variable that will contain the language tag |
|
265 | + * @param string $varnameInput the name of the variable from which to extract the language |
|
266 | + * @param string $varnameOutput the name of the variable that will contain the language tag |
|
267 | 267 | * @param array $values languages to use in the FILTER |
268 | 268 | * @return string part of the sparql query dealing wit the languages |
269 | 269 | */ |
@@ -312,6 +312,7 @@ discard block |
||
312 | 312 | /** |
313 | 313 | * Counts the number of concepts in a easyRDF graph with a specific language. |
314 | 314 | * @param array $langs Languages to query for |
315 | + * @param string[] $classes |
|
315 | 316 | * @return Array containing count of concepts for each language and property. |
316 | 317 | */ |
317 | 318 | public function countLangConcepts($langs, $classes = null) { |
@@ -496,7 +497,7 @@ discard block |
||
496 | 497 | * Returns information (as a graph) for one or more concept URIs |
497 | 498 | * @param mixed $uris concept URI (string) or array of URIs |
498 | 499 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
499 | - * @param \Vocabulary[]|null $vocabs vocabularies to target |
|
500 | + * @param Vocabulary[] $vocabs vocabularies to target |
|
500 | 501 | * @return \EasyRdf\Graph |
501 | 502 | */ |
502 | 503 | public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) { |
@@ -512,7 +513,7 @@ discard block |
||
512 | 513 | |
513 | 514 | /** |
514 | 515 | * Returns information (as an array of Concept objects) for one or more concept URIs |
515 | - * @param mixed $uris concept URI (string) or array of URIs |
|
516 | + * @param string $uris concept URI (string) or array of URIs |
|
516 | 517 | * @param string|null $arrayClass the URI for thesaurus array class, or null if not used |
517 | 518 | * @param \Vocabulary[] $vocabs vocabularies to target |
518 | 519 | * @param string|null $clang content language |
@@ -727,7 +728,7 @@ discard block |
||
727 | 728 | |
728 | 729 | /** |
729 | 730 | * Generate a VALUES clause for limiting the targeted graphs. |
730 | - * @param Vocabulary[]|null $vocabs array of Vocabulary objects to target |
|
731 | + * @param Vocabulary[] $vocabs array of Vocabulary objects to target |
|
731 | 732 | * @return string VALUES clause, or "" if not necessary to limit |
732 | 733 | */ |
733 | 734 | protected function formatValuesGraph($vocabs) { |
@@ -907,6 +908,7 @@ discard block |
||
907 | 908 | * @param string $searchLang language code used for matching labels (null means any language) |
908 | 909 | * @param string[] $props properties to target e.g. array('skos:prefLabel','skos:altLabel') |
909 | 910 | * @param boolean $unique restrict results to unique concepts (default: false) |
911 | + * @param string $filterGraph |
|
910 | 912 | * @return string sparql query |
911 | 913 | */ |
912 | 914 | protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph) |
@@ -1181,6 +1183,7 @@ discard block |
||
1181 | 1183 | /** |
1182 | 1184 | * Generates sparql query clauses used for creating the alphabetical index. |
1183 | 1185 | * @param string $letter the letter (or special class) to search for |
1186 | + * @param string $lang |
|
1184 | 1187 | * @return array of sparql query clause strings |
1185 | 1188 | */ |
1186 | 1189 | private function formatFilterConditions($letter, $lang) { |
@@ -1348,6 +1351,7 @@ discard block |
||
1348 | 1351 | /** |
1349 | 1352 | * Query for the first characters (letter or otherwise) of the labels in the particular language. |
1350 | 1353 | * @param string $lang language |
1354 | + * @param string[] $classes |
|
1351 | 1355 | * @return array array of characters |
1352 | 1356 | */ |
1353 | 1357 | public function queryFirstCharacters($lang, $classes = null) { |
@@ -1670,7 +1674,7 @@ discard block |
||
1670 | 1674 | /** |
1671 | 1675 | * Query a single transitive property of a concept. |
1672 | 1676 | * @param string $uri |
1673 | - * @param array $props the property/properties. |
|
1677 | + * @param string[] $props the property/properties. |
|
1674 | 1678 | * @param string $lang |
1675 | 1679 | * @param string $fallbacklang language to use if label is not available in the preferred language |
1676 | 1680 | * @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 |
@@ -261,25 +261,25 @@ discard block |
||
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
264 | - * Used to generate the BIND + FILTER part related to the languages |
|
265 | - * @param $varnameInput the name of the variable from which to extract the language |
|
266 | - * @param $varnameOutput the name of the variable that will contain the language tag |
|
267 | - * @param array $values languages to use in the FILTER |
|
268 | - * @return string part of the sparql query dealing wit the languages |
|
269 | - */ |
|
264 | + * Used to generate the BIND + FILTER part related to the languages |
|
265 | + * @param $varnameInput the name of the variable from which to extract the language |
|
266 | + * @param $varnameOutput the name of the variable that will contain the language tag |
|
267 | + * @param array $values languages to use in the FILTER |
|
268 | + * @return string part of the sparql query dealing wit the languages |
|
269 | + */ |
|
270 | 270 | protected function formatValuesFilterAndBind($varnameInput, $varnameOutput, $values) { |
271 | - $queryPart = "BIND(lang($varnameInput) AS $varnameOutput)"; |
|
272 | - $first = true; |
|
271 | + $queryPart = "BIND(lang($varnameInput) AS $varnameOutput)"; |
|
272 | + $first = true; |
|
273 | 273 | |
274 | - $queryPart .= "FILTER(" ; |
|
274 | + $queryPart .= "FILTER(" ; |
|
275 | 275 | foreach ($values as $val) { |
276 | 276 | if($first != true){ |
277 | 277 | $queryPart .= ' || '; |
278 | 278 | } |
279 | - $first = false; |
|
279 | + $first = false; |
|
280 | 280 | $queryPart .= "$varnameOutput = '$val'"; |
281 | 281 | } |
282 | - $queryPart .= ")"; |
|
282 | + $queryPart .= ")"; |
|
283 | 283 | |
284 | 284 | return $queryPart; |
285 | 285 | } |
@@ -1832,7 +1832,7 @@ discard block |
||
1832 | 1832 | |
1833 | 1833 | /** |
1834 | 1834 | * Generates a sparql query for finding the hierarchy for a concept. |
1835 | - * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal. |
|
1835 | + * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal. |
|
1836 | 1836 | * @param string $uri concept uri. |
1837 | 1837 | * @param string $lang |
1838 | 1838 | * @param string $fallback language to use if label is not available in the preferred language |
@@ -1909,10 +1909,10 @@ discard block |
||
1909 | 1909 | $ret[$uri]['exact'] = $row->exact->getUri(); |
1910 | 1910 | } |
1911 | 1911 | if (isset($row->tops)) { |
1912 | - $topConceptsList=explode(" ", $row->tops->getValue()); |
|
1913 | - // sort to garantee an alphabetical ordering of the URI |
|
1914 | - sort($topConceptsList); |
|
1915 | - $ret[$uri]['tops'] = $topConceptsList; |
|
1912 | + $topConceptsList=explode(" ", $row->tops->getValue()); |
|
1913 | + // sort to garantee an alphabetical ordering of the URI |
|
1914 | + sort($topConceptsList); |
|
1915 | + $ret[$uri]['tops'] = $topConceptsList; |
|
1916 | 1916 | } |
1917 | 1917 | if (isset($row->children)) { |
1918 | 1918 | if (!isset($ret[$uri]['narrower'])) { |