def test_captures_cardinality_axioms(self):
        """Tests the captures_cardinality_axioms method for a cardinality object."""

        # set-up input
        triples = [
            (BNode('N6ebac'),
             URIRef('http://www.w3.org/2002/07/owl#minQualifiedCardinality'),
             Literal(
                 '2',
                 datatype=URIRef(
                     'http://www.w3.org/2001/XMLSchema#nonNegativeInteger'))),
            (BNode('N6ebac'), OWL.onClass, obo.UBERON_0000061),
            (BNode('N6ebac'), RDF.type, OWL.Restriction),
            (BNode('N6ebac'), OWL.onProperty, obo.RO_0002180)
        ]
        self.owl_nets.graph = adds_edges_to_graph(Graph(), triples)

        # test method
        self.owl_nets.captures_cardinality_axioms(
            {str(obo.UBERON_0034923) + ': N6ebac'}, obo.UBERON_0034923)
        card_triples = self.owl_nets.owl_nets_dict['cardinality']
        self.assertIsInstance(card_triples, dict)
        self.assertIsInstance(
            card_triples['<http://purl.obolibrary.org/obo/UBERON_0034923>'],
            set)
        self.assertEqual(
            len(card_triples['<http://purl.obolibrary.org/obo/UBERON_0034923>']
                ), 4)

        return None
    def test_reconciles_axioms(self):
        """Tests the reconciles_axioms method."""

        # set-up testing data
        triples = [
            (BNode('N31fefc6d'), RDF.type, OWL.Axiom),
            (BNode('N31fefc6d'), OWL.annotatedProperty, RDFS.subClassOf),
            (BNode('N31fefc6d'), OWL.annotatedSource, obo.UBERON_0002373),
            (BNode('N31fefc6d'), OWL.annotatedTarget, BNode('N26cd7b2c')),
            (BNode('N26cd7b2c'), RDF.type, OWL.Restriction),
            (BNode('N26cd7b2c'), OWL.onProperty, obo.RO_0002202),
            (BNode('N26cd7b2c'), OWL.someValuesFrom, obo.UBERON_0010023),
            (obo.UBERON_0010023, RDF.type, OWL.Class)
        ]
        result = {(BNode('N26cd7b2c'), RDF.type, OWL.Restriction),
                  (BNode('N26cd7b2c'), OWL.onProperty, obo.RO_0002202),
                  (BNode('N26cd7b2c'), OWL.someValuesFrom, obo.UBERON_0010023)}
        self.owl_nets.graph = adds_edges_to_graph(Graph(), triples)

        # test method
        node, matches = self.owl_nets.reconciles_axioms(
            obo.UBERON_0002373, BNode('N26cd7b2c'))
        self.assertIsInstance(node, URIRef)
        self.assertIsInstance(matches, Set)
        self.assertEqual(sorted(list(matches)), sorted(list(result)))

        return None
    def test_reconciles_classes(self):
        """Tests the reconciles_classes method."""

        # set-up testing data
        triples = [(obo.UBERON_0002374, RDFS.subClassOf, BNode('N41c7c5fd')),
                   (BNode('N41c7c5fd'), RDF.type, OWL.Restriction),
                   (BNode('N41c7c5fd'), OWL.onProperty, obo.BFO_0000050),
                   (BNode('N41c7c5fd'), OWL.someValuesFrom, obo.UBERON_0010544)
                   ]
        result = {(BNode('N41c7c5fd'), OWL.someValuesFrom, obo.UBERON_0010544),
                  (BNode('N41c7c5fd'), RDF.type, OWL.Restriction),
                  (BNode('N41c7c5fd'), OWL.onProperty, obo.BFO_0000050)}
        self.owl_nets.graph = adds_edges_to_graph(Graph(), triples)

        # test method
        matches = self.owl_nets.reconciles_classes(obo.UBERON_0002374)
        self.assertIsInstance(matches, Set)
        self.assertEqual(sorted(list(matches)), sorted(list(result)))

        return None
    def test_finds_uri(self):
        """Tests the finds_bnode_uri method."""

        # set-up testing data
        triples = [
            (BNode('N31fefc6d'), RDF.type, OWL.Axiom),
            (BNode('N31fefc6d'), OWL.annotatedProperty, RDFS.subClassOf),
            (BNode('N31fefc6d'), OWL.annotatedSource, obo.UBERON_0002373),
            (BNode('N31fefc6d'), OWL.annotatedTarget, BNode('N26cd7b2c')),
            (BNode('N26cd7b2c'), RDF.type, OWL.Restriction),
            (BNode('N26cd7b2c'), OWL.onProperty, obo.RO_0002202),
            (BNode('N26cd7b2c'), OWL.someValuesFrom, obo.UBERON_0010023),
            (obo.UBERON_0010023, RDF.type, OWL.Class)
        ]
        self.owl_nets.graph = adds_edges_to_graph(Graph(), triples)

        # test method
        node = self.owl_nets.finds_uri(BNode('N26cd7b2c'), obo.UBERON_0002373)
        self.assertEqual(node, obo.UBERON_0010023)

        return None
    def test_removes_disjoint_with_axioms(self):
        """Tests the removes_disjoint_with_axioms method."""

        # create test data
        triples = [
            (BNode('N9f94b'),
             URIRef('http://www.geneontology.org/formats/oboInOwl#source'),
             Literal(
                 'lexical',
                 datatype=URIRef('http://www.w3.org/2001/XMLSchema#string'))),
            (BNode('N9f94b'), RDF.type, OWL.Axiom),
            (BNode('N9f94b'), OWL.AnnotatedTarget, obo.UBERON_0022716),
            (BNode('N9f94b'), OWL.AnnotatedSource, obo.UBERON_0022352),
            (BNode('N9f94b'), OWL.AnnotatedProperty, OWL.disjointWith)
        ]
        self.owl_nets.graph = adds_edges_to_graph(Graph(), triples, False)

        # test method
        self.owl_nets.removes_disjoint_with_axioms()
        self.assertTrue(len(self.owl_nets.graph) == 4)

        return None