diff --git a/model/Vocabulary.php b/model/Vocabulary.php index 2aaf4de7a..6f3e6ba43 100644 --- a/model/Vocabulary.php +++ b/model/Vocabulary.php @@ -304,6 +304,8 @@ private function parseVersionInfo($version) /** * Counts the statistics of the vocabulary. * @return Array containing the label counts + * @param string $array the uri of the concept array class, eg. isothes:ThesaurusArray + * @param string $group the uri of the concept group class, eg. isothes:ConceptGroup */ public function getStatistics($lang = '', $array=null, $group=null) { diff --git a/model/sparql/GenericSparql.php b/model/sparql/GenericSparql.php index d4cb9f72a..9c58a9a1d 100644 --- a/model/sparql/GenericSparql.php +++ b/model/sparql/GenericSparql.php @@ -228,6 +228,8 @@ private function transformCountConceptsResults($result, $lang) { /** * Used for counting number of concepts and collections in a vocabulary. * @param string $lang language of labels + * @param string $array the uri of the concept array class, eg. isothes:ThesaurusArray + * @param string $group the uri of the concept group class, eg. isothes:ConceptGroup * @return array with number of concepts in this vocabulary per label */ public function countConcepts($lang = null, $array = null, $group = null) { diff --git a/tests/GenericSparqlTest.php b/tests/GenericSparqlTest.php index f5497d7ff..990a42c19 100644 --- a/tests/GenericSparqlTest.php +++ b/tests/GenericSparqlTest.php @@ -46,6 +46,19 @@ public function testCountConcepts() { $this->assertEquals(17, $actual['http://www.w3.org/2004/02/skos/core#Concept']['count']); } + /** + * @covers GenericSparql::countConcepts + * @covers GenericSparql::generateCountConceptsQuery + * @covers GenericSparql::transformCountConceptsResults + */ + public function testTransformCountConceptsResults() { + $result = $this->sparql->countConcepts(); + + $this->assertEquals(13, $result['http://www.skosmos.skos/test-meta/TestClass']['count']); + $this->assertEquals(1, $result['http://www.skosmos.skos/test-meta/TestClass']['deprecatedCount']); + $this->assertEquals('http://www.skosmos.skos/test-meta/TestClass', $result['http://www.skosmos.skos/test-meta/TestClass']['type']); + } + /** * @covers GenericSparql::countLangConcepts * @covers GenericSparql::generateCountLangConceptsQuery