I would highly appreciate if you can advise me on whether/how the following problem can be solved using Neo4j and Cypher:
We have ownership rights to some products in different territories and different segments. We have already licensed some of these products in some territories and some segments. Now we want to find which products in which territories and segments are still open to licensing (not licensed yet).
Both territory and segments are hierarchical fields and our ownership and licensing records may not be on the same level (e.g for product ABC we have the ownership right for WorldWide (WW) but have licensed it in the US, which is part of North America (NA) which is part of WW).
ownership_id, product_id, territory, segment
1, 1, WW, A
license_id, product_id, territory, segment
5, 1, US, A1
Expected results of final Cypher query that shows product availability in territory and segments:
product_id, territory, segment
1, EU, A
1, CA, A
1, US, A2
2, US, A3