From 7f03a0e31ab3723362f6c94ef7b3f06b7a144230 Mon Sep 17 00:00:00 2001 From: henrietteharmse Date: Thu, 4 Aug 2022 15:09:15 +0100 Subject: [PATCH] Fix for PCL and OM individual issues --- .../spot/ols/loader/BatchNeo4JIndexer.java | 54 ++++++------------- .../ebi/spot/ols/loader/IndexClassesTest.java | 49 +---------------- 2 files changed, 17 insertions(+), 86 deletions(-) diff --git a/ols-neo4j/src/main/java/uk/ac/ebi/spot/ols/loader/BatchNeo4JIndexer.java b/ols-neo4j/src/main/java/uk/ac/ebi/spot/ols/loader/BatchNeo4JIndexer.java index cef5bde4..873dbcce 100644 --- a/ols-neo4j/src/main/java/uk/ac/ebi/spot/ols/loader/BatchNeo4JIndexer.java +++ b/ols-neo4j/src/main/java/uk/ac/ebi/spot/ols/loader/BatchNeo4JIndexer.java @@ -204,15 +204,16 @@ private void indexProperties(BatchInserter inserter, OntologyLoader loader, Map< } private void indexIndividuals(BatchInserter inserter, OntologyLoader loader, - Map nodeMap, Map mergedNodeMap, Map classNodeMap) { + Map nodeMap, Map mergedNodeMap, Map classNodeMap, + Map relatedIndividualNodeMap) { getLogger().debug("Creating Neo4j index for " + loader.getAllIndividualIRIs().size() + " individuals"); for (IRI individualIri : loader.getAllIndividualIRIs()) { // avoid duplicating individuals already related to a class - if (classNodeMap.containsKey(individualIri.toString())) { - nodeMap.put(individualIri.toString(), classNodeMap.get(individualIri.toString())); + if (relatedIndividualNodeMap.containsKey(individualIri.toString())) { + nodeMap.put(individualIri.toString(), relatedIndividualNodeMap.get(individualIri.toString())); } Long node = NodeCreator.getOrCreateNode(inserter, nodeMap, loader, individualIri, @@ -293,7 +294,7 @@ private void indexRelations(Long node, Map> relatedIndividu */ private void indexRelatedIndividuals(Long node, Map> relatedIndividuals, BatchInserter inserter, OntologyLoader loader, Map nodeMap, - Collection