Probably a typical newby question :-)...
I have created the following table:
MATCH (s:Source)
WHERE s.title = $neodash_source_title // value comes from a parameter select function
WITH s LIMIT 1
MATCH (s:Source)-[r:PRODUCED_BY ]->(p:Producer)-[v:HAS_NAME_VARIANT {qualification: "preferred"}]->(n:Name)
WITH [ "Subtitle: " + s.subtitle,
"Year: " + s.year,
"Author: " + n.text,
"ISBN: " + s.ISBN
] as data
UNWIND data as Information
RETURN Information
If e.g. the property "ISBN" is empty, how can I suppress the whole line "ISBN: " + s.ISBN ?
isEmpty will leave the value empty, but "ISBN: " will still appear.
Hello @bennu_neo ,
That seems to do the trick.
The empty strings are created by data-importer.neo4j.io Is there a way to prevent it from creating these NULLs? Thank you.
Try this. It filters out the elements in your data list that have a size equal to zero. These should be the elements that have properties that are null (don't exists), as "a constant string" + null = null.
MATCH (s:Source)
WHERE s.title = $neodash_source_title // value comes from a parameter select function
WITH s LIMIT 1
MATCH (s:Source)-[r:PRODUCED_BY ]->(p:Producer)-[v:HAS_NAME_VARIANT {qualification: "preferred"}]->(n:Name)
WITH [ "Subtitle: " + s.subtitle,
"Year: " + s.year,
"Author: " + n.text,
"ISBN: " + s.ISBN
] as allData
WITH [i in allData where size(i)>0] as data
UNWIND data as Information
RETURN Information
Thanks for using NeoDash! About your query, looks like you have some empty strings as properties. Can you confirm this theory? In that case, removing empty string properties will improve your model while also reducing a bit your disk usage.