1

When I delete a NART, and search for the NART string in the KB, I still see it. How are NARTs different from constants. Why can't I delete them.

Vijay Raj
  • 146
  • 1
  • 4

2 Answers2

1

The following code creates three NARTs and a NAUT demonstrating various ways of doing so. If you uncomment the last line, you will see that we dont have the assertion with revenueForPeriodByAccountingCOC anymore. This is evidence that the NART has been deleted. But note, that if you search for the term, (FiscalYearFn Walmart-CommericalOrganization 2012) in the browser, you will see basic NAUT and its #$isa, but it won't have any assertions on it. For constant, you will see a clear notification that it is not in the KB. That is because non-atomic terms can show very basic information just due to their syntactic representation. Not because they are in the KB.


@Test
  public void testUnreifiableFunctionWithDateInput2() throws KBApiException {

    KBFunctionImpl f1 = KBFunctionImpl.get ("USDollarFn");
    KBFunctionImpl f2 = f1.findOrCreateFunctionalTerm(KBFunctionImpl.class, 2012);
    f2.addResultIsa(KBCollectionImpl.get("MonetaryValue"), ContextImpl.get("UniversalVocabularyMt"));
    FactImpl.findOrCreate(new SentenceImpl(KBPredicateImpl.get("argsIsa"), f2, KBCollectionImpl.get("NumericInterval")));
    KBIndividual i1 = f2.findOrCreateFunctionalTerm(KBIndividualImpl.class, 10000000);

    KBPredicate p = KBPredicateImpl.get("revenueForPeriodByAccountingCOC");
    KBIndividualImpl w = KBIndividualImpl.get("Walmart-CommercialOrganization");

    KBFunctionImpl fy = KBFunctionImpl.get("FiscalYearFn");
    KBIndividual i2 = fy.findOrCreateFunctionalTerm(KBIndividualImpl.class, w, 2012);
    KBIndividual coc = KBIndividualImpl.findOrCreate("(#$AccountingCodeOfTypeTypicallyUsedByAgentFn #$GenerallyAcceptedAccountingPrinciples #$Walmart-CommercialOrganization)");
    w.addFact(Constants.uvMt(), p, 1, i1, i2, coc);

    // i2.delete();
  }
Vijay Raj
  • 146
  • 1
  • 4
1

For more information visit: http://dev.cyc.com

More code examples are here:

http://dev.cyc.com/cyc-api/samples/index.html

Vijay Raj
  • 146
  • 1
  • 4