In Neo4j Cypher using neo4j-shell I can relationships to a single node based on a property like this:
match (p:Taxon{taxId:'9605'}),(t:Taxon{parentTaxId:p.taxId})
create unique (p)-[:PARENT_OF]->(t);
With the taxId set in p it runs as expected and relationships are created as required. However when I try to apply it to all nodes by changing the query to:
match (p:Taxon),(t:Taxon{parentTaxId:p.taxId})
create unique (p)-[:PARENT_OF]->(t);
I get an error:
NotFoundException: Unknown identifier
t
.
I do not understand why t is now invalid. Am I missing something obvious?