Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Need help with designing deep tree of type relationships - can Neo4J cope?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ian Tompsett  
View profile  
 More options Nov 16 2012, 12:09 am
From: Ian Tompsett <iantompset...@gmail.com>
Date: Thu, 15 Nov 2012 21:09:05 -0800 (PST)
Local: Fri, Nov 16 2012 12:09 am
Subject: Re: [Neo4j] Need help with designing deep tree of type relationships - can Neo4J cope?

OK, I think I've created a suitable (albeit very small) test case
at http://tinyurl.com/chyu863

Not surprisingly this returns queries pretty quickly, but should be enough
to get the structure in place. I've added some noise in there to include
some paths that shouldn't be followed.

Hopefully it's clear enough - TypeA is the start point (node 4) and it's an
entity. It has 3 direct type relationships - to TypeB, Type AC and Type AD.
And then there's downstream type relationships, some of which are known
entity types (reflected by both an EntityTypeId property, and a
relationship back to the EntityType nodes). TypeA has entity relationships
to 2 and 3, but not 4 - as that's via TypeAD

So initially what I'd like is the most efficient cypher query for detecting
the direct entity relationships for TypeA - EntityType2 and EntityType3 in
my example. That is, I'd like to see the following relationships returned

TypeA-TypeD
TypeA-TypeAC
TypeA-TypeAD

Thanks again for your help

On Friday, 16 November 2012 07:53:37 UTC+11, Ian Tompsett wrote:

> Thanks Peter

> I'll have a look at the best way to get a sample for you - I should be
> able to choose a subset DLLs that still have the appropriate depth. I
> haven't played with the console, and my initial data load was done via a
> bit of gremlin from within neo4jclient so that might take me a little
> while. There'll also be a timezone lag too - I'm in Australia.

> In the meantime, re "the first down each path": my cypher queries return a
> (large) number of paths. Each of those paths follows a tree of type
> dependencies. Within each of those paths some of the nodes (ie types) will
> be my known entities. So far each path, I only want the path down as far as
> the first matching entity - even though the path could extend much further.

> For example given a single path of type usage:  *A*
> ->uses->B->uses->C->uses->*D*->uses->E->uses->*F*->uses->G->uses->H

> And say A, D and F are known entity types, when starting from A I would
> like my query to return the path to D, without the need to get to F. I
> would then create a direct relationship between A and D, but no direct
> relationship between A and F. Separately I would create a relationship
> between D and F.

> So far I've only managed to get my queries to return all of the paths in
> their entirety and then perform the filtering afterwards (using a where
> clause). This means that all of the paths are hugely deep and have a lot of
> repeated information.

> Hope that makes it a bit clearer.

> Thanks
> Ian
> On Friday, November 16, 2012 2:29:04 AM UTC+11, Peter Neubauer wrote:

>> Ian,
>> I think we can figure this out. Could you do a samll-ish sample over at
>> http://console.neo4j.org/usage.html, so we have a dataset to play with?
>> Then, we could reason about this. To start with, what do you mean by "the
>> first one down each path"? In your example (in the console) what would that
>> path be?

>> Thanks Ian!

>> /peter

>> Cheers,

>> /peter neubauer

>> G:  neubauer.peter
>> S:  peter.neubauer
>> P:  +46 704 106975
>> L:   http://www.linkedin.com/in/neubauer
>> T:   @peterneubauer

>> Neo4j 1.8 GA -
>> http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.