Revisions
-
cleishm revised this gist
Nov 5, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -139,7 +139,7 @@ This query will get all successors on the throne ---- match (anne)<-[:SUCCEEDED*0..]-(suc) where anne.name="Anne" return suc.name ---- == Predecessor @@ -151,7 +151,7 @@ This retrieves just one predecessor. ---- match (g)-[:SUCCEEDED]->(pre) where g.name="George II" return pre.name ---- = Improvements -
cleishm revised this gist
Nov 5, 2013 . 1 changed file with 48 additions and 51 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,59 +38,59 @@ create (georgeIII {name:"George III"}) create (frederickWales {name:"Frederick"}) create (carolineMatilda {name:"Caroline Matilda"}) create (georgeII)-[:HAD_SON]->(frederickWales) create (frederickWales)-[:HAD_SON]->(georgeIII) create (frederickWales)-[:HAD_DAUGHTER]->(carolineMatilda) create (anne)-[:MEMBER_OF]->(houseOfSstuart) create (anne)-[:REIGNED]->(britain) create (georgeI)-[:MEMBER_OF]->(houseOfHanover) create (georgeI)-[:SUCCEEDED]->(anne) create (georgeI)-[:REIGNED]->(britain) create (georgeII)-[:MEMBER_OF]->(houseOfHanover) create (georgeII)-[:SUCCEEDED]->(georgeI) create (georgeII)-[:REIGNED]->(britain) create (georgeII)-[:REIGNED]->(hanover) create (georgeIII)-[:MEMBER_OF]->(houseOfHanover) create (georgeIII)-[:SUCCEEDED]->(georgeII) create (georgeIII)-[:REIGNED]->(britain) create (georgeIII)-[:REIGNED]->(hanover) create (frederickIV {name:"Frederick IV"}) create (christianVI {name:"Christian VI"}) create (frederickV {name:"Frederick V"}) create (christianVII {name:"Christian VII"}) create (frederickIV)-[:MEMBER_OF]->(houseOfOldenburg) create (frederickIV)-[:REIGNED]->(denmark) create (christianVI)-[:MEMBER_OF]->(houseOfOldenburg) create (christianVI)-[:REIGNED]->(denmark) create (christianVI)-[:SUCCEEDED]->(frederickIV) create (frederickV)-[:MEMBER_OF]->(houseOfOldenburg) create (frederickV)-[:REIGNED]->(denmark) create (frederickV)-[:SUCCEEDED]->(christianVI) create (christianVII)-[:MEMBER_OF]->(houseOfOldenburg) create (christianVII)-[:REIGNED]->(denmark) create (christianVII)-[:SUCCEEDED]->(frederickV) create (christianVII)-[:MARRIED]->(carolineMatilda) create (louise {name:"Louise of Great Britain"}) create (georgeII)-[:HAD_DAUGHTER]->(louise) create (frederickV)-[:MARRIED]->(louise) create (sophia {name: "Sophia Magdalena"}) create (louise)-[:HAD_DAUGHTER]->(sophia) create (frederickV)-[:HAD_DAUGHTER]->(sophia) create (charlesII {name:"Charles XII"}) create (ulrika {name:"Ulrika Eleonora"}) @@ -99,20 +99,20 @@ create (adolfF {name:"Adolf Frederick"}) create (gustavIII {name:"Gustav_III_of_Sweden"}) create (gustavIV {name:"Gustav IV Adolf"}) create (charlesII)<-[:SUCEEDED]-(ulrika) create (ulrika)<-[:SUCEEDED]-(frederick) create (frederick)<-[:SUCEEDED]-(adolfF) create (adolfF)<-[:SUCEEDED]-(gustavIII) create (gustavIII)<-[:SUCEEDED]-(gustavIV) create (charlesII)-[:REIGNED]->(sweden) create (ulrika)-[:REIGNED]->(sweden) create (frederick)-[:REIGNED]->(sweden) create (adolfF)-[:REIGNED]->(sweden) create (gustavIII)-[:REIGNED]->(sweden) create (gustavIV)-[:REIGNED]->(sweden) create (gustavIII)-[:MARRIED]->(sophia) ---- @@ -122,8 +122,7 @@ create gustavIII-[:MARRIED]-sophia How were the countries related through royal families? [source,cypher] ---- MATCH path =((c1)<-[:REIGNED]-(r1)-[:HAD_DAUGHTER|MARRIED*0..]-(r2)-[:REIGNED]->(c2)) WHERE c1.name="Great Britain" AND c2.name = 'Denmark and Norway' RETURN path ---- @@ -138,8 +137,7 @@ This query will get all successors on the throne //output [source,cypher] ---- match (anne)<-[:SUCCEEDED*0..]-(suc) where anne.name="Anne" return suc ---- @@ -151,13 +149,12 @@ This retrieves just one predecessor. //output [source,cypher] ---- match (g)-[:SUCCEEDED]->(pre) where g.name="George II" return pre ---- = Improvements * index names for better performance * crawl wikipedia (or wikidata) to get comprehensive database -
frant-hartm renamed this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ = Royalty in Europe The Royal families generaly have long histories and are often closely related. This link:http://en.wikipedia.org/wiki/Nicholas_II_of_Russia[citation from wikipedia] can give you better idea: -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,8 @@ The Royal families generaly have long histories and are often closely related. T [quote] Maternally, Nicholas was the nephew of several monarchs, including King Frederick VIII of Denmark, Queen Alexandra of the United Kingdom (queen consort of King Edward VII), and King George I of Greece. Nicholas, his wife, Alexandra, and Kaiser Wilhelm II of Germany were all first cousins of King George V of the United Kingdom. Nicholas was also a first cousin of both King Haakon VII and Queen Maud of Norway, as well as King Constantine I of Greece. While not first cousins, Nicholas and Kaiser Wilhelm II were second cousins, once removed, as each descended from King Frederick William III of Prussia, as well as third cousins, as they were both great-great-grandsons of Emperor Paul I of Russia. The rulers of Great Britain, Germany and Russia at the beginning of World War I were actually cousins! == Model -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ = European Royalty in 18th century The Royal families generaly have long histories and are often closely related. This link:http://en.wikipedia.org/wiki/Nicholas_II_of_Russia[citation from wikipedia] can give you better idea: [quote] Maternally, Nicholas was the nephew of several monarchs, including King Frederick VIII of Denmark, Queen Alexandra of the United Kingdom (queen consort of King Edward VII), and King George I of Greece. Nicholas, his wife, Alexandra, and Kaiser Wilhelm II of Germany were all first cousins of King George V of the United Kingdom. Nicholas was also a first cousin of both King Haakon VII and Queen Maud of Norway, as well as King Constantine I of Greece. While not first cousins, Nicholas and Kaiser Wilhelm II were second cousins, once removed, as each descended from King Frederick William III of Prussia, as well as third cousins, as they were both great-great-grandsons of Emperor Paul I of Russia. ---- The rulers of Great Britain, Germany and Russia were actually cousins. -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 25 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,21 @@ = European Royalty in 18th century The Royal families generaly have long histories and are often closely related. This citation from wikipedia can give you better idea: [quote] Maternally, Nicholas was the nephew of several monarchs, including King Frederick VIII of Denmark, Queen Alexandra of the United Kingdom (queen consort of King Edward VII), and King George I of Greece. Nicholas, his wife, Alexandra, and Kaiser Wilhelm II of Germany were all first cousins of King George V of the United Kingdom. Nicholas was also a first cousin of both King Haakon VII and Queen Maud of Norway, as well as King Constantine I of Greece. While not first cousins, Nicholas and Kaiser Wilhelm II were second cousins, once removed, as each descended from King Frederick William III of Prussia, as well as third cousins, as they were both great-great-grandsons of Emperor Paul I of Russia. [quote] The rulers of Great Britain, Germany and Russia were actually cousins. == Model Simple family relationships may be represented by following model image::https://docs.google.com/drawings/d/1iJxIliqLzj9-LWVtj1bZorr90Ulr5s3H_fACQpi2ImQ/pub?w=960&h=720[Model] == Sample data This sample data set is far from complete but it allows to demonstrate the main point. It contains monarch of Great Britain, Sweden, Denmark and Norway in 18th century. //hide //setup @@ -114,6 +118,21 @@ create gustavIII-[:MARRIED]-sophia ---- == Country relations How were the countries related through royal families? [source,cypher] ---- START c1=node(*),c2=node(*) MATCH path =(c1<-[:REIGNED]-r1-[:HAD_DAUGHTER|MARRIED*0..]-r2-[:REIGNED]->c2) WHERE c1.name="Great Britain" AND c2.name = 'Denmark and Norway' RETURN path ---- //graph There are also other posibilities to query. == Successors This query will get all successors on the throne @@ -139,16 +158,7 @@ where g.name="George II" return pre ---- = Improvements * index names for better performance * crawl wikipedia (or wikidata) to get comprehensive database -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,11 @@ = European Royalty in 18th century = The Royal families generaly have long histories and are often closely related. [quote] Maternally, Nicholas was the nephew of several monarchs, including King Frederick VIII of Denmark, Queen Alexandra of the United Kingdom (queen consort of King Edward VII), and King George I of Greece. Nicholas, his wife, Alexandra, and Kaiser Wilhelm II of Germany were all first cousins of King George V of the United Kingdom. Nicholas was also a first cousin of both King Haakon VII and Queen Maud of Norway, as well as King Constantine I of Greece. While not first cousins, Nicholas and Kaiser Wilhelm II were second cousins, once removed, as each descended from King Frederick William III of Prussia, as well as third cousins, as they were both great-great-grandsons of Emperor Paul I of Russia. [quote] == Model image::https://docs.google.com/drawings/d/1iJxIliqLzj9-LWVtj1bZorr90Ulr5s3H_fACQpi2ImQ/pub?w=960&h=720[Model] -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ == Model image::https://docs.google.com/drawings/d/1iJxIliqLzj9-LWVtj1bZorr90Ulr5s3H_fACQpi2ImQ/pub?w=960&h=720[Model] == Sample data Let's add some sample data. This is far from complete but it allows to demonstrate the main point. -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ == Model image: https://docs.google.com/drawings/d/1iJxIliqLzj9-LWVtj1bZorr90Ulr5s3H_fACQpi2ImQ/pub?w=960&h=720 == Sample data Let's add some sample data. This is far from complete but it allows to demonstrate the main point. -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,9 @@ = European Royalty in 18th century = == Model image:https://docs.google.com/drawings/d/1iJxIliqLzj9-LWVtj1bZorr90Ulr5s3H_fACQpi2ImQ/pub?w=960&h=720 == Sample data Let's add some sample data. This is far from complete but it allows to demonstrate the main point. -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -94,12 +94,12 @@ create gustavIII<-[:SUCEEDED]-gustavIV create charlesII-[:REIGNED]->sweden create ulrika-[:REIGNED]->sweden create frederick-[:REIGNED]->sweden create adolfF-[:REIGNED]->sweden create gustavIII-[:REIGNED]->sweden create gustavIV-[:REIGNED]->sweden create gustavIII-[:MARRIED]-sophia ---- -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,7 +75,7 @@ create (louise {name:"Louise of Great Britain"}) create georgeII-[:HAD_DAUGHTER]->louise create frederickV-[:MARRIED]-louise create (sophia {name: "Sophia Magdalena"}) create louise-[:HAD_DAUGHTER]->sophia create frederickV-[:HAD_DAUGHTER]->sophia @@ -86,7 +86,11 @@ create (adolfF {name:"Adolf Frederick"}) create (gustavIII {name:"Gustav_III_of_Sweden"}) create (gustavIV {name:"Gustav IV Adolf"}) create charlesII<-[:SUCEEDED]-ulrika create ulrika<-[:SUCEEDED]-frederick create frederick<-[:SUCEEDED]-adolfF create adolfF<-[:SUCEEDED]-gustavIII create gustavIII<-[:SUCEEDED]-gustavIV create charlesII-[:REIGNED]->sweden create ulrika-[:REIGNED]->sweden -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -137,6 +137,4 @@ WHERE c1.name="Great Britain" AND c2.name = 'Denmark and Norway' RETURN path ---- //graph -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,8 +25,8 @@ create (georgeIII {name:"George III"}) create (frederickWales {name:"Frederick"}) create (carolineMatilda {name:"Caroline Matilda"}) create georgeII-[:HAD_SON]->frederickWales create frederickWales-[:HAD_SON]->georgeIII create frederickWales-[:HAD_DAUGHTER]->carolineMatilda create anne-[:MEMBER_OF]->houseOfSstuart -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,11 +16,19 @@ create (houseOfSstuart {name:"House of Stuart"}) create (houseOfHanover {name:"House of Hanover"}) create (houseOfOldenburg {name: "House of Oldenburg"}) create (anne {name:"Anne"}) create (georgeI {name:"George I"}) create (georgeII {name:"George II"}) create (georgeIII {name:"George III"}) create (frederickWales {name:"Frederick"}) create (carolineMatilda {name:"Caroline Matilda"}) create georgeII-[:HAD_SON}->frederickWales create frederickWales-[:HAD_SON}->georgeIII create frederickWales-[:HAD_DAUGHTER]->carolineMatilda create anne-[:MEMBER_OF]->houseOfSstuart create anne-[:REIGNED]->britain @@ -60,13 +68,16 @@ create christianVII-[:MEMBER_OF]->houseOfOldenburg create christianVII-[:REIGNED]->denmark create christianVII-[:SUCCEEDED]->frederickV create christianVII-[:MARRIED]-carolineMatilda create (louise {name:"Louise of Great Britain"}) create georgeII-[:HAD_DAUGHTER]->louise create frederickV-[:MARRIED]-louise create (sophia {name: "Sophia Magdalena of Denmark"}) create louise-[:HAD_DAUGHTER]->sophia create frederickV-[:HAD_DAUGHTER]->sophia create (charlesII {name:"Charles XII"}) create (ulrika {name:"Ulrika Eleonora"}) @@ -84,6 +95,8 @@ create adolfF-[:REIGNED]->sweden create gustavIII-[:REIGNED]->sweden create gustavIV-[:REIGNED]->sweden create gustavIII-[:MARRIED]-sofia ---- -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -69,7 +69,7 @@ create louise-[:HAD_DAUGHTER]->sophia create frederickV-[:HAD_DAUGHTER]-sophia create (charlesII {name:"Charles XII"}) create (ulrika {name:"Ulrika Eleonora"}) create (frederick {name:"Frederick I"}) create (adolfF {name:"Adolf Frederick"}) create (gustavIII {name:"Gustav_III_of_Sweden"}) -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 24 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Let's add some sample data. This is far from complete but it allows to demonstra create (britain {name:"Great Britain"}) create (hanover {name:"Hanover"}) create (denmark {name:"Denmark and Norway"}) create (sweden {name:"Sweden"}) create (houseOfSstuart {name:"House of Stuart"}) create (houseOfHanover {name:"House of Hanover"}) @@ -60,9 +61,30 @@ create christianVII-[:REIGNED]->denmark create christianVII-[:SUCCEEDED]->frederickV create (louise {name:"Louise of Great Britain"}) create georgeII-[:HAD_DAUGHTER]->louise create frederickV-[:MARRIED]-louise create (sophia {name: "Sophia Magdalena of Denmark"}) create louise-[:HAD_DAUGHTER]->sophia create frederickV-[:HAD_DAUGHTER]-sophia create (charlesII {name:"Charles XII"}) craete (ulrika {name:"Ulrika Eleonora"}) create (frederick {name:"Frederick I"}) create (adolfF {name:"Adolf Frederick"}) create (gustavIII {name:"Gustav_III_of_Sweden"}) create (gustavIV {name:"Gustav IV Adolf"}) create charlesII<-[:SUCEEDED]-ulrika<-[:SUCEEDED]-frederick<-[:SUCEEDED]-adolfF<-[:SUCEEDED]-gustavIII<-[:SUCEEDED]-gustavIV create charlesII-[:REIGNED]->sweden create ulrika-[:REIGNED]->sweden create frederik-[:REIGNED]->sweden create adolfF-[:REIGNED]->sweden create gustavIII-[:REIGNED]->sweden create gustavIV-[:REIGNED]->sweden ---- == Successors @@ -97,7 +119,7 @@ How were the countries related through royal families? [source,cypher] ---- START c1=node(*),c2=node(*) MATCH path =(c1<-[:REIGNED]-r1-[:HAD_DAUGHTER|MARRIED*0..]-r2-[:REIGNED]->c2) WHERE c1.name="Great Britain" AND c2.name = 'Denmark and Norway' RETURN path ---- -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -96,10 +96,10 @@ return pre How were the countries related through royal families? [source,cypher] ---- START c1=node(*),c2=node(*) MATCH path =(c1<-[:REIGNED]-r1-[:HAS_DAUGHTER|MARRIED*0..]-r2-[:REIGNED]->c2) WHERE c1.name="Great Britain" AND c2.name = 'Denmark and Norway' RETURN path ---- //graph1 -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -100,7 +100,7 @@ start c1=node(*),c2=node(*) match c1<-[:REIGNED]-r1-[:HAS_DAUGHTER|MARRIED*0..]-r2-[:REIGNED]->c2 where c1.name="Great Britain" AND c2.name = "Denmark and Norway" return c1,c2 ---- //graph1 -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,7 +97,7 @@ How were the countries related through royal families? [source,cypher] ---- start c1=node(*),c2=node(*) match c1<-[:REIGNED]-r1-[:HAS_DAUGHTER|MARRIED*0..]-r2-[:REIGNED]->c2 where c1.name="Great Britain" AND c2.name = "Denmark and Norway" return c1,c2 -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,7 +97,7 @@ How were the countries related through royal families? [source,cypher] ---- start c1=node(*),c2=node(*) match c1<-[:REIGNED]-r1-[:HAS_DAUGHTER*0|:MARRIED*0..]-r2-[:REIGNED]->c2 where c1.name="Great Britain" AND c2.name = "Denmark and Norway" return c1,c2 -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,7 +97,7 @@ How were the countries related through royal families? [source,cypher] ---- start c1=node(*),c2=node(*) match c1<-[:REIGNED]-r1-[:HAS_DAUGHTER*0..,:MARRIED*0..]-r2-[:REIGNED]->c2 where c1.name="Great Britain" AND c2.name = "Denmark and Norway" return c1,c2 -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,9 +97,9 @@ How were the countries related through royal families? [source,cypher] ---- start c1=node(*),c2=node(*) match c1<-[:REIGNED]-r1-[:HAS_DAUGHTER,:MARRIED*0..]-r2-[:REIGNED]->c2 where c1.name="Great Britain" AND c2.name = "Denmark and Norway" return c1,c2 //graph1 -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -91,6 +91,17 @@ return pre ---- == Country relations How were the countries related through royal families? [source,cypher] ---- start c1=node(*),c2=node(*) match c1<-[:REIGNED]-r1-[:HAS_DAUGHTER,MARRIED*0..]-r2-[:REIGNED]->c2 where c1.name="Great Britain" AND c2.name = "Denmark and Norway" return pre //graph1 //console -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -59,6 +59,9 @@ create christianVII-[:MEMBER_OF]->houseOfOldenburg create christianVII-[:REIGNED]->denmark create christianVII-[:SUCCEEDED]->frederickV create (louise {name:"Louise of Great Britain"}) create georgeII-[:HAS_DAUGHTER]->louise create frederickV-[:MARRIED]-louise ---- -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ create georgeIII-[:REIGNED]->hanover create (frederickIV {name:"Frederick IV"}) create (christianVI {name:"Christian VI"}) create (frederickV {name:"Frederick V"}) create (christianVII {name:"Christian VII"}) create frederickIV-[:MEMBER_OF]->houseOfOldenburg -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,7 @@ create georgeIII-[:REIGNED]->hanover create (frederickIV {name:"Frederick IV"}) create (christianVI {name:"Christian VI"}) create (frederickV {name:"Frederick V"} create (christianVII {name:"Christian VII"}) -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 26 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,55 +7,58 @@ Let's add some sample data. This is far from complete but it allows to demonstra //setup [source,cypher] ---- create (britain {name:"Great Britain"}) create (hanover {name:"Hanover"}) create (denmark {name:"Denmark and Norway"}) create (houseOfSstuart {name:"House of Stuart"}) create (houseOfHanover {name:"House of Hanover"}) create (houseOfOldenburg {name: "House of Oldenburg"}) create (anne {name:"Anne"}) create (georgeI {name:"George I"}) create (georgeII {name:"George II"}) create (georgeIII {name:"George III"}) create anne-[:MEMBER_OF]->houseOfSstuart create anne-[:REIGNED]->britain create georgeI-[:MEMBER_OF]->houseOfHanover create georgeI-[:SUCCEEDED]->anne create georgeI-[:REIGNED]->britain create georgeII-[:MEMBER_OF]->houseOfHanover create georgeII-[:SUCCEEDED]->georgeI create georgeII-[:REIGNED]->britain create georgeII-[:REIGNED]->hanover create georgeIII-[:MEMBER_OF]->houseOfHanover create georgeIII-[:SUCCEEDED]->georgeII create georgeIII-[:REIGNED]->britain create georgeIII-[:REIGNED]->hanover create (frederickIV {name:"Frederick IV"}) create (christianVI {name:Christian VI"}) create (frederickV {name:"Frederick V"} create (christianVII {name:"Christian VII"}) create frederickIV-[:MEMBER_OF]->houseOfOldenburg create frederickIV-[:REIGNED]->denmark create christianVI-[:MEMBER_OF]->houseOfOldenburg create christianVI-[:REIGNED]->denmark create christianVI-[:SUCCEEDED]->frederickIV create frederickV-[:MEMBER_OF]->houseOfOldenburg create frederickV-[:REIGNED]->denmark create frederickV-[:SUCCEEDED]->christianVI create christianVII-[:MEMBER_OF]->houseOfOldenburg create christianVII-[:REIGNED]->denmark create christianVII-[:SUCCEEDED]->frederickV ---- -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,7 +66,7 @@ This query will get all successors on the throne [source,cypher] ---- start anne=node(*) match anne<-[:SUCCEEDED*0..]-suc where anne.name="Anne" return suc ---- @@ -79,7 +79,7 @@ This retrieves just one predecessor. [source,cypher] ---- start g=node(*) match g-[:SUCCEEDED]->pre where g.name="George II" return pre ---- -
frant-hartm revised this gist
Sep 30, 2013 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,8 @@ = European Royalty in 18th century = == Sample data Let's add some sample data. This is far from complete but it allows to demonstrate the main point. //hide //setup [source,cypher] @@ -56,6 +59,9 @@ create georgeIII-[:LIVED_IN]->c19th ---- == Successors This query will get all successors on the throne //output [source,cypher] ---- @@ -65,6 +71,20 @@ where anne.name="Anne" return suc ---- == Predecessor This retrieves just one predecessor. //output [source,cypher] ---- start g=node(*) match g-[SUCCEEDED*0..]->pre where g.name="George II" return pre ---- //graph1 //console
NewerOlder