Ejemplo n.º 1
0
  @Test
  public void testFactContextObject() throws KBApiException {
    System.out.println("Running testFactContextObject");
    Context uctx = Constants.uvMt();
    Fact anA =
        new FactImpl(
            "(SomeAirlineEquipmentLogFn Plane-APITest)",
            "(flyingDoneBySomething-Move FlightXYZ-APITest Plane-APITest)");

    Fact anAonA =
        new FactImpl(
            "(SomeAirlineEquipmentLogFn Plane-APITest)",
            "(#$assertionUtility  (#$ist (SomeAirlineEquipmentLogFn Plane-APITest) (flyingDoneBySomething-Move FlightXYZ-APITest Plane-APITest))  0.5 )");

    KBPredicate p = KBPredicateImpl.get("assertionUtility");
    FactImpl a = new FactImpl(uctx, p, anA, 0.89);
    assertEquals(
        "(ist UniversalVocabularyMt (assertionUtility (() ((#$flyingDoneBySomething-Move #$FlightXYZ-APITest #$Plane-APITest))) 0.89))",
        a.toString());

    assertEquals(a.getContext().toString(), "UniversalVocabularyMt");
  }