/** return a human-readable string "subject @predicate object" describing the triple */ @Override public String toString() { return toString( PrefixMapping.Standard ); }
public AccessDeniedException( String message, Triple triple ) { super( message + triple.toString() ); this.triple = triple; }
public AccessDeniedException( String message, Triple triple ) { super( message + triple.toString() ); this.triple = triple; }
/** return a human-readable string "subject @predicate object" describing the triple */ @Override public String toString() { return toString( PrefixMapping.Standard ); }
@Override public void triple(int line, int col, Triple triple) { System.out.print(mark(line, col)) ; System.out.print(" ") ; System.out.println(triple.toString()) ; }
@Override public void triple(int line, int col, Triple triple) { System.out.print(mark(line, col)) ; System.out.print(" ") ; System.out.println(triple.toString()) ; }
/** * Returns a human-consumable representation of <code>graph</code>. The string * <code>prefix</code> will appear at the beginning of the string. Nodes * may be prefix-compressed using <code>graph</code>'s prefix-mapping. This * default implementation will display all the triples exposed by the graph, * including reification triples. * * @param prefix the prefix of the string returned * @param graph the Graph to render into a string * @return String a human-consumable representation of the argument Graph */ public static String toString(String prefix, Graph graph) { // PrefixMapping pm = graph.getPrefixMapping(); StringBuilder b = new StringBuilder(prefix + " {"); String gap = ""; ClosableIterator<Triple> it = GraphUtil.findAll(graph); while (it.hasNext()) { b.append(gap); gap = "; "; b.append(it.next().toString()); } b.append("}"); return b.toString(); }
/** Primarily to make sure that literals get quoted and stuff comes out in some kind of coherent order. */ public void testTripleToStringOrdering() { Triple t1 = NodeCreateUtils.createTriple( "subject predicate object" ); assertTrue( "subject must be present", t1.toString().contains( "subject" ) ); assertTrue( "subject must preceed predicate", t1.toString().indexOf( "subject" ) < t1.toString().indexOf( "predicate" ) ); assertTrue( "predicate must preceed object", t1.toString().indexOf( "predicate" ) < t1.toString().indexOf( "object" ) ); }
/** Primarily to make sure that literals get quoted and stuff comes out in some kind of coherent order. */ public void testTripleToStringOrdering() { Triple t1 = NodeCreateUtils.createTriple( "subject predicate object" ); assertTrue( "subject must be present", t1.toString().contains( "subject" ) ); assertTrue( "subject must preceed predicate", t1.toString().indexOf( "subject" ) < t1.toString().indexOf( "predicate" ) ); assertTrue( "predicate must preceed object", t1.toString().indexOf( "predicate" ) < t1.toString().indexOf( "object" ) ); }
/** Answer a human-consumable representation of <code>that</code>. The string <code>prefix</code> will appear near the beginning of the string. Nodes may be prefix-compressed using <code>that</code>'s prefix-mapping. This default implementation will display all the triples exposed by the graph (ie including reification triples if it is Standard). */ public static String toString( String prefix, Graph that ) { PrefixMapping pm = that.getPrefixMapping(); StringBuilder b = new StringBuilder( prefix + " {" ); int count = 0; String gap = ""; ClosableIterator<Triple> it = GraphUtil.findAll( that ); while (it.hasNext() && count < TOSTRING_TRIPLE_LIMIT) { b.append( gap ); gap = "; "; count += 1; b.append( it.next().toString( pm ) ); } if (it.hasNext()) b.append( "..." ); it.close(); b.append( "}" ); return b.toString(); }
/** Answer a human-consumable representation of <code>that</code>. The string <code>prefix</code> will appear near the beginning of the string. Nodes may be prefix-compressed using <code>that</code>'s prefix-mapping. This default implementation will display all the triples exposed by the graph (ie including reification triples if it is Standard). */ public static String toString( String prefix, Graph that ) { PrefixMapping pm = that.getPrefixMapping(); StringBuilder b = new StringBuilder( prefix + " {" ); int count = 0; String gap = ""; ClosableIterator<Triple> it = GraphUtil.findAll( that ); while (it.hasNext() && count < TOSTRING_TRIPLE_LIMIT) { b.append( gap ); gap = "; "; count += 1; b.append( it.next().toString( pm ) ); } if (it.hasNext()) b.append( "..." ); it.close(); b.append( "}" ); return b.toString(); }
public void testTripleToStringQuoting() { Triple t1 = NodeCreateUtils.createTriple( "subject predicate 'object'" ); assertTrue( t1.toString().indexOf( "\"object\"") > 0 ); }
public void testTripleToStringQuoting() { Triple t1 = NodeCreateUtils.createTriple( "subject predicate 'object'" ); assertTrue( t1.toString().indexOf( "\"object\"") > 0 ); }
public void testTripleToStringWithPrefixing() { PrefixMapping pm = PrefixMapping.Factory.create(); pm.setNsPrefix( "spoo", "eg://domain.dom/spoo#" ); Triple t1 = NodeCreateUtils.createTriple( "eg://domain.dom/spoo#a b c" ); assertEquals( "spoo:a @eh:/b eh:/c", t1.toString( pm ) ); }
public void testTripleToStringWithPrefixing() { PrefixMapping pm = PrefixMapping.Factory.create(); pm.setNsPrefix( "spoo", "eg://domain.dom/spoo#" ); Triple t1 = NodeCreateUtils.createTriple( "eg://domain.dom/spoo#a b c" ); assertEquals( "spoo:a @eh:/b eh:/c", t1.toString( pm ) ); }
LOG.error("Triple matches no pattern: ", triple.toString());