Re: Proper way to define metaproperties in schema
Jason Plurad <plu...@...>
I opened up an issue to add docs on meta-properties and multi-properties.
This worked in the Gremlin Console:
Were you trying something different?
gremlin> graph = JanusGraphFactory.build().set('storage.backend', 'inmemory').set('schema.default', 'none').open()
==>standardjanusgraph[inmemory:[127.0.0.1]]
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@7a360554
gremlin> name = mgmt.makePropertyKey('name').dataType(String.class).cardinality(Cardinality.SINGLE).make()
==>name
gremlin> foo = mgmt.makePropertyKey('foo').dataType(String.class).cardinality(Cardinality.SINGLE).make()
==>foo
gremlin> mgmt.commit()
==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin> v = g.addV('name', 'dave').next()
==>v[4232]
gremlin> g.V(v).properties('name').property('foo', 'bar').iterate()
gremlin> g.V(v).valueMap(true)
==>[label:vertex,id:4232,name:[dave]]
gremlin> g.V(v).properties('name').valueMap(true)
==>[value:dave,id:sx-39k-sl,foo:bar,key:name]
gremlin> g.V(v).properties('name').property('bla', 'dat').iterate()
Property Key with given name does not exist: bla
Were you trying something different?
On Monday, August 28, 2017 at 1:44:18 PM UTC-4, David Brown wrote:
Hello JanusGraph users,I have been experimenting with Janus, and using the automatic schema generation, metaproperties work as expected. However, when I set `schema.default=none` in the conf and define my own schema, metaproperties seem to quit working--metaproperty data is no longer returned in the Gremlin Server response. How should metaproperties be defined in the schema? I can't seem to find this information in the documentation. I can provide example schema definitions if necessary.Thanks,Dave