Example #1
0
 @Test
 public void setupTest() throws Exception {
   // sample one of the asserted facts
   String cycl = "(#$orbits #$PlanetEarth ?SUN)";
   CycDatasetGraph dsg = new CycDatasetGraph(cyc);
   CycGraph graph = (CycGraph) dsg.getDefaultGraph();
   CycList<Object> results = graph.query(cycl, SPECIFIC_MICROTHEORY);
   if (results == null || results.isEmpty()) {
     // the fact doesn't exist so run the setup
     CycFort mt = cyc.getKnownConstantByName(SPECIFIC_MICROTHEORY);
     Demo.setup(cyc, mt);
     results = graph.query(cycl, SPECIFIC_MICROTHEORY);
   }
   Object[] a = results.toArray();
   System.out.println(a.length + " results");
   assertTrue(a.length == 1);
 }