@@ -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 |
@@ -47,12 +47,16 @@ discard block |
||
| 47 | 47 | $this->client = new EasyRdf\Sparql\Client($endpoint); |
| 48 | 48 | |
| 49 | 49 | // set graphClause so that it can be used by all queries |
| 50 | - if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable) |
|
| 50 | + if ($this->isDefaultEndpoint()) { |
|
| 51 | + // default endpoint; query any graph (and catch it in a variable) |
|
| 51 | 52 | { |
| 52 | 53 | $this->graphClause = "GRAPH $graph"; |
| 53 | - } elseif ($graph) // query a specific graph |
|
| 54 | + } |
|
| 55 | + } elseif ($graph) { |
|
| 56 | + // query a specific graph |
|
| 54 | 57 | { |
| 55 | 58 | $this->graphClause = "GRAPH <$graph>"; |
| 59 | + } |
|
| 56 | 60 | } else // query the default graph |
| 57 | 61 | { |
| 58 | 62 | $this->graphClause = ""; |
@@ -1943,8 +1947,7 @@ discard block |
||
| 1943 | 1947 | if (sizeof($ret) > 0) { |
| 1944 | 1948 | // existing concept, with children |
| 1945 | 1949 | return $ret; |
| 1946 | - } |
|
| 1947 | - else { |
|
| 1950 | + } else { |
|
| 1948 | 1951 | // nonexistent concept |
| 1949 | 1952 | return null; |
| 1950 | 1953 | } |