All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vertexium.cli.CliVertexiumCypherQueryContext Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium.cli;

import com.google.common.collect.Sets;
import org.vertexium.*;
import org.vertexium.cypher.VertexiumCypherQueryContext;
import org.vertexium.cypher.ast.model.CypherNodePattern;
import org.vertexium.cypher.ast.model.CypherRelationshipPattern;
import org.vertexium.cypher.executor.ExpressionScope;
import org.vertexium.mutation.ElementMutation;
import org.vertexium.mutation.ExistingElementMutation;

import java.util.Set;

public class CliVertexiumCypherQueryContext extends VertexiumCypherQueryContext {
    private static String labelPropertyName;

    public CliVertexiumCypherQueryContext(Graph graph, Authorizations authorizations) {
        super(graph, authorizations);
    }

    public static void setLabelPropertyName(String labelPropertyName) {
        CliVertexiumCypherQueryContext.labelPropertyName = labelPropertyName;
    }

    @Override
    public Visibility calculateVertexVisibility(CypherNodePattern nodePattern, ExpressionScope scope) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public String getLabelPropertyName() {
        return labelPropertyName;
    }

    @Override
    public  void setLabelProperty(ElementMutation m, String label) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public void removeLabel(ExistingElementMutation vertex, String label) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public  void setProperty(ElementMutation m, String propertyName, Object value) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public void removeProperty(ElementMutation m, String propertyName) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public String calculateEdgeLabel(CypherRelationshipPattern relationshipPattern, Vertex outVertex, Vertex inVertex, ExpressionScope scope) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public Visibility calculateEdgeVisibility(CypherRelationshipPattern relationshipPattern, Vertex outVertex, Vertex inVertex, ExpressionScope scope) {
        throw new VertexiumException("not implemented");
    }

    @Override
    public boolean isLabelProperty(Property property) {
        return property.getName().equals(getLabelPropertyName());
    }

    @Override
    public Set getVertexLabels(Vertex vertex) {
        return Sets.newHashSet((String) vertex.getPropertyValue(getLabelPropertyName()));
    }

    @Override
    public int getMaxUnboundedRange() {
        return 100;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy