Пример #1
0
    def test_parse_wine_file(self):
        owl = parse_owl(Path(test_owl_wine).as_uri())

        for node in sorted(wine_classes):
            self.assertHasNode(owl, node)

        for node in sorted(wine_individuals):
            self.assertHasNode(owl, node)

        for u, v in sorted(wine_subclasses):
            self.assertHasEdge(owl, u, v)

        for u, v in sorted(wine_membership):
            self.assertHasEdge(owl, u, v)
Пример #2
0
 def test_ado(self, mock1, mock2):
     ado_path = 'http://mock.com/ado.owl'
     owl = parse_owl(ado_path)
     self.assertLessEqual(ado_expected_nodes_subset, set(owl))
     self.assertLessEqual(ado_expected_edges_subset, set(owl.edges_iter()))
Пример #3
0
    def test_ado_local(self):
        ado_path = Path(test_owl_ado).as_uri()
        owl = parse_owl(ado_path)

        self.assertLessEqual(ado_expected_nodes_subset, set(owl))
        self.assertLessEqual(ado_expected_edges_subset, set(owl.edges_iter()))
Пример #4
0
 def test_parse_pizza_url(self, m1, m2):
     owl = parse_owl(pizza_iri)
     self.assertEqual(pizza_iri, owl.graph['IRI'])
     self.assertEqual(EXPECTED_PIZZA_NODES, set(owl.nodes()))
     self.assertEqual(EXPECTED_PIZZA_EDGES, set(owl.edges()))
Пример #5
0
 def test_parse_pizza_file(self):
     owl = parse_owl(Path(test_owl_pizza).as_uri())
     self.assertEqual(EXPECTED_PIZZA_NODES, set(owl.nodes()))
     self.assertEqual(EXPECTED_PIZZA_EDGES, set(owl.edges()))
Пример #6
0
 def test_invalid_owl(self):
     with self.assertRaises(Exception):
         parse_owl('http://example.com/not_owl')