scenario

Gremlin load command line Graph of the Gods (website portal Demo) GraphOfTheGodsFactory. Load (Graph)

Problem E04: Error SchemaViolationException was reported when loading sample diagrams

Error message:

org.janusgraph.core.SchemaViolationException: Adding this property for key [~T$SchemaName] and value [rtname] violates a uniqueness constraint [SystemIndex#~T$SchemaName]

Case presumptions that apply to other SchemaviolationExceptions

Analysis of the

[rtName] specifies a Schema conflict. [rtName] violates the uniqueness constraint. The SchemaName attribute is unique, and the added value conflicts with a pre-existing value. The Graph of the Gods has been loaded before, the load command has been executed, the same data already exists in the store, and the data is added again.

The solution

Plan a

Do not need to perform GraphOfTheGodsFactory. Load (graph) statements, for example queries directly.

gremlin> g = graph.traversal()= = > graphtraversalsource [standardjanusgraph [CQL: [127.0.0.1]], the standard]gremlin> saturn = g.V().has('name'.'saturn').next()
==>v[256]
gremlin> g.V(saturn).valueMap()
==>[name:[saturn], age:[10000]]
gremlin> g.V(saturn).in('father').in('father').values('name')
==>hercules
Copy the code

Scheme 2

  • Delete graph, data, schema, etc.JanusGraphFactory.drop(graph)

After deleting the graph, close the gremlin Console and restart the graph before executing the load. Otherwise an error
Could not re-open management log

org.janusgraph.core.JanusGraphException: Could not re-open management log

Or:

  • Delete the data table in the storage backend, and then executeGraphOfTheGodsFactory.load(graph)Can. The default HBase data table name isjanusgraph

JanusGraph problem and Solution series

JanusGraph Learning Notes – Problems and Solutions (PART 1)

conclusion

Notes continue to be updated, welcome to follow. If helpful, praise is to encourage!