Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions model/VocabularyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,10 @@ public function getDefaultSidebarView()
public function getId()
{
$uriparts = explode("#", $this->resource->getURI());
if (count($uriparts) != 1)
if (count($uriparts) > 1)
// hash namespace
{
return $uriparts[1];
return $uriparts[count($uriparts) - 1];
}

// slash namespace
Expand Down
9 changes: 9 additions & 0 deletions tests/VocabularyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ public function testGetId() {
$this->assertEquals('test', $id);
}

/**
* @covers Vocabulary::getId
*/
public function testGetMultiHashId() {
$vocab = $this->model->getVocabulary('multiHashVocabId');
$id = $vocab->getId();
$this->assertEquals('multiHashVocabId', $id);
}

/**
* @covers Vocabulary::getTitle
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/testconfig.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@
skosmos:language "en";
skosmos:sparqlGraph <http://www.skosmos.skos/testOrder/> .

<http://testMultiHashesInUri#vocab#multiHashVocabId> a skosmos:Vocabulary, void:Dataset ;

<http://skosmos.skos/dump/test/groups> dc:format "application/rdf+xml" .

:cat_science a skos:Concept ;
Expand Down