예제 #1
0
    def test_not_match_subject(self):
        collection = RDFCollection()
        self.assertIsNotNone(collection)
        self.add_data(collection)

        matches = collection.not_match(subject="MONKEY")
        self.assertEquals(3, len(matches))
예제 #2
0
    def test_not_match(self):
        collection = RDFCollection()
        self.assertIsNotNone(collection)
        self.add_data(collection)

        matches = collection.not_match()
        self.assertEquals(0, len(matches))
예제 #3
0
    def test_not_match_subject_predicate_object(self):
        collection = RDFCollection()
        self.assertIsNotNone(collection)
        self.add_data(collection)

        matches = collection.not_match(subject="MONKEY",
                                       predicate="legs",
                                       object="2")
        self.assertEquals(3, len(matches))
예제 #4
0
    def test_not_match_predicate(self):
        collection = RDFCollection()
        self.assertIsNotNone(collection)
        self.add_data(collection)

        matches = collection.not_match(predicate="legs")
        self.assertEquals(1, len(matches))
        self.assertEqual("ELEPHANT", matches[0].subject)
        self.assertEqual("trunk", matches[0].predicate)
        self.assertEqual("true", matches[0].object)
예제 #5
0
    def test_not_match_subject_predicate(self):
        collection = RDFCollection()
        self.assertIsNotNone(collection)
        self.add_data(collection)

        matches = collection.not_match(subject="MONKEY", predicate="legs")

        self.assertEquals(3, len(matches))
        self.assertEqual("ZEBRA", matches[0].subject)
        self.assertEqual("legs", matches[0].predicate)
        self.assertEqual("4", matches[0].object)
        self.assertEqual("BIRD", matches[1].subject)
        self.assertEqual("legs", matches[1].predicate)
        self.assertEqual("2", matches[1].object)
        self.assertEqual("ELEPHANT", matches[2].subject)
        self.assertEqual("trunk", matches[2].predicate)
        self.assertEqual("true", matches[2].object)
예제 #6
0
    def test_not_match_object(self):
        collection = RDFCollection()
        self.assertIsNotNone(collection)
        self.add_data(collection)

        matches = collection.not_match(object="4")
        self.assertEquals(4, len(matches))
        self.assertEqual("MONKEY", matches[0].subject)
        self.assertEqual("legs", matches[0].predicate)
        self.assertEqual("2", matches[0].object)
        self.assertEqual("MONKEY", matches[1].subject)
        self.assertEqual("hasFur", matches[1].predicate)
        self.assertEqual("true", matches[1].object)
        self.assertEqual("BIRD", matches[2].subject)
        self.assertEqual("legs", matches[2].predicate)
        self.assertEqual("2", matches[2].object)
        self.assertEqual("ELEPHANT", matches[3].subject)
        self.assertEqual("trunk", matches[3].predicate)
        self.assertEqual("true", matches[3].object)