[Blueprints] Features added to Graph

27 views
Skip to first unread message

Marko Rodriguez

unread,
May 11, 2012, 11:47:11 AM5/11/12
to gremli...@googlegroups.com
Hi,

There is a new Object in blueprints-core called Features:


Moreover, there is a new method in Graph called Graph.getFeatures().

This allows developers to learn about the quirks of an implementation and more over, it allows for code to dynamically adjust to the features of each implementation. Its first use case: the TestSuite. Finally, I added some compliance methods to Features which ensure that a vendor has fully specified their Features (no nulls allowed).

Please see TinkerGraph for an example of how Features are specified:

Finally, Wrapper-like classes can dynamically alter the feature set (e.g. IdGraph will make ignoresSuppliedIds = false). See how wrappers dynamically alter features:
Prior to this moment, such metadata was only in the TestSuites, but now we have exposed it.

Enjoy!,
Marko

P.S. This will all be released in TinkerPop 2 which is coming out in approximately 2 weeks.

daniel...@gmail.com

unread,
May 12, 2012, 10:04:34 PM5/12/12
to gremli...@googlegroups.com, gremli...@googlegroups.com
Marko, 

Awesome!  Have a related question.  Today I was using gremlin.  I realized it would be really helpful if you had the option of specifying the type of a property (e.g. Int, float, string, date).  One way this could be done is to encode the type for each property (e.g. name, age, ...) in a vertex:
(e.g. v(1).name = string, v(1).age = int, ...) and then use that vertex in your traversals when you need to type cast things (say in constructing objects that are persisted to other storage solutions)

What do you think?  Is there a better way?  
Thanks
Dan

Sent from my eiPhone
Reply all
Reply to author
Forward
0 new messages