/** * Returns the name of the vertex label for this vertex. * * @return */ @Override public default String label() { return vertexLabel().name(); }
@Override protected void doRun() throws Exception { TitanVertex v = Iterables.<TitanVertex>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 (TitanEdge r : v.query().direction(Direction.OUT).labels(label2Traverse).edges()) { v = r.vertex(Direction.IN); } } } }
public static TitanGraph create(final String directory) { TitanFactory.Builder config = TitanFactory.build(); config.set("storage.backend", "berkeleyje"); config.set("storage.directory", directory); config.set("index." + INDEX_NAME + ".backend", "elasticsearch"); config.set("index." + INDEX_NAME + ".directory", directory + File.separator + "es"); config.set("index." + INDEX_NAME + ".elasticsearch.local-mode", true); config.set("index." + INDEX_NAME + ".elasticsearch.client-only", false); TitanGraph graph = config.open(); GraphOfTheGodsFactory.load(graph); return graph; }
private static IDManager.VertexIDType getVertexIDType(VertexLabel vlabel) { if (vlabel.isPartitioned()) { return IDManager.VertexIDType.PartitionedVertex; } else if (vlabel.isStatic()) { return IDManager.VertexIDType.UnmodifiableVertex; } else { return IDManager.VertexIDType.NormalVertex; } }
public default TitanGraphComputer resultMode(ResultMode mode) { result(mode.toResultGraph()); persist(mode.toPersist()); return this; }
@Override public default String key() { return propertyKey().name(); }
public boolean isConstrained(Direction direction) { if (direction==Direction.BOTH) return isConstrained(); if (this==MULTI) return false; if (this==SIMPLE) return true; return isUnique(direction); }
/** * Returns a {@link Builder} that allows to set the configuration options for opening a Titan 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 com.thinkaurelius.titan.core.TitanFactory.Builder#open()}. * * @return */ public static Builder build() { return new Builder(); }
@Override protected LocalLockMediator<StoreTransaction> getDefaultMediator() { throw new TitanConfigurationException("Local lock mediator prefix must not be empty or null"); } }
@Override public void run(TitanTransaction tx) { TitanVertex v1 = tx.addVertex("time", 2, "text", "hello"); } });