Really can't thank you enough, I have been banging my head against a wall!
There is only 1 node label: PublicCompany
There are 3 relationships between PublicCompany nodes: supplier, buyer, competitor
I have ~20 properties for the PublicCompany node: Symbol, Company _Name, Company_Type, Industry, Market_Cap, Revenue, Goods_Services, Input_Materials, Suppliers_Description, Buyers_Description, Competitors_Description, Contractors, Contractors_locations, Employees, Employees_details, Employee_locations, Cash_holdings, Debt_Amount, Debt_To_Equity, Debt_State, Property_Plant_Equipment, Production_Process, Technology_Infrastructure, Intellectual_Property, Licenses, Capital_Expenditures, Research_And_Development, Risks, Distribution, Sales_And_Marketing, Sells_Direct_To_Consumers
1. Correct. I will specify a Symbol of a company, and would like to search that node, as well as all nodes directly connected to that node. So if the Symbol is "AAPL", I want to check the "AAPL" node, as well as all nodes connected to the "AAPL" node.
2. This will vary, but an example is from above, 2 properties that have a condition to pass (it can be 2 or more properties being searched from the properties list above)
where m.Market_Cap < 1000000000000
OR m.Symbol CONTAINS "A"
3. Correct. Out of that list of nodes (the nodes connected to "AAPL" and "AAPL itself), I would like when returned the node to know what the relationship was to the "AAPL" node.
So non -"AAPL" nodes can have relationship: supplier, buyer, competitor
But "AAPL" doesn't have that kind of relationship with itself
4. I would like to return the node, AND the properties that met the criteria.
So if "Market_Cap < 100000000000" was met I would like to return property "Market_Cap"
if "Symbol CONTAINS "A"" was met, I would like to return the property "Symbol"
This way I know what properties were met to meet the condition.
5. Either or, I will need to parse to make JSON anyway.
The closest I have gotten is this:
MATCH (n:PublicCompany)-[r]-(a:PublicCompany {Symbol: "AAPL"})
WHERE n.`Market Cap` > 1000000000000
OR n.Symbol CONTAINS "A"
RETURN n, [key IN keys(n) WHERE ((n[key] > 1000000000000 AND key = "Market Cap") OR (n[key] CONTAINS "A" AND key = "Symbol"))], r
It returns the node, the relationship, and the properties that met the condition
What ^ is missing, is it DOESN'T CHECK the "AAPL" node for those conditions as well. It only checks the nodes connected to "AAPL".