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 the Tag to 
the Resource.

Would that work?

Patrick


On Monday, March 16, 2015 at 10:02:54 AM UTC-6, Phil wrote:
>
> 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 add a Person-Tag edge.
>
> With the schema below I could work out:
> * Who tagged a particular resource (any tag)
> * Which tags are applied to a particular resource
> * Which tags a person has used to tag resources
> But, as far as I can tell, not which tags a specific person has applied to 
> a specific resource, or which people tagged a specific resource with a 
> specific tag.
>
>
> <https://lh4.googleusercontent.com/-f_vYMOkwfrs/VQb-9HBN-aI/AAAAAAAAA-s/XjtHbI04_tE/s1600/db_graph2.png>
> -Phil
>
>
>
>
>
> On Monday, March 16, 2015 at 3:42:26 PM UTC+1, Colin wrote:
>>
>> 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
>>
>> Orient Technologies
>>
>> The Company behind OrientDB
>>
>>
>> On Sunday, March 15, 2015 at 1:25:16 AM UTC-5, Phil wrote:
>>>
>>> Hi, I'm just starting out investigating graph databases and OrientDB and 
>>> I'm trying to work out how to best model this scenario:
>>>
>>> In my app a user can tag a resource but I also need to know who tagged 
>>> which resource. In a relational database I would simply have a join table 
>>> which can be used to discover which user applied a particular tag. In my 
>>> initial attempt at converting this to a graph model I had 3 vertices for 
>>> Person, Resource and Tag but couldn't work out how to define edges that 
>>> allow me to determine which person applied a tag.
>>>
>>> All I could come up with is to add a fourth vertex to represent the 
>>> actual tagging event ('Review' in the schema below).
>>> Is this how you experts would handle such a scenario or is there a 
>>> better way?
>>>
>>>
>>>
>>> <https://lh5.googleusercontent.com/-XbURlewkAcM/VQUgcnwlriI/AAAAAAAAA98/qObASq70RjA/s1600/db_schema.png>
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to