/** * Print all the Triple values from a find iterator. */ public static void printOut( Iterator<?> it ) { while (it.hasNext()) { System.out.println(" " + print(it.next())); } } }
/** * Print all the Triple values from a find iterator. */ public static void printOut( Iterator<?> it ) { while (it.hasNext()) { System.out.println(" " + print(it.next())); } } }
/** * Return a simplified print string for a statement */ public static String print(Statement stmt) { if (stmt == null) return "(null)"; return print(stmt.asTriple()); }
/** * Print a node list to stdout */ public void print(Node[] args, int length, RuleContext context) { for (int i = 0 ; i < length; i++) { System.out.print( PrintUtil.print(getArg(i, args, context)) + " "); } System.out.println(""); } }
/** * Return a simplified print string for an RDFNode. */ public static String print(RDFNode node) { if (node == null) return "null"; return print(node.asNode()); }
/** * Tracing support - return a format set of triple queries/results. */ private String getArgTrace() { StringBuilder temp = new StringBuilder(); temp.append(PrintUtil.print(deref(argVars[0]))); temp.append(" "); temp.append(PrintUtil.print(deref(argVars[1]))); temp.append(" "); temp.append(PrintUtil.print(deref(argVars[2]))); return temp.toString(); }
/** * Return a simplified print string for an RDFNode. */ public static String print(RDFNode node) { if (node == null) return "null"; return print(node.asNode()); }
/** * Print a node list to stdout */ public void print(Node[] args, int length, RuleContext context) { for (int i = 0 ; i < length; i++) { System.out.print( PrintUtil.print(getArg(i, args, context)) + " "); } System.out.println(""); } }
/** * Add a triple to the stack of triples to waiting to be processed by the rule engine. */ public void addTriple(Triple t) { if (graph.shouldTrace()) { if (rule != null) { logger.debug("Adding to stack (" + rule.toShortString() + "): " + PrintUtil.print(t)); } else { logger.debug("Adding to stack : " + PrintUtil.print(t)); } } stack.add(t); }
/** * Return a simplified print string for a statement */ public static String print(Statement stmt) { if (stmt == null) return "(null)"; return print(stmt.asTriple()); }
/** * Tracing support - return a format set of triple queries/results. */ private String getArgTrace() { StringBuilder temp = new StringBuilder(); temp.append(PrintUtil.print(deref(argVars[0]))); temp.append(" "); temp.append(PrintUtil.print(deref(argVars[1]))); temp.append(" "); temp.append(PrintUtil.print(deref(argVars[2]))); return temp.toString(); }
/** * Add a triple to the stack of triples to waiting to be processed by the rule engine. */ public void addTriple(Triple t) { if (graph.shouldTrace()) { if (rule != null) { logger.debug("Adding to stack (" + rule.toShortString() + "): " + PrintUtil.print(t)); } else { logger.debug("Adding to stack : " + PrintUtil.print(t)); } } stack.add(t); }
/** * Helper function to list a graph out to logger.info */ public void listGraph(Graph g) { for (Iterator<Triple> i = g.find(null,null,null); i.hasNext();) { Triple t = i.next(); logger.info(PrintUtil.print(t)); } logger.info(" -------- "); }
/** * Helper function to list a graph out to logger.info */ public void listGraph(Graph g) { for (Iterator<Triple> i = g.find(null,null,null); i.hasNext();) { Triple t = i.next(); logger.info(PrintUtil.print(t)); } logger.info(" -------- "); }
/** Run a single test */ public void run() { BasicForwardRuleReasoner reasoner = new BasicForwardRuleReasoner(ruleset); InfGraph result = reasoner.bind(Factory.createGraphMem()); System.out.println("Final graph state"); for (Iterator<Triple> i = result.find(null, null, null); i.hasNext(); ) { System.out.println(PrintUtil.print(i.next())); } }
/** Run a single test */ public void run() { BasicForwardRuleReasoner reasoner = new BasicForwardRuleReasoner(ruleset); InfGraph result = reasoner.bind(Factory.createGraphMem()); System.out.println("Final graph state"); for (Iterator<Triple> i = result.find(null, null, null); i.hasNext(); ) { System.out.println(PrintUtil.print(i.next())); } }