Re: Proper way to define metaproperties in schema


David Brown <dave...@...>
 



On Monday, August 28, 2017 at 4:01:40 PM UTC-4, David Brown wrote:
Thanks for the quick replies. Thanks to the examples, I've determined this is a bug in Goblin.

On Monday, August 28, 2017 at 2:07:38 PM UTC-4, Jason Plurad wrote:
I opened up an issue to add docs on meta-properties and multi-properties.

This worked in the Gremlin Console:

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

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.