Search in sources :

Example 1 with AtlasEdgeDirection

use of org.apache.atlas.repository.graphdb.AtlasEdgeDirection in project atlas by apache.

the class Titan0GraphManagement method createEdgeIndex.

@Override
public void createEdgeIndex(String label, String indexName, AtlasEdgeDirection edgeDirection, List<AtlasPropertyKey> propertyKeys) {
    EdgeLabel edgeLabel = management.getEdgeLabel(label);
    if (edgeLabel == null) {
        edgeLabel = management.makeEdgeLabel(label).make();
    }
    Direction direction = TitanObjectFactory.createDirection(edgeDirection);
    PropertyKey[] keys = TitanObjectFactory.createPropertyKeys(propertyKeys);
    management.buildEdgeIndex(edgeLabel, indexName, direction, keys);
}
Also used : EdgeLabel(com.thinkaurelius.titan.core.EdgeLabel) AtlasEdgeLabel(org.apache.atlas.repository.graphdb.AtlasEdgeLabel) AtlasEdgeDirection(org.apache.atlas.repository.graphdb.AtlasEdgeDirection) Direction(com.tinkerpop.blueprints.Direction) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(com.thinkaurelius.titan.core.PropertyKey)

Example 2 with AtlasEdgeDirection

use of org.apache.atlas.repository.graphdb.AtlasEdgeDirection in project atlas by apache.

the class AtlasJanusVertex method getEdges.

@Override
public Iterable<AtlasEdge<AtlasJanusVertex, AtlasJanusEdge>> getEdges(AtlasEdgeDirection in) {
    Direction d = AtlasJanusObjectFactory.createDirection(in);
    Iterator<Edge> edges = getWrappedElement().edges(d);
    return graph.wrapEdges(edges);
}
Also used : AtlasEdgeDirection(org.apache.atlas.repository.graphdb.AtlasEdgeDirection) Direction(org.apache.tinkerpop.gremlin.structure.Direction) AtlasEdge(org.apache.atlas.repository.graphdb.AtlasEdge) Edge(org.apache.tinkerpop.gremlin.structure.Edge)

Example 3 with AtlasEdgeDirection

use of org.apache.atlas.repository.graphdb.AtlasEdgeDirection in project atlas by apache.

the class AtlasJanusVertex method getEdges.

@Override
public Iterable<AtlasEdge<AtlasJanusVertex, AtlasJanusEdge>> getEdges(AtlasEdgeDirection dir, String edgeLabel) {
    Direction d = AtlasJanusObjectFactory.createDirection(dir);
    Iterator<Edge> edges = getWrappedElement().edges(d, edgeLabel);
    return graph.wrapEdges(edges);
}
Also used : AtlasEdgeDirection(org.apache.atlas.repository.graphdb.AtlasEdgeDirection) Direction(org.apache.tinkerpop.gremlin.structure.Direction) AtlasEdge(org.apache.atlas.repository.graphdb.AtlasEdge) Edge(org.apache.tinkerpop.gremlin.structure.Edge)

Example 4 with AtlasEdgeDirection

use of org.apache.atlas.repository.graphdb.AtlasEdgeDirection in project atlas by apache.

the class AtlasJanusGraphManagement method createEdgeIndex.

@Override
public void createEdgeIndex(String label, String indexName, AtlasEdgeDirection edgeDirection, List<AtlasPropertyKey> propertyKeys) {
    EdgeLabel edgeLabel = management.getEdgeLabel(label);
    if (edgeLabel == null) {
        edgeLabel = management.makeEdgeLabel(label).make();
    }
    Direction direction = AtlasJanusObjectFactory.createDirection(edgeDirection);
    PropertyKey[] keys = AtlasJanusObjectFactory.createPropertyKeys(propertyKeys);
    if (management.getRelationIndex(edgeLabel, indexName) == null) {
        management.buildEdgeIndex(edgeLabel, indexName, direction, keys);
    }
}
Also used : EdgeLabel(org.janusgraph.core.EdgeLabel) AtlasEdgeLabel(org.apache.atlas.repository.graphdb.AtlasEdgeLabel) AtlasEdgeDirection(org.apache.atlas.repository.graphdb.AtlasEdgeDirection) Direction(org.apache.tinkerpop.gremlin.structure.Direction) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(org.janusgraph.core.PropertyKey)

Example 5 with AtlasEdgeDirection

use of org.apache.atlas.repository.graphdb.AtlasEdgeDirection in project incubator-atlas by apache.

the class Titan1Vertex method getEdges.

@Override
public Iterable<AtlasEdge<Titan1Vertex, Titan1Edge>> getEdges(AtlasEdgeDirection in) {
    Direction d = TitanObjectFactory.createDirection(in);
    Iterator<Edge> edges = getWrappedElement().edges(d);
    return graph.wrapEdges(edges);
}
Also used : AtlasEdgeDirection(org.apache.atlas.repository.graphdb.AtlasEdgeDirection) Direction(org.apache.tinkerpop.gremlin.structure.Direction) AtlasEdge(org.apache.atlas.repository.graphdb.AtlasEdge) Edge(org.apache.tinkerpop.gremlin.structure.Edge)

Aggregations

AtlasEdgeDirection (org.apache.atlas.repository.graphdb.AtlasEdgeDirection)6 Direction (org.apache.tinkerpop.gremlin.structure.Direction)5 AtlasEdge (org.apache.atlas.repository.graphdb.AtlasEdge)4 Edge (org.apache.tinkerpop.gremlin.structure.Edge)4 AtlasEdgeLabel (org.apache.atlas.repository.graphdb.AtlasEdgeLabel)2 AtlasPropertyKey (org.apache.atlas.repository.graphdb.AtlasPropertyKey)2 EdgeLabel (com.thinkaurelius.titan.core.EdgeLabel)1 PropertyKey (com.thinkaurelius.titan.core.PropertyKey)1 Direction (com.tinkerpop.blueprints.Direction)1 EdgeLabel (org.janusgraph.core.EdgeLabel)1 PropertyKey (org.janusgraph.core.PropertyKey)1