private void createExternalIndex(PropertyKey key, Class<? extends Element> clazz, String backingIndex) { mgmt.addIndexKey(getExternalIndex(clazz,backingIndex),key); }
private void setupChainGraph(int numV, String[] strs, boolean sameNameMapping) { clopen(option(INDEX_NAME_MAPPING, INDEX), sameNameMapping); TitanGraphIndex vindex = getExternalIndex(Vertex.class, INDEX); TitanGraphIndex eindex = getExternalIndex(Edge.class, INDEX); TitanGraphIndex pindex = getExternalIndex(TitanVertexProperty.class, INDEX); PropertyKey name = makeKey("name", String.class); mgmt.addIndexKey(vindex, name, getStringMapping()); mgmt.addIndexKey(eindex, name, getStringMapping()); mgmt.addIndexKey(pindex, name, getStringMapping(), Parameter.of("mapped-name", "xstr")); PropertyKey text = makeKey("text", String.class); mgmt.addIndexKey(vindex, text, getTextMapping(), Parameter.of("mapped-name", "xtext")); mgmt.addIndexKey(eindex, text, getTextMapping()); mgmt.addIndexKey(pindex, text, getTextMapping()); mgmt.makeEdgeLabel("knows").signature(name).make(); mgmt.makePropertyKey("uid").dataType(String.class).signature(text).make(); finishSchema(); TitanVertex previous = null; for (int i = 0; i < numV; i++) { TitanVertex v = graph.addVertex("name", strs[i % strs.length], "text", strs[i % strs.length]); Edge e = v.addEdge("knows", previous == null ? v : previous, "name", strs[i % strs.length], "text", strs[i % strs.length]); VertexProperty p = v.property("uid", "v" + i, "name", strs[i % strs.length], "text", strs[i % strs.length]); previous = v; } }
mgmt.addIndexKey(mgmt.getGraphIndex("theIndex"), time, getFieldMap(time)); finishSchema(); newTx(); mgmt.addIndexKey(mgmt.getGraphIndex("theIndex"), height); if (indexFeatures.supportsCardinality(Cardinality.LIST)) { PropertyKey phone = mgmt.getPropertyKey("phone"); mgmt.addIndexKey(mgmt.getGraphIndex("theIndex"), phone, new Parameter("mapping", Mapping.STRING));
mgmt.addIndexKey(index2, weight); fail(); } catch (IllegalArgumentException e) { mgmt.addIndexKey(index2, weight); fail(); } catch (IllegalArgumentException e) {
private void createExternalIndex(PropertyKey key, Class<? extends Element> clazz, String backingIndex) { mgmt.addIndexKey(getExternalIndex(clazz,backingIndex),key); }
@Override public void addVertexIndexKey(String indexName, AtlasPropertyKey propertyKey) { PropertyKey titanKey = TitanObjectFactory.createPropertyKey(propertyKey); TitanGraphIndex vertexIndex = management.getGraphIndex(indexName); management.addIndexKey(vertexIndex, titanKey); }
@Override public void addVertexIndexKey(String indexName, AtlasPropertyKey propertyKey) { PropertyKey titanKey = TitanObjectFactory.createPropertyKey(propertyKey); TitanGraphIndex vertexIndex = management.getGraphIndex(indexName); management.addIndexKey(vertexIndex, titanKey); }
private void setupChainGraph(int numV, String[] strs, boolean sameNameMapping) { clopen(option(INDEX_NAME_MAPPING,INDEX),sameNameMapping); TitanGraphIndex vindex = getExternalIndex(Vertex.class,INDEX); TitanGraphIndex eindex = getExternalIndex(Edge.class,INDEX); TitanGraphIndex pindex = getExternalIndex(TitanProperty.class,INDEX); PropertyKey name = makeKey("name",String.class); mgmt.addIndexKey(vindex, name, getStringMapping()); mgmt.addIndexKey(eindex, name, getStringMapping()); mgmt.addIndexKey(pindex, name, getStringMapping(), Parameter.of("mapped-name", "xstr")); PropertyKey text = makeKey("text",String.class); mgmt.addIndexKey(vindex, text, getTextMapping(), Parameter.of("mapped-name","xtext")); mgmt.addIndexKey(eindex, text, getTextMapping()); mgmt.addIndexKey(pindex, text, getTextMapping()); mgmt.makeEdgeLabel("knows").signature(name).make(); mgmt.makePropertyKey("uid").dataType(String.class).signature(text).make(); finishSchema(); TitanVertex previous = null; for (int i=0;i<numV;i++) { TitanVertex v = graph.addVertex(null); v.setProperty("name",strs[i%strs.length]); v.setProperty("text",strs[i%strs.length]); TitanEdge e = v.addEdge("knows",previous==null?v:previous); e.setProperty("name",strs[i%strs.length]); e.setProperty("text",strs[i%strs.length]); TitanProperty p = v.addProperty("uid","v"+i); p.setProperty("name", strs[i % strs.length]); p.setProperty("text", strs[i % strs.length]); previous=v; } }
mgmt.addIndexKey(mgmt.getGraphIndex("theIndex"),time, getFieldMap(time)); finishSchema(); newTx(); mgmt.addIndexKey(mgmt.getGraphIndex("theIndex"),height); finishSchema();
try { mgmt.addIndexKey(index2,weight); fail(); } catch (IllegalArgumentException e) {} try { mgmt.addIndexKey(index2,weight); fail(); } catch (IllegalArgumentException e) {}