/** * Returns the name of the vertex label for this vertex. * * @return */ @Override default String label() { return vertexLabel().name(); }
default JanusGraphComputer resultMode(ResultMode mode) { result(mode.toResultGraph()); persist(mode.toPersist()); return this; } }
@Override protected void doRun() { JanusGraphVertex v = Iterables.getOnlyElement(tx.query().has(idKey, vertexId).vertices()); for (int i = 0; i < nodeTraversalCount; i++) { assertCount(expectedEdges, v.query().labels(label2Traverse).direction(Direction.BOTH).edges()); for (Object r : v.query().direction(Direction.OUT).labels(label2Traverse).edges()) { v = ((JanusGraphEdge) r).vertex(Direction.IN); } } } }
public static JanusGraph create(final String directory) { JanusGraphFactory.Builder config = JanusGraphFactory.build(); config.set("storage.backend", "berkeleyje"); config.set("storage.directory", directory); config.set("index." + INDEX_NAME + ".backend", "elasticsearch"); JanusGraph graph = config.open(); GraphOfTheGodsFactory.load(graph); return graph; }
public void initializeGraph(Configuration config) { if (!provided) { this.graph = (StandardJanusGraph) JanusGraphFactory.open((BasicConfiguration) config); } }
@Override default String key() { return propertyKey().name(); }
private RecordEntry(JanusGraphVertexProperty property) { this(property.longId(),property.value(),property.propertyKey()); } }
private static IDManager.VertexIDType getVertexIDType(VertexLabel vertexLabel) { if (vertexLabel.isPartitioned()) { return IDManager.VertexIDType.PartitionedVertex; } else if (vertexLabel.isStatic()) { return IDManager.VertexIDType.UnmodifiableVertex; } else { return IDManager.VertexIDType.NormalVertex; } }
@Override default JanusGraphVertex inVertex() { return vertex(Direction.IN); }
public boolean isConstrained(Direction direction) { if (direction == Direction.BOTH) return isConstrained(); return this != MULTI && (this == SIMPLE || isUnique(direction)); }
@Override protected LocalLockMediator<StoreTransaction> getDefaultMediator() { throw new JanusGraphConfigurationException("Local lock mediator prefix must not be empty or null"); } }
/** * Returns a {@link Builder} that allows to set the configuration options for opening a JanusGraph graph database. * <p> * In the builder, the configuration options for the graph can be set individually. Once all options are configured, * the graph can be opened with {@link org.janusgraph.core.JanusGraphFactory.Builder#open()}. * * @return */ public static Builder build() { return new Builder(); }
/** * Opens a {@link JanusGraph} database configured according to the provided configuration. * * @param configuration Configuration for the graph database * @return JanusGraph graph database */ public static JanusGraph open(ReadConfiguration configuration) { return open(configuration, null); }