private void renderFoldedBlankNode(Individual individual) { builder.append("[").append(" # FOLDED: ").append(individual.getSubject().toString()); indenter.increase(); renderPredicates(true,individual); indenter.decrease(); builder.append(NL).append(indenter.indent()).append("]"); }
private void renderPredicateValues(Individual individual, URI predicate) { Assertions assertions=individual.getAssertions(predicate); Resource subject=individual.getSubject(); builder.append(NL).append(indenter.indent()).append(utils.toString(predicate)); String statementSeparator=" "; if(assertions.size()>3) { indenter.increase(); statementSeparator=NL.concat(indenter.indent()); } Iterator<Value> objectIterator = assertions.iterator(); String valueSeparator; do { builder.append(statementSeparator); Value object = objectIterator.next(); if(tryRenderingFolded(subject,object)) { valueSeparator=" ,"; } else { builder.append(utils.toString(object)); valueSeparator=","; } if(objectIterator.hasNext()) { builder.append(valueSeparator); } } while(objectIterator.hasNext()); if(assertions.size()>3) { indenter.decrease(); } }
@Test public void testDecrease$greaterThanZero() throws Exception { IndentUtils sut=new IndentUtils(); sut.increase(); sut.increase(); assertThat(sut.indent(),equalTo(DOUBLE_TAB)); sut.decrease(); assertThat(sut.indent(),equalTo(SINGLE_TAB)); }
public void visit(ElementNamedGraph arg0) { log(arg0); ind.increase(); arg0.getElement().visit(this); com.hp.hpl.jena.graph.Node graphNameNode = arg0.getGraphNameNode(); if(graphNameNode.isURI() && graphs.contains(graphNameNode.getURI())) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("Need to relocate graph: "+graphNameNode.getURI()); } } else { if(graphNameNode.isVariable() && variables.contains((Var)graphNameNode)) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("Need to filter result: "+graphNameNode); } } } ind.decrease(); }
public void visit(ElementGroup arg0) { log(arg0); ind.increase(); for(Element e:arg0.getElements()) { e.visit(this); } ind.decrease(); }
public void visit(ElementDataset arg0) { log(arg0); ind.increase(); arg0.getPatternElement().visit(this); ind.decrease(); }
public void visit(ElementUnion arg0) { log(arg0); ind.increase(); for(Element e:arg0.getElements()) { e.visit(this); } ind.decrease(); }
ind.decrease();