Skip to content

Commit

Permalink
Add unit test for #744 / PR #756. Fixes #744
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Apr 13, 2018
1 parent 2459de9 commit 5d8424b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/ConceptPropertyValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,14 @@ public function testGetSubMembersEmpty() {
$propval = new ConceptPropertyValue($this->model, $this->vocab, $mockres, 'en');
$this->assertEquals(null, $propval->getSubMembers());
}

public function testGetReifiedPropertyValues() {
$vocab = $this->model->getVocabulary('xl');
$concept = $vocab->getConceptInfo('http://www.skosmos.skos/xl/c1', 'en')[0];
$props = $concept->getProperties();
$vals = $props['skos:definition']->getValues();
$val = reset($vals);
$reified_vals = $val->getReifiedPropertyValues();
$this->assertEquals(2, count($reified_vals));
}
}
28 changes: 28 additions & 0 deletions tests/test-vocab-data/xl.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@prefix xl: <http://www.skosmos.skos/xl/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix skosxl: <http://www.w3.org/2008/05/skos-xl#> .

xl:c1 a skos:Concept ;
skos:prefLabel "Concept"@en ;
skos:altLabel "Conceptual entity"@en ;
skos:definition xl:d1 ;
skosxl:prefLabel xl:l1 ;
skosxl:altLabel xl:l2 .

xl:l1 a skosxl:Label ;
skosxl:literalForm "Concept"@en ;
dct:modified "2018-04-13T10:29:03+00:00"^^xsd:dateTime ;
skosxl:labelRelation xl:l2 .

xl:l2 a skosxl:Label ;
skosxl:literalForm "Conceptual entity"@en ;
dct:description "alternate label for Concept"@en ;
skosxl:labelRelation xl:l1 .

xl:d1
rdf:value "Unit of thought"@en ;
dct:modified "2018-04-13T10:29:03+00:00"^^xsd:dateTime ;
dct:source <https://en.wikipedia.org/wiki/Concept> .
9 changes: 9 additions & 0 deletions tests/testvocabularies.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@
skosmos:language "en";
skosmos:sparqlGraph <http://www.skosmos.skos/cbd/> .

:xl a skosmos:Vocabulary, void:Dataset ;
dc11:title "A vocabulary for testing SKOS XL"@en ;
dc:subject :cat_general ;
void:uriSpace "http://www.skosmos.skos/xl/";
void:sparqlEndpoint <http://localhost:13030/ds/sparql> ;
skosmos:language "en";
skosmos:sparqlGraph <http://www.skosmos.skos/xl/> .


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

:cat_science a skos:Concept ;
Expand Down

0 comments on commit 5d8424b

Please sign in to comment.