[orientdb] Re: Help converting relational database schema to graph

2015-03-19 Thread Colin
Hi Phil, It's the query that never ends...! I looked over your schema and data, and maybe I misunderstood you or came up with my own interpretation, but in my mind each tag was its own instance 'owned' by a particular person. I would expect that a person could create his own custom tags from m

Re: [orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread Ata Annamamedov
I'm glad it could work for you. And yes, it is absolutely possible to add link property on the edge (we do that without any problem). With best regards, Ata On Wed, Mar 18, 2015 at 8:18 PM, Phil wrote: > Thanks Ata, yes that would work if it's possible to add a link property to > an edge. > >

[orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread Phil
Hi Colin, I've put together a quick test of this and it does indeed return Bob even if he did not apply the Red tag to Resource1. Attached are 2 files: 1) I run test_db_schema.sql as an argument to the console.sh script to create the database and schema. 2) I then start the console, connect to t

[orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread Colin
No, because the inner most select specifies "Resource1" as a starting point. -Colin Orient Technologies The Company behind OrientDB On Wednesday, March 18, 2015 at 9:28:22 AM UTC-5, Phil wrote: > > With the data in my diagram would this not also return Bob if he applied > the red tag only to R

[orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread Phil
Thanks Ata, yes that would work if it's possible to add a link property to an edge. On Wednesday, March 18, 2015 at 11:04:36 AM UTC+1, a...@yakyn.com wrote: > > Phil, I think it is easy to accomplish by adding property on the edge. > > Let us say you have Person --->tagged---> Resource, where "ta

[orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread Phil
With the data in my diagram would this not also return Bob if he applied the red tag only to Resource2 and not Resource1 ? He tagged Resource1 only with blue. On Wednesday, March 18, 2015 at 3:11:12 PM UTC+1, Colin wrote: > > Hi Phil, > > I may just be missing something, but here's a simple exam

[orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread Colin
Hi Phil, I may just be missing something, but here's a simple example of what I'm thinking. select from (select expand(in("AppliedTag")) from (select expand(out("HasTag")) from Resource where Id="Resource1") where Id="Red") where Name = "Bob" This will return Bob after selecting Resource1 and

[orientdb] Re: Help converting relational database schema to graph

2015-03-18 Thread ata
Phil, I think it is easy to accomplish by adding property on the edge. Let us say you have Person --->tagged---> Resource, where "tagged" is edge. You could add "tag_type" property (link to tag vertex) on this edge class. Alternatively, if finding what resources are tagged with which particular

[orientdb] Re: Help converting relational database schema to graph

2015-03-17 Thread Phil
Hi Colin, Maybe I'm missing something obvious but I still can't envisage how the 3 node model will work. In the example data below I can determine that both Bob and Alice have tagged Resource1 and that Resource1 has been tagged 'red' and 'blue'. I can also determine that Bob has applied the 'red

[orientdb] Re: Help converting relational database schema to graph

2015-03-17 Thread Colin
Hi Phil, You can accomplish everything you want with the three node model. With some of the more specific queries you will need to use nested select statements to filter out specific tags or persons (or even resources if you wanted). Let me know if you need further detailed help. Best regards

[orientdb] Re: Help converting relational database schema to graph

2015-03-16 Thread Phil
Thanks Patrick, that could work. The only thing I would be concerned about is the implications for querying the data, it would mean multiple instances of the Tag edge for the same tag content which would probably result in more complex and possibly less efficient queries for anything relating to

[orientdb] Re: Help converting relational database schema to graph

2015-03-16 Thread Phil
I was planning to have only one instance of each tag; this seems more 'normalised' to me and may make certian queries easier/more efficient e.g. discover all the unique tags for a resource without having to group them, or find all resourses with a particular tag. It's not set in stone though an

[orientdb] Re: Help converting relational database schema to graph

2015-03-16 Thread Colin
Hi Phil, Another quick question and then I'll respond to your last post based on your answer. Will there be a single instance of each tag (say "Family Photo") that multiple Person instances and Resources will use, or will there be multiple tag instances with the same name and properties just

[orientdb] Re: Help converting relational database schema to graph

2015-03-16 Thread Patrick Hoeffel
Phil, What if you made the Tag itself the Edge class, and perhaps add a couple of properties to the edge to give it appropriate context? Then your three-node graph above becomes a two-node graph with multiple "Tag" edges between them? You could add the timestamp to record when the Person add th

[orientdb] Re: Help converting relational database schema to graph

2015-03-16 Thread Phil
Hi Colin, thanks for your reply. 1) Yes a Resource can have multiple tags 2) I want to determine who applied a specific tag to a specific resource (could be more than one person). Multiple users may apply the same tag to the same resource, which is where I think your suggestion may not work to

[orientdb] Re: Help converting relational database schema to graph

2015-03-16 Thread Colin
Hi Phil, Two quick questions: 1) Can a Resource have multiple tags applied to it? 2) You want to be able to determine who created a specific tag, right? If my assumption is correct based on looking at your relational schema, I would create an edge between the Person and the Tag directly. -Colin