public UpdateDeniedException( 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()) ; }
/** * Uses the graph that was created to add the triple and either merges or adds based on the * availability of the graph node * @param rdfTriple * @param graph */ private void writeRecords(Triple rdfTriple, Graph graph) { // Add triple to the graph graph.add(rdfTriple); if (dsg.containsGraph(graphNode)) { logger.debug("Yes, we have this graphNode in MarkLogic"); logger.debug("Triple [" + rdfTriple.toString() + "]"); dsg.mergeGraph(graphNode, graph); } else { logger.debug("Store the graph in MarkLogic."); dsg.addGraph(graphNode, graph); } }
/** 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(); StringBuffer b = new StringBuffer( 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(); }
private String show( Model m, PrefixMapping pm ) { StringBuilder sb = new StringBuilder(); sb.append( "\n" ); for (Statement s: m.listStatements().toList()) { sb.append( " " ).append( s.asTriple().toString( pm ) ).append( "\n" ); } return sb.toString(); }