public void testThreadBoundTx() { PropertyKey t = mgmt.makePropertyKey("type").dataType(Integer.class).make(); mgmt.buildIndex("etype", Edge.class).addKey(t).buildCompositeIndex(); ((StandardEdgeLabelMaker) mgmt.makeEdgeLabel("friend")).sortKey(t).make(); finishSchema();
PropertyKey name = mgmt.makePropertyKey("name").dataType(String.class).cardinality(Cardinality.SINGLE).make(); TitanGraphIndex nameIndex = mgmt.buildIndex("name", Vertex.class) .addKey(name).unique().buildCompositeIndex(); mgmt.setConsistency(nameIndex, ConsistencyModifier.LOCK); EdgeLabel married = mgmt.makeEdgeLabel("married").multiplicity(Multiplicity.ONE2ONE).make();
addKey(name, getStringMapping()).addKey(time).buildMixedIndex(INDEX); mgmt.buildIndex("index2", Edge.class).indexOnly(label). addKey(text, getTextMapping()).buildMixedIndex(INDEX);
TitanGraphIndex edge1 = mgmt.buildIndex("edge1",Edge.class).addKey(time).addKey(weight).buildCompositeIndex(); TitanGraphIndex edge2 = mgmt.buildIndex("edge2",Edge.class).indexOnly(connect).addKey(text).buildCompositeIndex(); TitanGraphIndex prop1 = mgmt.buildIndex("prop1",TitanProperty.class).addKey(time).buildCompositeIndex(); TitanGraphIndex prop2 = mgmt.buildIndex("prop2",TitanProperty.class).addKey(weight).addKey(text).buildCompositeIndex(); TitanGraphIndex vertex1 = mgmt.buildIndex("vertex1",Vertex.class).addKey(time).indexOnly(person).unique().buildCompositeIndex(); TitanGraphIndex vertex12 = mgmt.buildIndex("vertex12", Vertex.class).addKey(text).indexOnly(person).buildCompositeIndex(); TitanGraphIndex vertex2 = mgmt.buildIndex("vertex2",Vertex.class).addKey(time).addKey(name).indexOnly(org).buildCompositeIndex(); TitanGraphIndex vertex3 = mgmt.buildIndex("vertex3",Vertex.class).addKey(name).buildCompositeIndex(); mgmt.buildIndex("blablub",Vertex.class).addKey(text, Mapping.TEXT.getParameter()).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {} try { mgmt.buildIndex("edge1",Vertex.class).addKey(weight).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {} try { mgmt.buildIndex("jupdup",Vertex.class).addKey(ImplicitKey.ID).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {} try { mgmt.buildIndex("edgexyz",Edge.class).addKey(time).unique().buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {}
addKey(name, getStringMapping()).buildMixedIndex(INDEX); TitanGraphIndex index2 = mgmt.buildIndex("index2",Vertex.class).indexOnly(person). addKey(text, getTextMapping()).addKey(weight).buildMixedIndex(INDEX); TitanGraphIndex index3 = mgmt.buildIndex("index3",Vertex.class).indexOnly(org). addKey(text, getTextMapping()).addKey(weight).buildMixedIndex(INDEX); mgmt.buildIndex("index2",Vertex.class).addKey(weight).buildMixedIndex(INDEX); fail(); } catch (IllegalArgumentException e) {} try { mgmt.buildIndex("index2",Vertex.class).addKey(weight).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {} mgmt.buildIndex("index2",Vertex.class).addKey(weight).buildMixedIndex(INDEX); fail(); } catch (IllegalArgumentException e) {} try { mgmt.buildIndex("index2",Vertex.class).addKey(weight).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {}
mgmt.buildIndex("vcategory",Vertex.class).addKey(category).buildCompositeIndex(); mgmt.buildIndex("ecategory",Edge.class).addKey(category).buildCompositeIndex();
mgmt.buildPropertyIndex(sensor, "byTime", Order.DESC, time); mgmt.buildEdgeIndex(friend, "byTime", Direction.OUT, Order.DESC, time); mgmt.buildIndex("bySensorReading",Vertex.class).addKey(name).buildCompositeIndex(); finishSchema(); newTx();
PropertyKey height = mgmt.makePropertyKey("height").dataType(Decimal.class).make(); TitanGraphIndex index = mgmt.buildIndex("theIndex",Vertex.class) .addKey(text, getTextMapping(), getFieldMap(text)).buildMixedIndex(INDEX); finishSchema();
mgmt.buildIndex(foo,Vertex.class).addKey(f).buildCompositeIndex(); PropertyKey b = mgmt.makePropertyKey(bar).dataType(String.class).cardinality(Cardinality.LIST).make(); mgmt.buildIndex(bar,Vertex.class).addKey(b).buildCompositeIndex(); finishSchema();
if (mgmt.getGraphIndex(CHARACTER) == null) { final PropertyKey characterKey = mgmt.makePropertyKey(CHARACTER).dataType(String.class).make(); mgmt.buildIndex(CHARACTER, Vertex.class).addKey(characterKey).unique().buildCompositeIndex(); mgmt.buildIndex(COMIC_BOOK, Vertex.class).addKey(comicBookKey).unique().buildCompositeIndex(); mgmt.makePropertyKey(WEAPON).dataType(String.class).make(); mgmt.makeEdgeLabel(APPEARED).multiplicity(Multiplicity.MULTI).make();
public void testThreadBoundTx() { PropertyKey t = mgmt.makePropertyKey("type").dataType(Integer.class).make(); mgmt.buildIndex("etype",Edge.class).addKey(t).buildCompositeIndex(); ((StandardEdgeLabelMaker)mgmt.makeEdgeLabel("friend")).sortKey(t).make(); finishSchema();
mgmt.buildIndex("mi",Vertex.class).addKey(name, getTextMapping()).addKey(age).buildMixedIndex(INDEX); finishSchema(); TitanVertex vs[] = new TitanVertex[4];
addKey(name, getStringMapping()).addKey(time).buildMixedIndex(INDEX); mgmt.buildIndex("index2",Edge.class).indexOnly(label). addKey(text, getTextMapping()).buildMixedIndex(INDEX);
mgmt.buildIndex("byK",Vertex.class).addKey(k).buildCompositeIndex(); finishSchema();
TitanGraphIndex vIndex = manager. buildIndex("vertices", Vertex.class). addKey(vertexValue). addKey(kindValue). buildCompositeIndex(); manager. buildIndex("vertices2", Vertex.class). addKey(vertexValue). addKey(kindValue). addKey(typeValue). buildCompositeIndex();
TitanGraphIndex namei = mgmt.buildIndex("name",Vertex.class).addKey(name).unique().buildCompositeIndex(); mgmt.setConsistency(namei, ConsistencyModifier.LOCK); final PropertyKey age = mgmt.makePropertyKey("age").dataType(Integer.class).make(); mgmt.buildIndex("vertices",Vertex.class).addKey(age).buildMixedIndex(INDEX_NAME); final PropertyKey place = mgmt.makePropertyKey("place").dataType(Geoshape.class).make(); TitanGraphIndex eindex = mgmt.buildIndex("edges",Edge.class) .addKey(reason).addKey(place).buildMixedIndex(INDEX_NAME);
PropertyKey flag = makeKey("flag",Boolean.class); TitanGraphIndex composite = mgmt.buildIndex("composite",Vertex.class).addKey(name).addKey(weight).buildCompositeIndex(); TitanGraphIndex mixed = mgmt.buildIndex("mixed", Vertex.class).addKey(weight) .addKey(text, getTextMapping()).buildMixedIndex(INDEX); mixed.getName(); composite.getName(); finishSchema();
mgmt.buildIndex("theIndex",Vertex.class).addKey(mgmt.getPropertyKey("name")).buildCompositeIndex(); mgmt.commit();
TitanManagement.IndexBuilder nameIndexBuilder = mgmt.buildIndex("name", Vertex.class).addKey(name); if (uniqueNameCompositeIndex) nameIndexBuilder.unique(); TitanGraphIndex namei = nameIndexBuilder.buildCompositeIndex(); mgmt.setConsistency(namei, ConsistencyModifier.LOCK); final PropertyKey age = mgmt.makePropertyKey("age").dataType(Integer.class).make(); if (null != mixedIndexName) mgmt.buildIndex("vertices", Vertex.class).addKey(age).buildMixedIndex(mixedIndexName); final PropertyKey place = mgmt.makePropertyKey("place").dataType(Geoshape.class).make(); if (null != mixedIndexName) mgmt.buildIndex("edges", Edge.class).addKey(reason).addKey(place).buildMixedIndex(mixedIndexName);
EdgeLabel knows = mgmt.makeEdgeLabel("knows").multiplicity(Multiplicity.MULTI).make(); mgmt.buildEdgeIndex(knows, "byTime", Direction.BOTH, time); mgmt.buildIndex("timeIndex",Vertex.class).addKey(time).buildCompositeIndex(); mgmt.makeVertexLabel("people").make(); finishSchema();