ClimateCompatibleGrowth / research_index_backend

Provisioning the graph database which forms the backend of the research index
MIT License
0 stars 0 forks source link

Improve country linking #3

Open willu47 opened 7 months ago

willu47 commented 7 months ago

A naive implementation of linking outputs to countries has been implemented based on the CONTAINS operand.

MATCH (c:Country)
CALL {
  WITH c
  MATCH (o:Output)
  WHERE o.abstract CONTAINS c.name
  AND NOT exists((o:Output)-[:REFERS_TO]->(c:Country))
  CREATE (o)-[r:REFERS_TO]->(c)
  RETURN r
}
RETURN r

This results in country names (such as Niger) being linked when the abstract contains a country name (e.g. Nigeria CONTAINS Niger; South Sudan CONTAINS Sudan etc.).

The linking should be improved so that full country names are linked.