@Override public String toString() { return "Table1(" + var + "," + NodeFmtLib.displayStr(value) + ")" ; } }
@Override public String toString() { return "Table1(" + var + "," + NodeFmtLib.displayStr(value) + ")" ; } }
/** A displayable string for an RDFNode. Includes common abbreviations */ public static String displayStr(RDFNode obj) { return displayStr(obj.asNode()) ; }
public static void dumpNodeTable(NodeTable nodeTable, Set<NodeTable> dumpedNodeTables) { if ( dumpedNodeTables.contains(nodeTable) ) return ; Iterator<Pair<NodeId, Node>> iter = nodeTable.all() ; for ( ; iter.hasNext() ; ) { Pair<NodeId, Node> pair = iter.next() ; NodeId nid = pair.car() ; Node n = pair.cdr(); String x = NodeFmtLib.displayStr(n) ; System.out.printf("%016X %s\n", nid.getId(), x) ; } dumpedNodeTables.add(nodeTable) ; }
@Override protected void format(StringBuffer sbuff, Var var) { NodeId id = idBinding.get(var) ; String extra = "" ; if ( id != null ) extra = "/"+id ; Node node = get(var) ; String tmp = NodeFmtLib.displayStr(node) ; sbuff.append("( ?"+var.getVarName()+extra+" = "+tmp+" )") ; } }
@Override protected void format(StringBuffer sbuff, Var var) { NodeId id = idBinding.get(var) ; String extra = "" ; if ( id != null ) extra = "/"+id ; Node node = get(var) ; String tmp = NodeFmtLib.displayStr(node) ; sbuff.append("( ?"+var.getVarName()+extra+" = "+tmp+" )") ; } }
private static void testDisplay(Node node, String output) { String x = NodeFmtLib.displayStr(node) ; assertEquals(output, x) ; }
private void indexes(Resource root) { // ---- API ways StmtIterator sIter = root.listProperties(pIndex) ; while(sIter.hasNext()) { RDFNode obj = sIter.nextStatement().getObject() ; if ( obj.isLiteral() ) { String desc = ((Literal)obj).getString() ; System.out.printf("Index: %s\n", desc) ; System.out.flush(); continue ; } throw new TDBException("Wrong format for tdb:index: should be a string: found: "+NodeFmtLib.displayStr(obj)) ; // Resource x = (Resource)obj ; // String desc = x.getProperty(pDescription).getString() ; // String file = x.getProperty(pFile).getString() ; // System.out.printf("Index: %s in file %s\n", desc, file) ; System.out.flush(); } System.out.flush(); throw new TDBException("Custom indexes turned off") ; }
private void indexes(Resource root) { // ---- API ways StmtIterator sIter = root.listProperties(pIndex) ; while(sIter.hasNext()) { RDFNode obj = sIter.nextStatement().getObject() ; if ( obj.isLiteral() ) { String desc = ((Literal)obj).getString() ; System.out.printf("Index: %s\n", desc) ; System.out.flush(); continue ; } throw new TDBException("Wrong format for tdb:index: should be a string: found: "+NodeFmtLib.displayStr(obj)) ; // Resource x = (Resource)obj ; // String desc = x.getProperty(pDescription).getString() ; // String file = x.getProperty(pFile).getString() ; // System.out.printf("Index: %s in file %s\n", desc, file) ; System.out.flush(); } System.out.flush(); throw new TDBException("Custom indexes turned off") ; }
String s = NodeFmtLib.displayStr(n) ; System.out.println(s) ;
String s = NodeFmtLib.displayStr(n) ; System.out.println(s) ;
String s = NodeFmtLib.displayStr(n) ; System.out.println(s) ;