import java.net.URL; import jtp.*; import jtp.context.daml.*; import jtp.fol.*; public class Test2 { public static final String KB_URL = "http://www.daml.org/2001/03/daml+oil-ex"; public static final String DRC = "http://www.ksl.stanford.edu/software/jtp/drc.ser"; public static void main (String [] argv) throws Exception { DamlReasoningContext drc = new DamlReasoningContext(); drc.setUp(); drc.loadKB(new URL (KB_URL)); ReasoningStepIterator rsi = drc.ask("(|http://www.daml.org/2001/03/daml+oil-ex#|::age |http://www.daml.org/2001/03/daml+oil-ex#|::|Peter| ?x)"); ReasoningStep rs = null; while ((rs = rsi.next()) != null) { Literal lit = SubstUtils.deReferenceLiteral((Literal)rs.getGoal()); System.out.println("X = " + lit.getArgs().get(1)); } } }