Exemple #1
0
    def getChildConcepts(self):
        """
        Return a collection of concepts
        """

        return skos.Concepts([
            skos.Concept('uri1', 'prefLabel1', 'definition1', 'notation1'),
            skos.Concept('uri2', 'prefLabel2', 'definition2', 'notation2')
        ])
Exemple #2
0
 def setUp(self):
     self.concepts = skos.Concepts(self.getConcepts())
Exemple #3
0
 def testIterable(self):
     clist = self.getConcepts()
     concepts = skos.Concepts(clist)
     self.assertSequenceEqual(concepts._concepts.values(), list(set(clist)))
Exemple #4
0
 def testMapping(self):
     mapping = dict(((concept.uri, concept) for concept in self.getConcepts()))
     concepts = skos.Concepts(mapping)
     self.assertEqual(concepts._concepts, mapping)
Exemple #5
0
 def testEqual(self):
     other = skos.Concepts(self.getConcepts())
     self.assertEqual(self.concepts, other)