public static String displayStr(Node n) { return str(n, null, dftPrefixMap) ; }
protected String labelForLiteral(Node node) { return NodeFmtLib.str(node) ; }
@Override public String ntriplesString() { return NodeFmtLib.str(node); }
protected String labelForLiteral(Node node) { return NodeFmtLib.str(node) ; }
@Override public void quad(Quad quad) { String string = NodeFmtLib.str(quad) ; log.info(string) ; }
@Override public void triple(Triple triple) { String string = NodeFmtLib.str(triple) ; log.info(string) ; }
@Override public void quad(Quad quad) { String string = NodeFmtLib.str(quad) ; log.info(string) ; }
@Override public void triple(Triple triple) { String string = NodeFmtLib.str(triple) ; log.info(string) ; }
public static String str(Node n) { IndentedLineBuffer sw = new IndentedLineBuffer() ; str(sw, n) ; return sw.toString() ; }
public static String str(Node n, Prologue prologue) { return str(n, prologue.getBaseURI(), prologue.getPrefixMap()) ; }
public static String str(Node n) { IndentedLineBuffer sw = new IndentedLineBuffer() ; str(sw, n) ; return sw.toString() ; }
public static String str(Node n, Prologue prologue) { return str(n, prologue.getBaseURI(), prologue.getPrefixMap()) ; }
/** Format:: access:entry ("user1" <http://host/graphname1> <http://host/graphname2> ) ; */ private void parseList(Multimap<String, Node> map, Resource root, GNode entry) { List<Node> members = GraphList.members(entry); // string, then URIs. if ( members.isEmpty() ) throw new AssemblerException(root, "Found access:entry with an empty list"); Node userNode = members.get(0); if ( ! Util.isSimpleString(userNode) ) throw new AssemblerException(root, "User name is not a string: "+NodeFmtLib.str(userNode)); String user = userNode.getLiteralLexicalForm(); List<Node> graphs = members.subList(1, members.size()); accessEntries(root, map, user, graphs); }
private static void test(Node node, String output) { String x = NodeFmtLib.str(node) ; assertEquals(output, x) ; }
public static String strNodes(Node ... nodes) { IndentedLineBuffer sw = new IndentedLineBuffer() ; boolean first = true ; for ( Node n : nodes ) { if ( ! first ) sw.append(" ") ; first = false ; str(sw, n) ; } return sw.toString() ; }
public static String strNodes(Node ... nodes) { IndentedLineBuffer sw = new IndentedLineBuffer() ; boolean first = true ; for ( Node n : nodes ) { if ( ! first ) sw.append(" ") ; first = false ; str(sw, n) ; } return sw.toString() ; }
query.append(PublishSubscribeConstants.SUBSCRIPTION_ID_VAR.toString()); query.append(" WHERE {\n GRAPH "); query.append(NodeFmtLib.str(PublishSubscribeConstants.SUBSCRIPTION_NS_NODE)); query.append(" {\n "); query.append("?sIdUri "); query.append(NodeFmtLib.str(PublishSubscribeConstants.SUBSCRIPTION_ORIGINAL_ID_NODE)); query.append(' '); query.append(NodeFmtLib.str(originalSubscriptionId.toJenaNode())); query.append(" .\n ?sIdUri "); query.append(NodeFmtLib.str(PublishSubscribeConstants.SUBSCRIPTION_ID_NODE)); query.append(' '); query.append(PublishSubscribeConstants.SUBSCRIPTION_ID_VAR.toString());
private void actOnRDFPatch(HttpAction action) { try { String ct = action.getRequest().getContentType(); InputStream input = action.request.getInputStream(); RDFPatch patch = RDFPatchOps.read(input); try ( OutputStream out = output.output() ) { String fn = output.currentFilename().getFileName().toString(); if ( action.verbose ) { Node id = patch.getId(); String idStr = id == null ? "<unset>" : NodeFmtLib.str(id); action.log.info(format("[%d] Log: %s ==>> %s", action.id, idStr, fn)); } else { action.log.info(format("[%d] Log: %s", action.id, fn)); } RDFPatchOps.write(out, patch); } ServletOps.success(action); } catch (RiotException ex) { ServletOps.errorBadRequest("RDF Patch parse error: "+ex.getMessage()); } catch (IOException ex) { ServletOps.errorBadRequest("IOException: "+ex.getMessage()); } }
private /*public*/ static String encode(Node node, PrefixMapping pmap) { if ( node.isBlank() ) // Raw label. return "_:"+node.getBlankNodeLabel() ; if ( node.isURI() ) { // Pesky spaces //throw new TDBException("Space found in URI: "+node) ; String x = StrUtils.encodeHex(node.getURI(), '_', invalidIRIChars) ; if ( x != node.getURI() ) node = NodeFactory.createURI(x) ; } return NodeFmtLib.str(node) ; }
str = NodeFmtLib.str(node, (String)null, pmap0) ;