Hello everyone, I just ran into an error that I cannot understand. It's easier to replicate than to explain.
(Version: 5.3.0 Enterprise edition)
Create the nodes and relationships:
CREATE (patient:Patient)
SET patient.id = 'Patient/1'
SET patient.birthDate = '1992-10-09'
CREATE (patient_name:HumanName)
SET patient_name.id = 'Patient/1_name'
SET patient_name.given = 'Biagio'
CREATE (patient)-[patient_name_p:PROPERTY {name: 'name'}]->(patient_name)
CREATE (practitioner:Practitioner)
SET practitioner.id = 'Practitioner/1'
CREATE (practitioner_name:HumanName)
SET practitioner_name.id = 'Practitioner/1_name'
SET practitioner_name.given = 'Sarah'
CREATE (practitioner)-[practitioner_name_p:PROPERTY {name: 'name'}]->(practitioner_name)
CREATE (patient)-[generalPractitioner:RELATIONSHIP {name: 'generalPractitioner'}]->(practitioner)
This query raises an error:
MATCH (patient)-[patient_name_p:PROPERTY]->(patient_name)
WHERE
((patient:Patient) AND
(patient_name_p.name='name'))
AND
((patient_name.prefix='Biagio' OR patient_name.use='Biagio' OR patient_name.given='Biagio' OR patient_name.text='Biagio' OR patient_name.family='Biagio' OR patient_name.suffix='Biagio'))
RETURN patient.id
This is the output:
error Neo.DatabaseError.Statement.ExecutionFailed
Cannot invoke "org.neo4j.internal.kernel.api.RelationshipDataAccessor.properties(org.neo4j.internal.kernel.api.PropertyCursor, org.neo4j.storageengine.api.PropertySelection)" because "this.v3_relationships" is null
However, this query works just fine:
MATCH (patient)-[patient_name_p:PROPERTY]->(patient_name)
WHERE
patient:Patient
AND
((patient_name.prefix='Biagio' OR patient_name.use='Biagio' OR patient_name.given='Biagio' OR patient_name.text='Biagio' OR patient_name.family='Biagio' OR patient_name.suffix='Biagio'))
RETURN patient.id
And this as well:
MATCH (patient)-[patient_name_p:PROPERTY]->(patient_name)
WHERE
((patient:Patient) AND
(patient_name_p.name='name'))
AND
(patient_name.given='Biagio')
RETURN patient.id
It seems like the thing that raises the error is combining the clause on the relationship PROPERTY's attribute "name" with the one on non-existing attributes on the patient_name.
But if I run one or the other, it works.
Does anyone have any idea how to fix this? I must query both.
Thanks in advance