JanusGraph / JanusGraph/janusgraph

Caused by: java.lang.IllegalStateException: Multiple properties exist for the provided key, use Vertex.properties(lang)

Open
#1,587 2 comments 0 reactions 0 assignees View on GitHub
kind/bug/possible
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

**When I bulk load json data to janusgraph with BulkLoadVertexProgram(IncrementalBulkLoader),The problem has been encountered.
I want to know why this exception is thrown when the property value is more than two**

**tools version**
janusgraph-0.3.1
hadoop-gremlin-3.3.0
hbase-1.1.3
es-6.2.4

**janusgraph schema**
```java
JanusGraphManagement m = janusGraph.openManagement()
VertexLabel person = m.makeVertexLabel("person").make()
VertexLabel software = m.makeVertexLabel("software").make()
PropertyKey blid = m.makePropertyKey("bulkLoader.vertex.id").dataType(Long.class).make()
PropertyKey age = m.makePropertyKey("age").dataType(Integer.class).cardinality(Cardinality.LIST).make()
PropertyKey name = m.makePropertyKey("name").dataType(String.class).cardinality(Cardinality.SET).make()
PropertyKey lang = m.makePropertyKey("lang").dataType(String.class).cardinality(Cardinality.LIST).make()
m.addProperties(person, blid, name, age)
m.addProperties(software, blid, name, lang)
EdgeLabel created = m.makeEdgeLabel("created").make()
EdgeLabel knows = m.makeEdgeLabel("knows").make()
PropertyKey weight = m.makePropertyKey("weight").dataType(Float.class).make()
m.addProperties(created, weight)
m.addProperties(knows, weight)
//index
JanusGraphIndex index = m.buildIndex("mixedIndex", Vertex.class).addKey(name, Mapping.TEXT.asParameter()).buildMixedIndex("search")//不支持唯一性检查,search为index.search.backend中的search
//使用IncrementBulkLoader导入时,去掉下面注释
JanusGraphIndex bidIndex = m.buildIndex("byBulkLoaderVertexId", Vertex.class).addKey(blid).indexOnly(person).buildMixedIndex("search")
m.commit()
```

**my code**
```java
JanusgraphSchema.defineGratefulDeadSchema(janusGraph);
Graph graph = GraphFactory.open("config/hadoop-graphson.properties");
BulkLoaderVertexProgram blvp = BulkLoaderVertexProgram.build().bulkLoader(IncrementalBulkLoader.class).writeGraph("config/janusgraph-hbase-es.properties").create(graph);
graph.compute(SparkGraphComputer.class).program(blvp).submit().get();
graph.close();
GraphTraversalSource g = janusGraph.traversal();
List> vertexList = g.V().valueMap().toList();
System.out.println("data1: " + vertexList);
janusGraph.close();
```

Contributor guide

Open the contributing guide

Research direction

Start with BulkLoaderVertexProgram and IncrementalBulkLoader, then trace how the schema's LIST and SET cardinalities are handled before the valueMap() call. Reproduce the exception with the supplied JanusGraph, Hadoop-Gremlin, HBase, and Elasticsearch versions; done means determining whether the behavior is expected and documenting or correcting the handling of multiple property values.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, java
Domain
data-engineering, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.