Hey Peter & P,

Thanks for the responses!!  

My next concern regards using the (Node -relationship - node) information 
in NIH.SM as a guide to update relationships in the LC gdb. I used to do 
the equivalent thing in MySQL where I updated one column of a table with 
the equivalent column's data from another table. 

If I'm going to do this in Neo4j, then the two databases probably have to 
have compatible data models. The generalized situation is as follows: 

Lets say the LC gbd has nodes A and B w/ labels 1, 1.1, 1.2  connected by a 
generic, non-informative relationship.  I would set that up because I know 
that node A and node B have a relationship, I know they have particular 
labels, but I don't know their relationship type.  

(node A: Label 1: Label 1.1: Label 1.2)   - [r: generic] -> (node B: Label 
1: Label 1.1: Label 1.2) 

However, in NIH.SM, I know that there are somewhat equivalent nodes (node X 
and Y)  (this is where model compatibility comes in), with the same labels 
1, 1.1, 1.2  and very specific defined relationships.  

(node X: Label 1: Label 1.1: Label 1.2)   - [r: specific] -> (node Y: Label 
1: Label 1.1: Label 1.2) 

What I want to do is match the pattern of two nodes A to X and B to Y of 
the same Labels (properties might work too) and then update the LC gdb 
generic relationship with the specific  NIH.SM relationship.

OK, DISCLAIMER!  This “cypher” code is going to be a mess.  Not sure what 
I’m doing. Never-the-less, marching on, I figure in general the cypher code 
has got to ...

   - Identify nodes whose relationship I want to update via labels. They'll 
   all have the same generic, non-informative relationship.
   
START n=node(*)               

MATCH (A)-[r: generic ]-> (B)                                      


WHERE  (A: Label 1: Label 1.1: Label 1.2) 

AND Label 1 = “LC gdb” 

AND Label 1.1 = “abcd”

AND Label 1.2 = “efgh”     

 

AND (B: Label 1: Label 1.1: Label 1.2)     

AND Label 1 = “LC gdb” 

AND Label 1.1 = “ijkl”

AND Label 1.2 = “mnop”      


   - update relationship conditioned on relationship from nodes with the 
   same labels 

SET r = specific

WHERE  (X: Label 1: Label 1.1: Label 1.2) 

AND Label 1 = “NIH.SM” 

AND Label 1.1 = “abcd”

AND Label 1.2 = “efgh”     

 

AND (Y: Label 1: Label 1.1: Label 1.2)     

AND Label 1 = “NIH.SM” 

AND Label 1.1 = “ijkl”

AND Label 1.2 = “mnop”   


Am I even vaguely on the right track?

Jose


On Saturday, January 4, 2014 3:39:32 AM UTC-5, Peter Neubauer wrote:
>
> Yes,
> this sounds about right. You could use the NIH.SM dataset as a kind of 
> "silent" slave data in the LC gdb, used for LC gdb queries but not for 
> NIH.SM queries. Just make sure you are mirroring NIH.SM master data 
> changes correctly to LC gdb.
>
> /peter
>
>
> G:  neubauer.peter
> S:  peter.neubauer
> P:  +46 704 106975
> L:   http://www.linkedin.com/in/neubauer
> T:   @peterneubauer
>
> Neo4j 2.0.0              - 
> (graphs)-[:FOR]->(everyone)<http://blog.neo4j.org/2013/12/neo4j-20-ga-graphs-for-everyone.html>
> Do something useful - Teach your kids 1 hour code! <http://code.org/learn>
>  
>
> On Wed, Jan 1, 2014 at 5:26 AM, José F. Morales 
> <[email protected]<javascript:>
> > wrote:
>
>> Hello all, 
>>
>>
>> I am a Neo4j newbie and am using neo4j to model some clinical data.  I'll 
>> refer to my graph db as the LC gdb.  Further, the LC gdb will be 
>> influenced by another  database from NIH I'll refer to as  "NIH.SM.
>>
>>
>> I decided to reformat the NIH.SM and import it into Neo4j for two 
>> reasons:  First, this way I could get practical cypher practice.  Second, 
>> the LC gdb has a class of nodes whose undefined relationship types can 
>> be clarified by the NIH.SM. 
>>
>>
>> Never the less, the LC gdb application cannot be served directly by the 
>> NIH.SM.
>>
>>  
>>
>> Since, as I understand it, Neo4j cannot have more than one instance on a 
>> community server,  its never the less ok to combine the LC and NIH.SMgdb's 
>> since I can...
>>
>> 1)  use the NIH.SM to update the undefined LC gdb relationships
>>
>> 2) prevent un-wanted query output with labels
>>
>>
>>
>> Do I have this right?
>>
>>
>> Thanks,
>>
>> Jose
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Neo4j" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" 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/groups/opt_out.

Reply via email to