Package com.tinkerpop.pipes.transform

Examples of com.tinkerpop.pipes.transform.GraphQueryPipe


            return false;
        }
    }

    private static boolean optimizePipelineForGraphQuery(final GremlinPipeline pipeline, final Pipe pipe) {
        GraphQueryPipe queryPipe = null;
        for (int i = pipeline.size() - 1; i > 0; i--) {
            final Pipe temp = pipeline.get(i);
            if (temp instanceof GraphQueryPipe) {
                queryPipe = (GraphQueryPipe) temp;
                break;
            } else if (!(temp instanceof IdentityPipe))
                break;
        }

        if (null != queryPipe) {
            if (pipe instanceof PropertyFilterPipe) {
                final PropertyFilterPipe temp = (PropertyFilterPipe) pipe;
                queryPipe.addHasContainer(new QueryPipe.HasContainer(temp.getKey(), temp.getPredicate(), temp.getValue()));
            } else if (pipe instanceof IntervalFilterPipe) {
                final IntervalFilterPipe temp = (IntervalFilterPipe) pipe;
                queryPipe.addIntervalContainer(new QueryPipe.IntervalContainer(temp.getKey(), temp.getStartValue(), temp.getEndValue()));
            } else if (pipe instanceof RangeFilterPipe) {
                queryPipe.setLowRange(((RangeFilterPipe) pipe).getLowRange());
                queryPipe.setHighRange(((RangeFilterPipe) pipe).getHighRange());
            }
            pipeline.addPipe(new IdentityPipe());
            return true;
        } else {
            return false;
View Full Code Here


     * @param key   they key that all the emitted vertices should be checked on
     * @param value the value that all the emitted vertices should have for the key
     * @return the extended Pipeline
     */
    public GremlinPipeline<S, Vertex> V(final String key, final Object value) {
        return this.add(new GraphQueryPipe(Vertex.class)).has(key, value);
    }
View Full Code Here

     * @param key   they key that all the emitted edges should be checked on
     * @param value the value that all the emitted edges should have for the key
     * @return the extended Pipeline
     */
    public GremlinPipeline<S, Edge> E(final String key, final Object value) {
        return this.add(new GraphQueryPipe(Edge.class)).has(key, value);
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.pipes.transform.GraphQueryPipe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.