From 9c87b6ef9775c445ed1f431a17ff7fe3b89baf45 Mon Sep 17 00:00:00 2001 From: Aleksandr Isaev Date: Fri, 20 Sep 2024 08:54:33 +0100 Subject: [PATCH 1/6] fixed incorrect recipe for birth bride own linkage --- .../endToEnd/builders/BirthBrideOwnMarriageBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthBrideOwnMarriageBuilder.java b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthBrideOwnMarriageBuilder.java index c6191f5a..467f75e4 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthBrideOwnMarriageBuilder.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthBrideOwnMarriageBuilder.java @@ -42,11 +42,11 @@ public static void main(String[] args) throws Exception { String number_of_records = args[1]; // e.g. EVERYTHING or 10000 etc. try( - BirthBrideSiblingLinkageRecipe linkageRecipe = new BirthBrideSiblingLinkageRecipe(sourceRepo, number_of_records, BirthBrideSiblingBundleBuilder.class.getName(), null) ) { + BirthBrideIdentityLinkageRecipe linkageRecipe = new BirthBrideIdentityLinkageRecipe(sourceRepo, number_of_records, BirthBrideSiblingBundleBuilder.class.getName(), null) ) { BitBlasterLinkageRunner runner = new BitBlasterLinkageRunner(); - int linkage_fields = BirthBrideIdentityLinkageRecipe.ALL_LINKAGE_FIELDS; + int linkage_fields = linkageRecipe.ALL_LINKAGE_FIELDS; int half_fields = linkage_fields - (linkage_fields / 2); while (linkage_fields >= half_fields) { From a12e0eacac3ad2a34d30227641bccd8f73b00c63 Mon Sep 17 00:00:00 2001 From: Aleksandr Isaev Date: Mon, 23 Sep 2024 13:58:15 +0100 Subject: [PATCH 2/6] Added code to count number of links made by each algorithm and fixed provenance for birthdeathsibling --- .../aleks/LinksCounter.java | 61 ++++++++++++++ .../BirthDeathSiblingBundleBuilder.java | 2 +- .../builders/BirthFatherIdentityBuilder.java | 84 ------------------- .../cs/population_linkage/graph/Query.java | 75 +++++++++++++++++ 4 files changed, 137 insertions(+), 85 deletions(-) create mode 100644 src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java delete mode 100644 src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthFatherIdentityBuilder.java diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java b/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java new file mode 100644 index 00000000..fad54e59 --- /dev/null +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java @@ -0,0 +1,61 @@ +package uk.ac.standrews.cs.population_linkage.aleks; +import org.neo4j.driver.Result; +import uk.ac.standrews.cs.neoStorr.impl.Store; +import uk.ac.standrews.cs.neoStorr.util.NeoDbCypherBridge; +import uk.ac.standrews.cs.population_linkage.graph.Query; + +import java.util.List; + +public class LinksCounter { + + public static void main(String[] args) { + NeoDbCypherBridge bridge = Store.getInstance().getBridge(); + + System.out.println("Number of links for each algorithm:"); + long[] numLinks = countLinks(bridge); + calculateBasicStats(numLinks); + } + + private static long[] countLinks(NeoDbCypherBridge bridge) { + List queries = Query.getAllLinkQueries(); + List algorithms = Query.getAllLinkerNames(); + long[] numLinks = new long[queries.size()]; + + for (int i = 0; i < queries.size(); i++) { + Result result = bridge.getNewSession().run(queries.get(i)); + List counts = result.list(r -> r.get("link_count").asLong()); + if (!counts.isEmpty()) { + long count = counts.get(0); + numLinks[i] = count; + System.out.println((i+1) + ". " + algorithms.get(i) + " -> " + count); + } + } + + return numLinks; + } + + private static void calculateBasicStats(long[] numLinks) { + List algorithms = Query.getAllLinkerNames(); + long lowestNum = 999999999; + int lowestIndex = -1; + long highestNum = 0; + int highestIndex = -1; + long totalNum = 0; + + for (int i = 0; i < numLinks.length; i++) { + if(numLinks[i] < lowestNum) { + lowestNum = numLinks[i]; + lowestIndex = i; + }else if(numLinks[i] > highestNum) { + highestNum = numLinks[i]; + highestIndex = i; + } + + totalNum += numLinks[i]; + } + + System.out.println("Lowest number of links: " + algorithms.get(lowestIndex) + " -> " + lowestNum); + System.out.println("Highest number of links: " + algorithms.get(highestIndex) + " -> " + highestNum); + System.out.println("Average number of links: " + totalNum / numLinks.length); + } +} diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthDeathSiblingBundleBuilder.java b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthDeathSiblingBundleBuilder.java index 2387f6e8..4657ca13 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthDeathSiblingBundleBuilder.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthDeathSiblingBundleBuilder.java @@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception { String number_of_records = args[1]; // e.g. EVERYTHING or 10000 etc. try( - BirthDeathSiblingLinkageRecipe linkageRecipe = new BirthDeathSiblingLinkageRecipe(sourceRepo, number_of_records, BirthBrideSiblingBundleBuilder.class.getName(), null) ) { + BirthDeathSiblingLinkageRecipe linkageRecipe = new BirthDeathSiblingLinkageRecipe(sourceRepo, number_of_records, BirthDeathSiblingBundleBuilder.class.getName(), null) ) { BitBlasterLinkageRunner runner = new BitBlasterLinkageRunner(); diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthFatherIdentityBuilder.java b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthFatherIdentityBuilder.java deleted file mode 100644 index 0e6c719f..00000000 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/BirthFatherIdentityBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2022 Systems Research Group, University of St Andrews: - * - * - * This file is part of the module population-linkage. - * - * population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later - * version. - * - * population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with population-linkage. If not, see - * . - */ -package uk.ac.standrews.cs.population_linkage.endToEnd.builders; - -import uk.ac.standrews.cs.neoStorr.impl.exceptions.BucketException; -import uk.ac.standrews.cs.neoStorr.impl.exceptions.RepositoryException; -import uk.ac.standrews.cs.population_linkage.graph.Query; -import uk.ac.standrews.cs.population_linkage.linkageRecipes.BirthFatherIdentityLinkageRecipe; -import uk.ac.standrews.cs.population_linkage.linkageRecipes.LinkageRecipe; -import uk.ac.standrews.cs.population_linkage.linkageRunners.BitBlasterLinkageRunner; -import uk.ac.standrews.cs.population_linkage.linkageRunners.MakePersistent; -import uk.ac.standrews.cs.population_linkage.supportClasses.Link; -import uk.ac.standrews.cs.population_linkage.supportClasses.LinkageQuality; -import uk.ac.standrews.cs.population_linkage.supportClasses.LinkageResult; -import uk.ac.standrews.cs.population_records.record_types.Birth; -import uk.ac.standrews.cs.population_records.record_types.Marriage; - -/** - * This class attempts to perform child on a birth certificate to that child as a father on a birth certificate. - */ -public class BirthFatherIdentityBuilder implements MakePersistent { - - public static void main(String[] args) throws Exception { - - String sourceRepo = args[0]; // e.g. umea - String number_of_records = args[1]; // e.g. EVERYTHING or 10000 etc. - - try( - BirthFatherIdentityLinkageRecipe linkageRecipe = new BirthFatherIdentityLinkageRecipe(sourceRepo, BirthFatherIdentityLinkageRecipe.class.getName(), null) ) { - - BitBlasterLinkageRunner runner = new BitBlasterLinkageRunner(); - - int linkage_fields = linkageRecipe.ALL_LINKAGE_FIELDS; - int half_fields = linkage_fields - (linkage_fields / 2 ); - - while( linkage_fields >= half_fields ) { - linkageRecipe.setNumberLinkageFieldsRequired(linkage_fields); - LinkageResult lr = runner.run(linkageRecipe, new BirthFatherIdentityBuilder(), false, true); - LinkageQuality quality = lr.getLinkageQuality(); - quality.print(System.out); - linkage_fields--; - } - } - } - - public void makePersistent(LinkageRecipe recipe, Link link) { - try { - - // role/record 1 is stored role - // role/record 2 is query role - - String std_id1 = link.getRecord1().getReferend(Birth.class).getString(Birth.STANDARDISED_ID); - String std_id2 = link.getRecord2().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID ); - - // if( !std_id1.equals(std_id2 ) ) { // DELETE IN NON homogeneous linkages - - if (!Query.DBSiblingReferenceExists(recipe.getBridge(), std_id2, std_id1, recipe.getLinksPersistentName())) { - Query.createDBSiblingReference( - recipe.getBridge(), - std_id2, - std_id1, - recipe.getLinksPersistentName(), - recipe.getNumberOfLinkageFieldsRequired(), - link.getDistance()); - } - } catch (BucketException | RepositoryException e) { - throw new RuntimeException(e); - } - } -} diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/graph/Query.java b/src/main/java/uk/ac/standrews/cs/population_linkage/graph/Query.java index bf61b41c..e8fee8df 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/graph/Query.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/graph/Query.java @@ -24,6 +24,7 @@ import org.neo4j.driver.types.Relationship; import uk.ac.standrews.cs.neoStorr.util.NeoDbCypherBridge; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -47,38 +48,60 @@ public class Query { // etc. refer to Births Deaths and Marriages NOT babies, mothers etc. private static final String BB_SIBLING_QUERY = "MATCH (a:Birth), (b:Birth) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Child\" } ]->(b)"; + private static final String BB_SIBLING_LINKNUM_QUERY = "MATCH (a:Birth)-[r:SIBLING]->(b:Birth) WHERE r.actors = \"Child-Child\" RETURN COUNT(r) AS link_count"; private static final String BM_FATHER_QUERY = "MATCH (a:Birth), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Father\" } ]->(b)"; private static final String BM_MOTHER_QUERY = "MATCH (a:Birth), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Mother\" } ]->(b)"; + private static final String BM_FATHER_LINKNUM_QUERY = "MATCH (a:Birth)-[r:ID]->(b:Marriage) WHERE r.actors = \"Child-Father\" RETURN COUNT(r) AS link_count"; + private static final String BM_MOTHER_LINKNUM_QUERY = "MATCH (a:Birth)-[r:ID]->(b:Marriage) WHERE r.actors = \"Child-Mother\" RETURN COUNT(r) AS link_count"; private static final String BM_BIRTH_GROOM_QUERY = "MATCH (a:Birth), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Groom\" } ]->(b)"; private static final String BM_BIRTH_BRIDE_QUERY = "MATCH (a:Birth), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Bride\" } ]->(b)"; + private static final String BM_BIRTH_GROOM_LINKNUM_QUERY = "MATCH (a:Birth)-[r:ID]->(b:Marriage) WHERE r.actors = \"Child-Groom\" RETURN COUNT(r) AS link_count"; + private static final String BM_BIRTH_BRIDE_LINKNUM_QUERY = "MATCH (a:Birth)-[r:ID]->(b:Marriage) WHERE r.actors = \"Child-Bride\" RETURN COUNT(r) AS link_count"; private static final String DD_SIBLING_QUERY = "MATCH (a:Death), (b:Death) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Deceased-Deceased\" } ]->(b)"; + private static final String DD_SIBLING_LINKNUM_QUERY = "MATCH (a:Death)-[r:SIBLING]->(b:Death) WHERE r.actors = \"Deceased-Deceased\" RETURN COUNT(r) AS link_count"; private static final String BD_DEATH_QUERY = "MATCH (a:Birth), (b:Death) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Deceased\" } ]->(b)"; + private static final String BD_DEATH_LINKNUM_QUERY = "MATCH (a:Birth)-[r:ID]->(b:Death) WHERE r.actors = \"Child-Deceased\" RETURN COUNT(r) AS link_count"; private static final String DM_DEATH_GROOM_QUERY = "MATCH (a:Death), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Deceased-Groom\" } ]->(b)"; private static final String DM_DEATH_BRIDE_QUERY = "MATCH (a:Death), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Deceased-Bride\" } ]->(b)";; + private static final String DM_DEATH_GROOM_LINKNUM_QUERY = "MATCH (a:Death)-[r:ID]->(b:Marriage) WHERE r.actors = \"Deceased-Groom\" RETURN COUNT(r) AS link_count"; + private static final String DM_DEATH_BRIDE_LINKNUM_QUERY = "MATCH (a:Death)-[r:ID]->(b:Marriage) WHERE r.actors = \"Deceased-Bride\" RETURN COUNT(r) AS link_count"; private static final String MM_BB_SIBLING_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Bride-Bride\" } ]->(b)"; private static final String MM_GG_SIBLING_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Groom-Groom\" } ]->(b)"; private static final String MM_GB_SIBLING_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Groom-Bride\" } ]->(b)"; + private static final String MM_BB_SIBLING_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Bride-Bride\" RETURN COUNT(r) AS link_count"; + private static final String MM_GG_SIBLING_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Groom-Groom\" RETURN COUNT(r) AS link_count"; + private static final String MM_GB_SIBLING_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Groom-Bride\" RETURN COUNT(r) AS link_count"; private static final String DB_SIBLING_QUERY = "MATCH (a:Death), (b:Birth) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Deceased-Child\" } ]->(b)"; private static final String DB_SIBLING_QUERY_SIMPLE = "MATCH (a:Death), (b:Birth) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, actors: \"Deceased-Child\" } ]->(b)"; + private static final String DB_SIBLING_LINKNUM_QUERY = "MATCH (a:Death)-[r:SIBLING]->(b:Birth) WHERE r.actors = \"Deceased-Child\" RETURN COUNT(r) AS link_count"; + private static final String DB_SIBLING_LINKNUM_QUERY_SIMPLE = "MATCH (a:Death)-[r:SIBLING]->(b:Birth) WHERE r.actors = \"Deceased-Child\" RETURN COUNT(r) AS link_count"; private static final String MM_GROOM_MARRIAGE_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Groom-Couple\" } ]->(b)"; private static final String MM_BRIDE_MARRIAGE_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Bride-Couple\" } ]->(b)"; + private static final String MM_GROOM_MARRIAGE_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:ID]->(b:Marriage) WHERE r.actors = \"Groom-Couple\" RETURN COUNT(r) AS link_count"; + private static final String MM_BRIDE_MARRIAGE_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:ID]->(b:Marriage) WHERE r.actors = \"Bride-Couple\" RETURN COUNT(r) AS link_count"; private static final String BM_GROOM_SIBLING_QUERY = "MATCH (a:Birth), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Groom\" } ]->(b)"; private static final String BM_BRIDE_SIBLING_QUERY = "MATCH (a:Birth), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Child-Bride\" } ]->(b)"; + private static final String BM_GROOM_SIBLING_LINKNUM_QUERY = "MATCH (a:Birth)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Child-Groom\" RETURN COUNT(r) AS link_count"; + private static final String BM_BRIDE_SIBLING_LINKNUM_QUERY = "MATCH (a:Birth)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Child-Bride\" RETURN COUNT(r) AS link_count"; private static final String MM_BRIDE_BRIDE_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Bride-Bride\" } ]->(b)"; private static final String MM_GROOM_GROOM_QUERY = "MATCH (a:Marriage), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:ID { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Groom-Groom\" } ]->(b)"; + private static final String MM_BRIDE_BRIDE_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:ID]->(b:Marriage) WHERE r.actors = \"Bride-Bride\" RETURN COUNT(r) AS link_count"; + private static final String MM_GROOM_GROOM_LINKNUM_QUERY = "MATCH (a:Marriage)-[r:ID]->(b:Marriage) WHERE r.actors = \"Groom-Groom\" RETURN COUNT(r) AS link_count"; private static final String DM_DECEASED_BRIDE_QUERY = "MATCH (a:Death), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Deceased-Bride\" } ]->(b)"; private static final String DM_DECEASED_GROOM_QUERY = "MATCH (a:Death), (b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to CREATE (a)-[r:SIBLING { provenance: $prov, fields_populated: $fields, distance: $distance, actors: \"Deceased-Groom\" } ]->(b)"; + private static final String DM_DECEASED_BRIDE_LINKNUM_QUERY = "MATCH (a:Death)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Deceased-Bride\" RETURN COUNT(r) AS link_count"; + private static final String DM_DECEASED_GROOM_LINKNUM_QUERY = "MATCH (a:Death)-[r:SIBLING]->(b:Marriage) WHERE r.actors = \"Deceased-Groom\" RETURN COUNT(r) AS link_count"; // queries for use in predicates - return a relationship if it exists @@ -381,6 +404,58 @@ public static boolean DMGroomSiblingReferenceExists(NeoDbCypherBridge bridge, St return linkExists( bridge, DM_DECEASED_GROOM_EXISTS_QUERY, standard_id_to, standard_id_from, provenance ); } + public static List getAllLinkQueries(){ + return Arrays.asList( + BB_SIBLING_LINKNUM_QUERY, + BD_DEATH_LINKNUM_QUERY, + BM_BIRTH_BRIDE_LINKNUM_QUERY, + BM_BIRTH_GROOM_LINKNUM_QUERY, + DM_DEATH_GROOM_LINKNUM_QUERY, + DM_DEATH_BRIDE_LINKNUM_QUERY, + BM_FATHER_LINKNUM_QUERY, + BM_MOTHER_LINKNUM_QUERY, + DD_SIBLING_LINKNUM_QUERY, + MM_GG_SIBLING_LINKNUM_QUERY, + MM_BB_SIBLING_LINKNUM_QUERY, + MM_GB_SIBLING_LINKNUM_QUERY, + DB_SIBLING_LINKNUM_QUERY, + BM_BRIDE_SIBLING_LINKNUM_QUERY, + BM_GROOM_SIBLING_LINKNUM_QUERY, + MM_BRIDE_BRIDE_LINKNUM_QUERY, + MM_GROOM_GROOM_LINKNUM_QUERY, + MM_BRIDE_MARRIAGE_LINKNUM_QUERY, + MM_GROOM_MARRIAGE_LINKNUM_QUERY, + DM_DECEASED_BRIDE_LINKNUM_QUERY, + DM_DECEASED_GROOM_LINKNUM_QUERY + ); + } + + public static List getAllLinkerNames(){ + return Arrays.asList( + "BB_SIBLING", + "BD_DEATH", + "BM_BIRTH_BRIDE", + "BM_BIRTH_GROOM", + "DM_DEATH_GROOM", + "DM_DEATH_BRIDE", + "BM_FATHER", + "BM_MOTHER", + "DD_SIBLING", + "MM_GG_SIBLING", + "MM_BB_SIBLING", + "MM_GB_SIBLING", + "DB_SIBLING", + "BM_BRIDE_SIBLING", + "BM_GROOM_SIBLING", + "MM_BRIDE_BRIDE", + "MM_GROOM_GROOM", + "MM_BRIDE_MARRIAGE", + "MM_GROOM_MARRIAGE", + "DM_DECEASED_BRIDE", + "DM_DECEASED_GROOM" + ); + } + private static String getRefutedAlreadyQuery(NeoDbCypherBridge bridge, long id) { String query_string = "MATCH (a)-[r:SIBLING]-(b) WHERE id(r) = $id return r.link_refuted_by"; From 39b566437606764000ffac29b3452abb39721a1e Mon Sep 17 00:00:00 2001 From: Aleksandr Isaev Date: Mon, 23 Sep 2024 14:39:30 +0100 Subject: [PATCH 3/6] changed ordering of GT links counter and fixed link name for death-death gt --- .../groundTruthNeoLinks/CountGTLinks.java | 38 +++++++++---------- .../groundTruthNeoLinks/CreateGTLinks.java | 8 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CountGTLinks.java b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CountGTLinks.java index 6df91721..9cd66b9f 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CountGTLinks.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CountGTLinks.java @@ -75,37 +75,37 @@ public static void main(String[] args) { System.out.println("Analysing sizes of relationships from GT @ " + LocalDateTime.now()); - doQuery(session, "Father-child identity", FATHER_OWN_BIRTH_IDENTITY); - doQuery(session, "Mother-cild identity", MOTHER_OWN_BIRTH_IDENTITY); doQuery(session, "Birth-birth sibling", BIRTH_BIRTH_SIBLING); doQuery(session, "Birth-birth half sibling", BIRTH_BIRTH_HALF_SIBLING); doQuery(session, "Birth-death identity", BIRTH_DEATH_IDENTITY); - doQuery(session, "Birth-death sibling", BIRTH_DEATH_SIBLING); - doQuery(session, "Birth-death half sibling", BIRTH_DEATH_HALF_SIBLING); - doQuery(session, "Birth-groom identity", BIRTH_GROOM_IDENTITY); doQuery(session, "Birth-bride identity", BIRTH_BRIDE_IDENTITY); - doQuery(session, "Father-groom identity", FATHER_GROOM_IDENTITY); - doQuery(session, "Mother-bride identity", MOTHER_BRIDE_IDENTITY); - doQuery(session, "Birth-parents marriage identity", BIRTH_PARENTS_MARRIAGE_IDENTITY); - doQuery(session, "Death-parents marriage identity", DEATH_PARENTS_MARRIAGE_IDENTITY); - doQuery(session, "Birth-groom sibling", BIRTH_GROOM_SIBLING); - doQuery(session, "Birth-bride sibling", BIRTH_BRIDE_SIBLING); + doQuery(session, "Birth-groom identity", BIRTH_GROOM_IDENTITY); doQuery(session, "Death-groom identity", DEATH_GROOM_IDENTITY); doQuery(session, "Death-bride identity", DEATH_BRIDE_IDENTITY); - doQuery(session, "Death-groom sibling", DEATH_GROOM_SIBLING); - doQuery(session, "Death-bride sibling", DEATH_BRIDE_SIBLING); - doQuery(session, "Groom-groom identity", GROOM_GROOM_IDENTITY); - doQuery(session, "Bride-bride identity", BRIDE_BRIDE_IDENTITY); - doQuery(session, "Groom parents marriage", GROOM_PARENTS_MARRIAGE_IDENTITY); - doQuery(session, "Bride parents marriage", BRIDE_PARENTS_MARRIAGE_IDENTITY); + doQuery(session, "Birth-parents marriage identity", BIRTH_PARENTS_MARRIAGE_IDENTITY); + doQuery(session, "Father-child identity", FATHER_OWN_BIRTH_IDENTITY); + doQuery(session, "Mother-child identity", MOTHER_OWN_BIRTH_IDENTITY); doQuery(session, "Groom-groom sibling", GROOM_GROOM_SIBLING); - doQuery(session, "Bride-bride sibling", BRIDE_BRIDE_SIBLING); - doQuery(session, "Bride-groom sibling", BRIDE_GROOM_SIBLING); doQuery(session, "Groom-groom half sibling", GROOM_GROOM_HALF_SIBLING); + doQuery(session, "Bride-bride sibling", BRIDE_BRIDE_SIBLING); doQuery(session, "Bride-bride half sibling", BRIDE_BRIDE_HALF_SIBLING); + doQuery(session, "Bride-groom sibling", BRIDE_GROOM_SIBLING); doQuery(session, "Bride-groom half sibling", BRIDE_GROOM_HALF_SIBLING); doQuery(session, "Death-death sibling", DEATH_DEATH_SIBLING); doQuery(session, "Death-death half sibling", DEATH_DEATH_HALF_SIBLING); + doQuery(session, "Birth-death sibling", BIRTH_DEATH_SIBLING); + doQuery(session, "Birth-death half sibling", BIRTH_DEATH_HALF_SIBLING); + doQuery(session, "Birth-bride sibling", BIRTH_BRIDE_SIBLING); + doQuery(session, "Birth-groom sibling", BIRTH_GROOM_SIBLING); + doQuery(session, "Bride-bride identity", BRIDE_BRIDE_IDENTITY); + doQuery(session, "Groom-groom identity", GROOM_GROOM_IDENTITY); + doQuery(session, "Bride parents marriage", BRIDE_PARENTS_MARRIAGE_IDENTITY); + doQuery(session, "Groom parents marriage", GROOM_PARENTS_MARRIAGE_IDENTITY); + doQuery(session, "Death-bride sibling", DEATH_BRIDE_SIBLING); + doQuery(session, "Death-groom sibling", DEATH_GROOM_SIBLING); + doQuery(session, "Father-groom identity", FATHER_GROOM_IDENTITY); + doQuery(session, "Mother-bride identity", MOTHER_BRIDE_IDENTITY); + doQuery(session, "Death-parents marriage identity", DEATH_PARENTS_MARRIAGE_IDENTITY); System.out.println("Complete @ " + LocalDateTime.now()); } diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java index b0545c6b..993f3916 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java @@ -291,7 +291,7 @@ public class CreateGTLinks { "MERGE (m1)-[:GT_HALF_SIBLING { actors: \"Bride-Groom\" } ]-(m2)"; private static final String DEATH_DEATH_SIBLING = "MATCH (d1:Death),(d2:Death) WHERE " + - "NOT (d1)-[:GT_HALF_SIBLING { actors: \"Bride-Groom\" } ]-(d2) AND " + + "NOT (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2) AND " + "d1.MOTHER_IDENTITY <> \"\" AND " + "d1.FATHER_IDENTITY <> \"\" AND " + "d2.MOTHER_IDENTITY <> \"\" AND " + @@ -299,10 +299,10 @@ public class CreateGTLinks { "d1 <> d2 AND " + "d1.MOTHER_IDENTITY = d2.MOTHER_IDENTITY AND " + "d1.FATHER_IDENTITY = d2.FATHER_IDENTITY " + - "MERGE (d1)-[:GT_HALF_SIBLING { actors: \"Bride-Groom\" } ]-(d2)"; + "MERGE (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2)"; private static final String DEATH_DEATH_HALF_SIBLING = "MATCH (d1:Death),(d2:Death) WHERE " + - "NOT (d1)-[:GT_HALF_SIBLING { actors: \"Bride-Groom\" } ]-(d2) AND " + + "NOT (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2) AND " + "d1.MOTHER_IDENTITY <> \"\" AND " + "d2.MOTHER_IDENTITY <> \"\" AND " + "d1.FATHER_IDENTITY <> \"\" AND " + @@ -310,7 +310,7 @@ public class CreateGTLinks { "d1 <> d2 AND " + "(d1.MOTHER_IDENTITY = d2.MOTHER_IDENTITY OR d1.FATHER_IDENTITY = d2.FATHER_IDENTITY) AND " + "NOT (d1.MOTHER_IDENTITY = d2.MOTHER_IDENTITY AND d1.FATHER_IDENTITY = d2.FATHER_IDENTITY) " + - "MERGE (d1)-[:GT_HALF_SIBLING { actors: \"Bride-Groom\" } ]-(d2)"; + "MERGE (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2)"; private static void doQueries(String... queries) { From a4e3d645e38e0f8a3f1db91f650fcdc68013ac84 Mon Sep 17 00:00:00 2001 From: Aleksandr Isaev Date: Mon, 23 Sep 2024 14:40:23 +0100 Subject: [PATCH 4/6] Update CreateGTLinks.java --- .../groundTruth/groundTruthNeoLinks/CreateGTLinks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java index 993f3916..a3ddea1f 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java @@ -291,7 +291,7 @@ public class CreateGTLinks { "MERGE (m1)-[:GT_HALF_SIBLING { actors: \"Bride-Groom\" } ]-(m2)"; private static final String DEATH_DEATH_SIBLING = "MATCH (d1:Death),(d2:Death) WHERE " + - "NOT (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2) AND " + + "NOT (d1)-[:GT_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2) AND " + "d1.MOTHER_IDENTITY <> \"\" AND " + "d1.FATHER_IDENTITY <> \"\" AND " + "d2.MOTHER_IDENTITY <> \"\" AND " + From 63937cce57d7c5e13b24d4af6fa116307ee4b186 Mon Sep 17 00:00:00 2001 From: Aleksandr Isaev Date: Tue, 24 Sep 2024 15:10:39 +0100 Subject: [PATCH 5/6] added license headers and minor fixes to linkage builders --- .../population_linkage/aleks/LinksCounter.java | 16 ++++++++++++++++ .../builders/DeathBrideOwnMarriageBuilder.java | 3 ++- .../helpers/CreateIndices.java | 12 +++++++++++- .../helpers/ImportUmeaRecordsToStore.java | 12 +++++++++++- .../BirthBrideSiblingLinkageRecipe.java | 7 ++++--- src/main/scripts/install/setup_umea_in_storr.sh | 12 +++++++++++- src/main/scripts/neo4j/COPY_DB.sh | 14 +++++++++++++- src/main/scripts/neo4j/RESET_DB.sh | 14 +++++++++++++- src/main/scripts/neo4j/RESTORE_DB.sh | 14 +++++++++++++- src/main/scripts/neo4j/START_DB.sh | 14 +++++++++++++- src/main/scripts/neo4j/STOP_DB.sh | 14 +++++++++++++- 11 files changed, 120 insertions(+), 12 deletions(-) diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java b/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java index fad54e59..7a4e3b09 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/aleks/LinksCounter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2022 Systems Research Group, University of St Andrews: + * + * + * This file is part of the module population-linkage. + * + * population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with population-linkage. If not, see + * . + */ package uk.ac.standrews.cs.population_linkage.aleks; import org.neo4j.driver.Result; import uk.ac.standrews.cs.neoStorr.impl.Store; diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/DeathBrideOwnMarriageBuilder.java b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/DeathBrideOwnMarriageBuilder.java index d7580ae2..a40d01df 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/DeathBrideOwnMarriageBuilder.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/endToEnd/builders/DeathBrideOwnMarriageBuilder.java @@ -27,6 +27,7 @@ import uk.ac.standrews.cs.population_linkage.supportClasses.LinkageQuality; import uk.ac.standrews.cs.population_linkage.supportClasses.LinkageResult; import uk.ac.standrews.cs.population_records.record_types.Birth; +import uk.ac.standrews.cs.population_records.record_types.Death; import uk.ac.standrews.cs.population_records.record_types.Marriage; /** @@ -61,7 +62,7 @@ public static void main(String[] args) throws Exception { @Override public void makePersistent(LinkageRecipe recipe, Link link) { try { - final String std_id1 = link.getRecord1().getReferend(Birth.class).getString(Birth.STANDARDISED_ID); + final String std_id1 = link.getRecord1().getReferend(Death.class).getString(Death.STANDARDISED_ID); final String std_id2 = link.getRecord2().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID); if( ! Query.DMDeathBrideOwnMarriageReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) { diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/CreateIndices.java b/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/CreateIndices.java index e27f51c9..220f7828 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/CreateIndices.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/CreateIndices.java @@ -2,7 +2,17 @@ * Copyright 2022 Systems Research Group, University of St Andrews: * * - * This file is part of the module data-umea. + * This file is part of the module population-linkage. + * + * population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with population-linkage. If not, see + * . */ package uk.ac.standrews.cs.population_linkage.helpers; diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/ImportUmeaRecordsToStore.java b/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/ImportUmeaRecordsToStore.java index 29ed8c59..d82e0996 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/ImportUmeaRecordsToStore.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/helpers/ImportUmeaRecordsToStore.java @@ -2,7 +2,17 @@ * Copyright 2022 Systems Research Group, University of St Andrews: * * - * This file is part of the module data-umea. + * This file is part of the module population-linkage. + * + * population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with population-linkage. If not, see + * . */ package uk.ac.standrews.cs.population_linkage.helpers; diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/linkageRecipes/BirthBrideSiblingLinkageRecipe.java b/src/main/java/uk/ac/standrews/cs/population_linkage/linkageRecipes/BirthBrideSiblingLinkageRecipe.java index 366f963f..1c513dce 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/linkageRecipes/BirthBrideSiblingLinkageRecipe.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/linkageRecipes/BirthBrideSiblingLinkageRecipe.java @@ -24,6 +24,7 @@ import uk.ac.standrews.cs.population_linkage.helpers.RecordFiltering; import uk.ac.standrews.cs.population_linkage.supportClasses.Link; import uk.ac.standrews.cs.population_records.record_types.Birth; +import uk.ac.standrews.cs.population_records.record_types.Death; import uk.ac.standrews.cs.population_records.record_types.Marriage; import java.util.List; @@ -34,14 +35,14 @@ */ public class BirthBrideSiblingLinkageRecipe extends LinkageRecipe { - private static final double DISTANCE_THRESHOLD = 0.5; // TODO THIS THRESHOLD WAS NOT MEASURED - 0.15 in table + private static final double DISTANCE_THRESHOLD = 0.15; // TODO THIS THRESHOLD WAS NOT MEASURED - 0.15 in table public static final String LINKAGE_TYPE = "birth-bride-sibling"; public static final int ID_FIELD_INDEX1 = Birth.STANDARDISED_ID; public static final int ID_FIELD_INDEX2 = Marriage.STANDARDISED_ID; - private List cached_records; + private List cached_records = null; private final int number_of_births; public static final int ALL_LINKAGE_FIELDS = 4; @@ -80,7 +81,7 @@ public BirthBrideSiblingLinkageRecipe(String source_repository_name, String numb public Iterable getBirthRecords() { if (cached_records == null) { - cached_records = RecordFiltering.filter(no_linkage_fields_required, number_of_births, super.getBirthRecords(), getLinkageFields()); + cached_records = RecordFiltering.filter(getNumberOfLinkageFieldsRequired(), number_of_births, super.getBirthRecords(), getLinkageFields()); } return cached_records; } diff --git a/src/main/scripts/install/setup_umea_in_storr.sh b/src/main/scripts/install/setup_umea_in_storr.sh index 914deed1..7559ae66 100755 --- a/src/main/scripts/install/setup_umea_in_storr.sh +++ b/src/main/scripts/install/setup_umea_in_storr.sh @@ -3,7 +3,17 @@ # Copyright 2022 Systems Research Group, University of St Andrews: # # -# This file is part of the module data-umea. +# This file is part of the module population-linkage. +# +# population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with population-linkage. If not, see +# . # export MAVEN_OPTS="-Xmx16G" diff --git a/src/main/scripts/neo4j/COPY_DB.sh b/src/main/scripts/neo4j/COPY_DB.sh index efd8fe44..3e3b0849 100755 --- a/src/main/scripts/neo4j/COPY_DB.sh +++ b/src/main/scripts/neo4j/COPY_DB.sh @@ -1,7 +1,19 @@ # -# Copyright 2020 Systems Research Group, University of St Andrews: +# Copyright 2022 Systems Research Group, University of St Andrews: # # +# This file is part of the module population-linkage. +# +# population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with population-linkage. If not, see +# . +# neo4j stop neo4j-admin dump --verbose --to=$1 diff --git a/src/main/scripts/neo4j/RESET_DB.sh b/src/main/scripts/neo4j/RESET_DB.sh index 6efad41c..79630a4e 100755 --- a/src/main/scripts/neo4j/RESET_DB.sh +++ b/src/main/scripts/neo4j/RESET_DB.sh @@ -1,7 +1,19 @@ # -# Copyright 2020 Systems Research Group, University of St Andrews: +# Copyright 2022 Systems Research Group, University of St Andrews: # # +# This file is part of the module population-linkage. +# +# population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with population-linkage. If not, see +# . +# neo4j stop rm -rf /opt/homebrew/Cellar/neo4j@4.4.10/4.4.10/libexec/data/ diff --git a/src/main/scripts/neo4j/RESTORE_DB.sh b/src/main/scripts/neo4j/RESTORE_DB.sh index e59081b6..9e3d7449 100755 --- a/src/main/scripts/neo4j/RESTORE_DB.sh +++ b/src/main/scripts/neo4j/RESTORE_DB.sh @@ -1,7 +1,19 @@ # -# Copyright 2020 Systems Research Group, University of St Andrews: +# Copyright 2022 Systems Research Group, University of St Andrews: # # +# This file is part of the module population-linkage. +# +# population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with population-linkage. If not, see +# . +# neo4j stop neo4j-admin load --verbose --from=$1 --force diff --git a/src/main/scripts/neo4j/START_DB.sh b/src/main/scripts/neo4j/START_DB.sh index fc574f25..4e068036 100755 --- a/src/main/scripts/neo4j/START_DB.sh +++ b/src/main/scripts/neo4j/START_DB.sh @@ -1,7 +1,19 @@ # -# Copyright 2020 Systems Research Group, University of St Andrews: +# Copyright 2022 Systems Research Group, University of St Andrews: # # +# This file is part of the module population-linkage. +# +# population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with population-linkage. If not, see +# . +# neo4j start sleep 5 diff --git a/src/main/scripts/neo4j/STOP_DB.sh b/src/main/scripts/neo4j/STOP_DB.sh index 541b5f2b..c5080894 100755 --- a/src/main/scripts/neo4j/STOP_DB.sh +++ b/src/main/scripts/neo4j/STOP_DB.sh @@ -1,7 +1,19 @@ # -# Copyright 2020 Systems Research Group, University of St Andrews: +# Copyright 2022 Systems Research Group, University of St Andrews: # # +# This file is part of the module population-linkage. +# +# population-linkage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# population-linkage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with population-linkage. If not, see +# . +# neo4j stop sleep 5 From 4dd8c65e1056c0eea670a0d613eb07051fe254d6 Mon Sep 17 00:00:00 2001 From: Aleksandr Isaev Date: Wed, 25 Sep 2024 10:05:19 +0100 Subject: [PATCH 6/6] Update CreateGTLinks.java --- .../groundTruth/groundTruthNeoLinks/CreateGTLinks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java index a3ddea1f..af7b4382 100644 --- a/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java +++ b/src/main/java/uk/ac/standrews/cs/population_linkage/groundTruth/groundTruthNeoLinks/CreateGTLinks.java @@ -299,7 +299,7 @@ public class CreateGTLinks { "d1 <> d2 AND " + "d1.MOTHER_IDENTITY = d2.MOTHER_IDENTITY AND " + "d1.FATHER_IDENTITY = d2.FATHER_IDENTITY " + - "MERGE (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2)"; + "MERGE (d1)-[:GT_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2)"; private static final String DEATH_DEATH_HALF_SIBLING = "MATCH (d1:Death),(d2:Death) WHERE " + "NOT (d1)-[:GT_HALF_SIBLING { actors: \"Deceased-Deceased\" } ]-(d2) AND " +