public static PathBlock deduplicate(PathBlock pattern) { PathBlock result = new PathBlock(); new LinkedHashSet<>(pattern.getList()).forEach(result::add); return result; }
public static PathBlock deduplicate(PathBlock pattern) { PathBlock result = new PathBlock(); new LinkedHashSet<>(pattern.getList()).forEach(result::add); return result; }
@Override public void visit(ElementPathBlock el) { // TODO Paths not handled yet List<TriplePath> triplePaths = el.getPattern().getList(); for(TriplePath triplePath : triplePaths) { Triple triple = triplePath.asTriple(); Quad quad = new Quad(defaultGraphName, triple); quads.add(quad); } //throw new RuntimeException("Not implemented"); }
public static void collectQuads(ElementPathBlock element, Context context, List<Quad> result) { Node graphNode = context.getGraphNode(); for(TriplePath triplePath : element.getPattern().getList()) { Triple triple = triplePath.asTriple(); if(triple == null) { logger.warn("Omitted non-simple triple"); } Quad quad = new Quad(graphNode, triple); result.add(quad); } }
public static void collectQuads(ElementPathBlock element, Context context, List<Quad> result) { Node graphNode = context.getGraphNode(); for(TriplePath triplePath : element.getPattern().getList()) { Triple triple = triplePath.asTriple(); if(triple == null) { logger.warn("Omitted non-simple triple"); } Quad quad = new Quad(graphNode, triple); result.add(quad); } }
public static void collectQuads(ElementPathBlock element, Context context, List<Quad> result) { Node graphNode = context.getGraphNode(); for(TriplePath triplePath : element.getPattern().getList()) { Triple triple = triplePath.asTriple(); if(triple == null) { logger.warn("Omitted non-simple triple"); } Quad quad = new Quad(graphNode, triple); result.add(quad); } }
@Override public void visit(ElementPathBlock el) { for (final TriplePath pth : el.getPattern().getList()) { if ( ! pth.isTriple()) { throw new QueryParseException("Paths not permitted in data quad", -1, -1) ; } } iter = iter.andThen( WrappedIterator.create(el.getPattern().getList().iterator()) .mapWith( pth -> pth.asTriple() ) .mapWith( MAP )); }
@Override public void visit(ElementPathBlock el) { for (final TriplePath pth : el.getPattern().getList()) { if ( ! pth.isTriple()) { throw new QueryParseException("Paths not permitted in data quad", -1, -1) ; } } iter = iter.andThen( WrappedIterator.create(el.getPattern().getList().iterator()) .mapWith( pth -> pth.asTriple() ) .mapWith( MAP )); }