Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-31-2020 03:46 AM
Hello,
relative newbie user of neo4j here. I had code that ran 2 years on version 3.4 but doesn't anymore on version 4.2. So I managed to rewrite some of it but I'm stuck now on the rest.
I am trying to match data from an animal disease ontology xml file to update some nodes.
here is some working code. It finds all nodes with a given property then matches all mappings.
it returns a mapping with 2 properties. this is expected behavior.
MATCH (n :Disease) where n.ADO_ID starts with 'MH'
CALL apoc.load.xml("ADO_edit2.xml",'', {}, true)
YIELD value
UNWIND value._RDF as rdf
UNWIND rdf as path
match (path) where path.`rdf:about` = n.ADO_ID
unwind path._Class as p2
WITH p2 as path2,
n as dis
CALL {
with path2
match (path2) where path2._type = 'subClassOf'
unwind path2._subClassOf as de2
match (de2) where de2._Restriction[0].`rdf:resource` = "hasCause"
return de2 as de3
}
return de3, keys(de3), de3._type, dis LIMIT 10
As i said, this bit works fine. It returns the following data (shown here as table):
de3 | keys(de3) | de3._type | dis |
---|---|---|---|
{"_type":Restriction,"_Restriction":[{"_type":onProperty,"rdf:resource":hasCause},{"_type":someValuesFrom,"rdf:resource":AG401}]} | [_type,_Restriction] | Restriction | {"ADO_ID":MH1,"name":Acanthocephalosis (Fish)} |
{"_type":Restriction,"_Restriction":[{"_type":onProperty,"rdf:resource":hasCause},{"_type":someValuesFrom,"rdf:resource":AG399}]} | [_type,_Restriction] | Restriction | {"ADO_ID":MH1,"name":Acanthocephalosis (Fish)} |
{"_type":Restriction,"_Restriction":[{"_type":onProperty,"rdf:resource":hasCause},{"_type":someValuesFrom,"rdf:resource":AG400}]} | [_type,_Restriction] | Restriction | {"ADO_ID":MH1,"name":Acanthocephalosis (Fish)} |
however, if I try to return "de3._Restriction" ( or de3._Restriction
), which is a list, or any value nested in it, I get an error:
I cannot access this mapping
I've had this problem with the same error for nearly all my import scripts that used to work previously. Some i could rewrite but this one is confusing me. How can i access this mapping?
Any help would be greatly appreciated!! Thanks and happy new year
01-13-2021 03:06 PM
Can you share the XML source data to reproduce, looks like a Cypher bug, so best would be to raise a GH issue here with a minimal statement and XML file to reproduce.
01-14-2021 02:21 AM
Hi and thanks for the reply.
The xml file is here: ADO_edit.xml - Google Drive
Hope this helps narrow it down
01-23-2021 06:13 AM
Did you create the GH issue?
One thing you can try is to use cypher runtime=slotted
as prefix to your query and see if that helps (if yes please mention it in the GH issue)
01-27-2021 05:58 AM
Hi, yes it's reported in github now.
Hope they figure it out, I have a lot riding on being able to rebuild the graph I had previously.
All the sessions of the conference are now available online