Exemplo n.º 1
0
    def test_SetsActorAsPredicate(self):
        event = CDEvent(Primitives.EXPEL)
        event.subject = 'star'

        predicates = converter.convert_to_prolog(event)

        self.assertTrue(
            any(pred.startswith("actorOfEvent(star,") for pred in predicates))
Exemplo n.º 2
0
    def test_sets_subject_and_object_correctly(self):
        converter = cd_converter.CDConverter()

        fake_cd_event = CDEvent(Primitives.EXPEL)
        fake_cd_event.subject = "Star"
        fake_cd_event.event_object = "particle"

        result = converter.convert_cd_event_to_action_events(fake_cd_event)
        self.assertEqual(result[0].subject, "Star")
        self.assertEqual(result[0].event_object, "particle")
Exemplo n.º 3
0
 def _check_missing_info(event: CDEvent):
     if not event.subject:
         if event.primitive == Primitives.EXPEL or event.primitive == Primitives.INGEST:
             event.subject = prolog_service.query_prolog(event)