Skip to content

Commit

Permalink
Merge pull request #5 from aleksandr-isaev/master
Browse files Browse the repository at this point in the history
Brackets fix and additional scripts to setup umea data in neo4j
  • Loading branch information
aldearle authored Sep 19, 2024
2 parents 8541ae6 + f58ceaa commit 5c02cd9
Show file tree
Hide file tree
Showing 20 changed files with 234 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ application.properties
*.meta
src/main/scripts/R/.Rhistory
!/properties/application.properties
!/src/main/scripts/R/.RData
!/src/main/scripts/R/.RData
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="BirthSiblingBundleBuilder" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="uk.ac.standrews.cs.population_linkage.endToEnd.builders.BirthSiblingBundleBuilder" />
<module name="population-linkage" />
<option name="PROGRAM_PARAMETERS" value="umea 10" />
<option name="PROGRAM_PARAMETERS" value="umea EVERYTHING" />
<option name="VM_PARAMETERS" value="-Xmx16G" />
<method v="2">
<option name="Make" enabled="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="SiblingBirthOpenTriangleResolver" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="uk.ac.standrews.cs.population_linkage.resolver.triangles.SiblingBirthOpenTriangleResolver" />
<module name="population-linkage" />
<option name="PROGRAM_PARAMETERS" value="umea" />
<option name="PROGRAM_PARAMETERS" value="umea EVERYTHING" />
<method v="2">
<option name="Make" enabled="true" />
</method>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;

/**
* This class attempts to perform birth-marriage sibling linkage.
Expand Down Expand Up @@ -59,8 +60,8 @@ public static void main(String[] args) throws Exception {
public void makePersistent(LinkageRecipe recipe, Link link) {
try {

String std_id1 = link.getRecord1().getReferend(Death.class).getString(Death.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Birth.class).getString(Birth.STANDARDISED_ID );
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 (!Query.BMBrideSiblingReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) {
Query.createBMBrideSiblingReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;

/**
* This class attempts to perform birth-marriage sibling linkage.
Expand All @@ -39,8 +40,7 @@ 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(
BirthGroomSiblingLinkageRecipe linkageRecipe = new BirthGroomSiblingLinkageRecipe(sourceRepo, number_of_records, BirthGroomSiblingBundleBuilder.class.getName() ) ) {
try(BirthGroomSiblingLinkageRecipe linkageRecipe = new BirthGroomSiblingLinkageRecipe(sourceRepo, number_of_records, BirthGroomSiblingBundleBuilder.class.getName() ) ) {

BitBlasterLinkageRunner runner = new BitBlasterLinkageRunner();

Expand All @@ -60,8 +60,8 @@ public static void main(String[] args) throws Exception {
public void makePersistent(LinkageRecipe recipe, Link link) {
try {

String std_id1 = link.getRecord1().getReferend(Death.class).getString(Death.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Birth.class).getString(Birth.STANDARDISED_ID );
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 (!Query.BMGroomSiblingReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) {
Query.createBMGroomSiblingReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.Death;
import uk.ac.standrews.cs.population_records.record_types.Marriage;

/**
* This class attempts to find marriage-marriage links: links a groom's parents on a marriage record to the parents marriage.
Expand Down Expand Up @@ -60,8 +61,8 @@ public static void main(String[] args) throws Exception {
@Override
public void makePersistent(LinkageRecipe recipe, Link link) {
try {
String std_id1 = link.getRecord1().getReferend(Death.class).getString(Death.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Death.class).getString( Death.STANDARDISED_ID );
String std_id1 = link.getRecord1().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID);

if (!std_id1.equals(std_id2)) {
if( ! Query.MMBrideMarriageParentsMarriageReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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.DMDeathGroomOwnMarriageReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;

/**
* This class attempts to perform birth-marriage sibling linkage.
Expand Down Expand Up @@ -62,7 +63,7 @@ public void makePersistent(LinkageRecipe recipe, Link link) {
try {

String std_id1 = link.getRecord1().getReferend(Death.class).getString(Death.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Birth.class).getString(Birth.STANDARDISED_ID );
String std_id2 = link.getRecord2().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID );

if (!Query.DMGroomSiblingReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) {
Query.createDMGroomSiblingReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.Death;
import uk.ac.standrews.cs.population_records.record_types.Marriage;

/**
* This class attempts to find marriage-marriage links: links a groom's parents on a marriage record to the parents marriage.
Expand Down Expand Up @@ -60,8 +61,8 @@ public static void main(String[] args) throws Exception {
@Override
public void makePersistent(LinkageRecipe recipe, Link link) {
try {
String std_id1 = link.getRecord1().getReferend(Death.class).getString(Death.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Death.class).getString( Death.STANDARDISED_ID );
String std_id1 = link.getRecord1().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID);
String std_id2 = link.getRecord2().getReferend(Marriage.class).getString(Marriage.STANDARDISED_ID);

if (!std_id1.equals(std_id2)) {
if( ! Query.MMGroomMarriageParentsMarriageReferenceExists(recipe.getBridge(), std_id1, std_id2, recipe.getLinksPersistentName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public class Query {

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 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_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 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)";
Expand All @@ -74,11 +74,11 @@ public class Query {
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 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_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 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_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)";

// queries for use in predicates - return a relationship if it exists

Expand All @@ -94,8 +94,8 @@ public class Query {

private static final String BD_DEATH_EXISTS_QUERY = "MATCH (a:Birth)-[r:ID { actors: \"Child-Deceased\" }]-(b:Death) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to RETURN r";

private static final String DM_DEATH_GROOM_EXISTS_QUERY = "MATCH (a:Death)-[r:ID actors: \"Deceased-Groom\" }]-(b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to AND r.provenance = $prov RETURN r";
private static final String DM_DEATH_BRIDE_EXISTS_QUERY = "MATCH (a:Death)-[r:ID actors: \"Deceased-Bride\" }]-(b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to AND r.provenance = $prov RETURN r";
private static final String DM_DEATH_GROOM_EXISTS_QUERY = "MATCH (a:Death)-[r:ID { actors: \"Deceased-Groom\" }]-(b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to AND r.provenance = $prov RETURN r";
private static final String DM_DEATH_BRIDE_EXISTS_QUERY = "MATCH (a:Death)-[r:ID { actors: \"Deceased-Bride\" }]-(b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to AND r.provenance = $prov RETURN r";

private static final String MM_BB_SIBLING_EXISTS_QUERY = "MATCH (a:Marriage)-[r:SIBLING { actors: \"Bride-Bride\" }]-(b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to AND r.provenance = $prov RETURN r";
private static final String MM_GG_SIBLING_EXISTS_QUERY = "MATCH (a:Marriage)-[r:SIBLING { actors: \"Groom-Groom\" }]-(b:Marriage) WHERE a.STANDARDISED_ID = $standard_id_from AND b.STANDARDISED_ID = $standard_id_to AND r.provenance = $prov RETURN r";
Expand Down
Loading

0 comments on commit 5c02cd9

Please sign in to comment.