{"action":"created","issue":{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/489","labels_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/489/comments","events_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/489/events","html_url":"https://github.com/tinkerpop/tinkerpop3/issues/489","id":54747453,"number":489,"title":"meta-properties and multi-properties for security and history ","user":{"login":"BrynCooke","id":747836,"avatar_url":"https://avatars.githubusercontent.com/u/747836?v=3","gravatar_id":"","url":"https://api.github.com/users/BrynCooke","html_url":"https://github.com/BrynCooke","followers_url":"https://api.github.com/users/BrynCooke/followers","following_url":"https://api.github.com/users/BrynCooke/following{/other_user}","gists_url":"https://api.github.com/users/BrynCooke/gists{/gist_id}","starred_url":"https://api.github.com/users/BrynCooke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrynCooke/subscriptions","organizations_url":"https://api.github.com/users/BrynCooke/orgs","repos_url":"https://api.github.com/users/BrynCooke/repos","events_url":"https://api.github.com/users/BrynCooke/events{/privacy}","received_events_url":"https://api.github.com/users/BrynCooke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/labels/enhancement","name":"enhancement","color":"009800"},{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/labels/structure","name":"structure","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-19T10:27:36Z","updated_at":"2015-01-23T01:58:19Z","closed_at":null,"body":"Recently I have been looking at history and security GraphStrategies with @rjbriody and it seems like meta-properties and multi-properties may not fulfil their potential in their current form. In particular due to the lack of support on edges.\r\n\r\nMeta and multi-property support is at the cost of a more complex element api than TP2 get/setProperty, so it's worth making sure that the extra effort is worth it for end users. (https://github.com/tinkerpop/tinkerpop3/issues/389)\r\n\r\nHere are the use cases and the difficulties faced:\r\n\r\n### SecurityGraphStrategy\r\n* User wants to restrict access to reading/writing a property on an element on the graph. This applies equally to edges as well as vertices.\r\n\r\n#### Issues\r\n* ACL information could be stored in meta-properties. However as there is no support on edges I end up using prefixed properties instead.\r\n* Lists of users and groups could be store in multi-properties, but again the lack of edge support means that I end up concatenating the users and groups to a string which is then indexed via contains.\r\n\r\nThere seems little point in having a different strategy for edges and vertices, so currently I'm not using VertexProperty at all to implement security.\r\n\r\n### HistoryGraphStrategy\r\n* User wants to be able to view the state of an element at any point in history. This applies to edges as well as vertices.\r\n\r\n#### Issues\r\n* Historical property data could be stored in a list in a meta-property. However, edges are not supported and meta-properties can not also have meta properties, so if the original property had meta-properties they could not be stored in a meta-property.\r\n* Historical property data could be stored in a list in a prefixed property. However, edges are not supported. I will probably end up creating a history vertex and storing the data there. Edges will have to be linked via UUID to the history vertex and for consistency vertices will probably do the same. Even with this hack I will still have to disable meta-properties for the client as I can't store meta-properties on meta-properties. An example of when I would want to do this would be to store the history of ACL.\r\n\r\n### Observations\r\n* I'm having to fall back to prefixing way too often.\r\n* The benefit of meta-properties does not seem to be clear cut over prefixing especially as they are not supported on edges, but also that meta-properties can also not have meta-properties.\r\n* End users will not understand why there is a distinction between element types for properties, and if they have to support edges then they'll end up using prefixing and custom serialization anyway. No matter how many times the reasoning is explained people will continue to ask. Get ready to start pushing a boulder up a hill.\r\n\r\n\r\nAnd lastly questions:\r\n* If via custom serialization e.g. JSON I can store structured data in a property and it will work on all types of element, then is a dedicated API only on vertices definitely worth the extra complexity? If I am really lucky then my Graph implementation may even support indexing JSON.\r\n* Do we think that vertex only history and security will be the main requirement of users, or will they want full graph support?\r\n"},"comment":{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/comments/71135749","html_url":"https://github.com/tinkerpop/tinkerpop3/issues/489#issuecomment-71135749","issue_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/489","id":71135749,"user":{"login":"davidcrouch","id":716508,"avatar_url":"https://avatars.githubusercontent.com/u/716508?v=3","gravatar_id":"","url":"https://api.github.com/users/davidcrouch","html_url":"https://github.com/davidcrouch","followers_url":"https://api.github.com/users/davidcrouch/followers","following_url":"https://api.github.com/users/davidcrouch/following{/other_user}","gists_url":"https://api.github.com/users/davidcrouch/gists{/gist_id}","starred_url":"https://api.github.com/users/davidcrouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidcrouch/subscriptions","organizations_url":"https://api.github.com/users/davidcrouch/orgs","repos_url":"https://api.github.com/users/davidcrouch/repos","events_url":"https://api.github.com/users/davidcrouch/events{/privacy}","received_events_url":"https://api.github.com/users/davidcrouch/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T01:58:19Z","updated_at":"2015-01-23T01:58:19Z","body":"I'm doing something almost identical (AuthorizationStrategy, AuditStrategy ported from TP2 wrappers) and am facing the same issues because of no meta-properties and multi-properties on edges. The benefits of vertex properties are negated with the constraints of edge properties and like Bryn I'm being forced to develop to the lowest common denominator (which is almost back to TP2 patterns). I'm trying to develop EdgeMetaPropertyStrategy as a workaround (and struggling).\r\n\r\nGiven limitations of a vendor graph DB, creative graph strategy developers will develop workarounds to fill the gaps (in the form of combinations of vertices, edges and properties). I'm finding that the TP3 data model (with new vertex property concept) is deceiving because my workarounds now need to consider both the vertex property and property concepts (added complexity). \r\n\r\nI think some focus needs to be put into the extensibility of TP3 that encourage developers to create workarounds for graph DB limitations using TP3 vs creating workarounds for TP3. I'm happy to provide some cycles to help.  \r\n"}}