Issue 1:
Neo4j version: 2.3.3

Operating system: Windows 10

API/Driver: Cypher from web interface

I have a following query (first one simplified to show the issue)

OPTIONAL MATCH (recEmployee:RecordEmployee)-[:Reference{Id:'F08'}]-(recComputer_F08:RecordComputer)-[:Reference{Id:'F09'}]-(recIncidents_F08_F09:RecordIncidents),
(recEmployee:RecordEmployee),
(recEmployee:RecordEmployee)-[:Reference{Id:'F08'}]-(recComputer_F08:RecordComputer)
WHERE ( recIncidents_F08_F09.F01="Trojan" )
RETURN recEmployee

it doesn't return anything.

if I remove third optional match, then it works fine. Is it a bug? I was thinking means just that optional.

OPTIONAL MATCH (recEmployee:RecordEmployee)-[:Reference{Id:'F08'}]-(recComputer_F08:RecordComputer)-[:Reference{Id:'F09'}]-(recIncidents_F08_F09:RecordIncidents),
(recEmployee:RecordEmployee)
WHERE ( recIncidents_F08_F09.F01="Trojan" )
RETURN recEmployee

This is the GraphML datablase content. I don't see the way to attach so it's a small xml you can import.

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="directed">
<node id="n0" labels=":Application"><data key="labels">:Application</data><data key="Id">A01</data><data key="Name">Employee</data><data key="Disabled">false</data></node>
<node id="n1" labels=":Field"><data key="labels">:Field</data><data key="Id">F04</data><data key="Name">Position</data></node>
<node id="n2" labels=":Value"><data key="labels">:Value</data><data key="Id">V01</data><data key="Name">Boss</data></node>
<node id="n3" labels=":Field"><data key="labels">:Field</data><data key="Id">F05</data><data key="Name">Hobbies</data></node>
<node id="n4" labels=":Value"><data key="labels">:Value</data><data key="Id">V02</data><data key="Name">Secretary</data></node>
<node id="n5" labels=":Value"><data key="labels">:Value</data><data key="Id">V01</data><data key="Name">Scuba</data></node>
<node id="n6" labels=":Value"><data key="labels">:Value</data><data key="Id">V02</data><data key="Name">Rock Climbing</data></node>
<node id="n7" labels=":Value"><data key="labels">:Value</data><data key="Id">V03</data><data key="Name">Yoga</data></node>
<node id="n8" labels=":Application"><data key="labels">:Application</data><data key="Id">A02</data><data key="Name">Computer</data><data key="Disabled">false</data></node>
<node id="n9" labels=":Field"><data key="labels">:Field</data><data key="Id">F04</data><data key="Name">Make</data></node>
<node id="n10" labels=":Value"><data key="labels">:Value</data><data key="Id">V01</data><data key="Name">Dell</data></node>
<node id="n11" labels=":Field"><data key="labels">:Field</data><data key="Id">F05</data><data key="Name">Applications</data></node>
<node id="n12" labels=":Value"><data key="labels">:Value</data><data key="Id">V02</data><data key="Name">HP</data></node>
<node id="n13" labels=":Value"><data key="labels">:Value</data><data key="Id">V01</data><data key="Name">Swimlane</data></node>
<node id="n14" labels=":Value"><data key="labels">:Value</data><data key="Id">V02</data><data key="Name">MS Office</data></node>
<node id="n15" labels=":Value"><data key="labels">:Value</data><data key="Id">V03</data><data key="Name">MongoDb</data></node>
<node id="n16" labels=":Application"><data key="labels">:Application</data><data key="Id">A03</data><data key="Name">Incidents</data><data key="Disabled">false</data></node>
<node id="n17" labels=":Field"><data key="labels">:Field</data><data key="Id">F04</data><data key="Name">Type</data></node>
<node id="n18" labels=":Value"><data key="labels">:Value</data><data key="Id">V01</data><data key="Name">Worm</data></node>
<node id="n19" labels=":Field"><data key="labels">:Field</data><data key="Id">F05</data><data key="Name">Variations</data></node>
<node id="n20" labels=":Value"><data key="labels">:Value</data><data key="Id">V02</data><data key="Name">Virus</data></node>
<node id="n21" labels=":Value"><data key="labels">:Value</data><data key="Id">V01</data><data key="Name">HackTool</data></node>
<node id="n22" labels=":Value"><data key="labels">:Value</data><data key="Id">V02</data><data key="Name">Trojan</data></node>
<node id="n23" labels=":Value"><data key="labels">:Value</data><data key="Id">V03</data><data key="Name">Rootkit</data></node>
<node id="n24" labels=":User"><data key="labels">:User</data><data key="Id">U01</data><data key="Name">pfry</data><data key="Disabled">false</data></node>
<node id="n25" labels=":User"><data key="labels">:User</data><data key="Id">U02</data><data key="Name">bender</data><data key="Disabled">false</data></node>
<node id="n26" labels=":User"><data key="labels">:User</data><data key="Id">U03</data><data key="Name">lturanga</data><data key="Disabled">false</data></node>
<node id="n27" labels=":RecordIncidents"><data key="labels">:RecordIncidents</data><data key="F02">ThreatConnect</data><data key="ModifiedDate">0001-01-01T00:00:00</data><data key="F03">2016-03-28T11:43:47.174243-04:00</data><data key="CreatedDate">0001-01-01T00:00:00</data><data key="F01">DDOS</data><data key="Source">Manual</data><data key="Allowed">[]</data><data key="LinkedData">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="SessionTimeSpent">0</data><data key="TotalTimeSpent">0</data><data key="TimeTrackingEnabled">true</data><data key="Visualizations">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.VisualizationData, Core]], mscorlib]], mscorlib"}</data><data key="ApplicationRevision">0</data><data key="Comments">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.Comments, Core]], mscorlib]], mscorlib"}</data><data key="TrackingId">1</data><data key="ApplicationId">A03</data><data key="ActionsExecuted">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="Id">RI01</data><data key="Name">INC001</data><data key="Disabled">false</data></node>
<node id="n28" labels=":RecordIncidents"><data key="labels">:RecordIncidents</data><data key="ModifiedDate">0001-01-01T00:00:00</data><data key="F03">2016-03-28T11:43:47.9056099-04:00</data><data key="F01">Trojan</data><data key="F02">ThreatConnect</data><data key="CreatedDate">0001-01-01T00:00:00</data><data key="Source">Manual</data><data key="Allowed">[]</data><data key="LinkedData">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="SessionTimeSpent">0</data><data key="TotalTimeSpent">0</data><data key="TimeTrackingEnabled">true</data><data key="Visualizations">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.VisualizationData, Core]], mscorlib]], mscorlib"}</data><data key="ApplicationRevision">0</data><data key="Comments">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.Comments, Core]], mscorlib]], mscorlib"}</data><data key="TrackingId">2</data><data key="ApplicationId">A03</data><data key="ActionsExecuted">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="Id">RI02</data><data key="Name">INC002</data><data key="Disabled">false</data></node>
<node id="n29" labels=":RecordComputer"><data key="labels">:RecordComputer</data><data key="ModifiedDate">0001-01-01T00:00:00</data><data key="F03">2016-03-28T11:43:48.0379727-04:00</data><data key="F01">45792348</data><data key="F02">WS-MRSPFRY02</data><data key="CreatedDate">0001-01-01T00:00:00</data><data key="Source">Manual</data><data key="Allowed">[]</data><data key="LinkedData">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="SessionTimeSpent">0</data><data key="TotalTimeSpent">0</data><data key="TimeTrackingEnabled">true</data><data key="Visualizations">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.VisualizationData, Core]], mscorlib]], mscorlib"}</data><data key="ApplicationRevision">0</data><data key="Comments">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.Comments, Core]], mscorlib]], mscorlib"}</data><data key="TrackingId">1</data><data key="ApplicationId">A02</data><data key="ActionsExecuted">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="Id">RC01</data><data key="Name">CMP001</data><data key="Disabled">false</data></node>
<node id="n30" labels=":RecordEmployee"><data key="labels">:RecordEmployee</data><data key="ModifiedDate">0001-01-01T00:00:00</data><data key="F03">2016-03-28T11:43:48.6392467-04:00</data><data key="F01">Philip</data><data key="F02">Fry</data><data key="CreatedDate">0001-01-01T00:00:00</data><data key="Source">Manual</data><data key="Allowed">[]</data><data key="LinkedData">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="SessionTimeSpent">0</data><data key="TotalTimeSpent">0</data><data key="TimeTrackingEnabled">true</data><data key="Visualizations">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.VisualizationData, Core]], mscorlib]], mscorlib"}</data><data key="ApplicationRevision">0</data><data key="Comments">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.Comments, Core]], mscorlib]], mscorlib"}</data><data key="TrackingId">1</data><data key="ApplicationId">A01</data><data key="ActionsExecuted">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="Id">RE01</data><data key="Name">EMP001</data><data key="Disabled">false</data></node>
<node id="n31" labels=":RecordEmployee"><data key="labels">:RecordEmployee</data><data key="ModifiedDate">0001-01-01T00:00:00</data><data key="F03">2016-03-28T11:43:49.0845658-04:00</data><data key="F01">Leela</data><data key="F02">Turanga</data><data key="CreatedDate">0001-01-01T00:00:00</data><data key="Source">Manual</data><data key="Allowed">[]</data><data key="LinkedData">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="SessionTimeSpent">0</data><data key="TotalTimeSpent">0</data><data key="TimeTrackingEnabled">true</data><data key="Visualizations">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.VisualizationData, Core]], mscorlib]], mscorlib"}</data><data key="ApplicationRevision">0</data><data key="Comments">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.Comments, Core]], mscorlib]], mscorlib"}</data><data key="TrackingId">2</data><data key="ApplicationId">A01</data><data key="ActionsExecuted">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="Id">RE02</data><data key="Name">EMP002</data><data key="Disabled">false</data></node>
<node id="n32" labels=":RecordComputer"><data key="labels">:RecordComputer</data><data key="F02">WS-FLLBRODR01</data><data key="ModifiedDate">0001-01-01T00:00:00</data><data key="F03">2016-03-28T11:43:49.2414982-04:00</data><data key="CreatedDate">0001-01-01T00:00:00</data><data key="F01">777777</data><data key="Source">Manual</data><data key="Allowed">[]</data><data key="LinkedData">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="SessionTimeSpent">0</data><data key="TotalTimeSpent">0</data><data key="TimeTrackingEnabled">true</data><data key="Visualizations">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.VisualizationData, Core]], mscorlib]], mscorlib"}</data><data key="ApplicationRevision">0</data><data key="Comments">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Core.Models.Record.Comments, Core]], mscorlib]], mscorlib"}</data><data key="TrackingId">1</data><data key="ApplicationId">A02</data><data key="ActionsExecuted">{"$type":"System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib"}</data><data key="Id">RC02</data><data key="Name">CMP002</data><data key="Disabled">false</data></node>
<edge id="e0" source="n0" target="n1" label="Fields"><data key="label">Fields</data></edge>
<edge id="e1" source="n1" target="n2" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e2" source="n0" target="n3" label="Fields"><data key="label">Fields</data></edge>
<edge id="e3" source="n1" target="n4" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e4" source="n3" target="n5" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e5" source="n3" target="n6" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e6" source="n3" target="n7" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e7" source="n8" target="n9" label="Fields"><data key="label">Fields</data></edge>
<edge id="e8" source="n9" target="n10" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e9" source="n8" target="n11" label="Fields"><data key="label">Fields</data></edge>
<edge id="e10" source="n9" target="n12" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e11" source="n11" target="n13" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e12" source="n11" target="n14" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e13" source="n11" target="n15" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e14" source="n16" target="n17" label="Fields"><data key="label">Fields</data></edge>
<edge id="e15" source="n17" target="n18" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e16" source="n16" target="n19" label="Fields"><data key="label">Fields</data></edge>
<edge id="e17" source="n17" target="n20" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e18" source="n19" target="n21" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e19" source="n19" target="n22" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e20" source="n19" target="n23" label="VALUES"><data key="label">VALUES</data></edge>
<edge id="e21" source="n27" target="n18" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F04</data><data key="Name">Type</data><data key="Disabled">false</data></edge>
<edge id="e22" source="n27" target="n21" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Variations</data><data key="Disabled">false</data></edge>
<edge id="e23" source="n27" target="n22" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Variations</data><data key="Disabled">false</data></edge>
<edge id="e24" source="n28" target="n20" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F04</data><data key="Name">Type</data><data key="Disabled">false</data></edge>
<edge id="e25" source="n28" target="n23" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Variations</data><data key="Disabled">false</data></edge>
<edge id="e26" source="n29" target="n27" label="Reference"><data key="label">Reference</data><data key="Id">F09</data><data key="Name">Incidents</data></edge>
<edge id="e27" source="n29" target="n12" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F04</data><data key="Name">Make</data><data key="Disabled">false</data></edge>
<edge id="e28" source="n29" target="n13" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Applications</data><data key="Disabled">false</data></edge>
<edge id="e29" source="n29" target="n14" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Applications</data><data key="Disabled">false</data></edge>
<edge id="e30" source="n29" target="n24" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F06</data><data key="Name">IT</data></edge>
<edge id="e31" source="n29" target="n24" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F07</data><data key="Name">AllowedUsers</data></edge>
<edge id="e32" source="n30" target="n29" label="Reference"><data key="label">Reference</data><data key="Id">F08</data><data key="Name">Computers</data></edge>
<edge id="e33" source="n30" target="n2" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F04</data><data key="Name">Position</data><data key="Disabled">false</data></edge>
<edge id="e34" source="n30" target="n5" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Hobbies</data><data key="Disabled">false</data></edge>
<edge id="e35" source="n30" target="n6" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Hobbies</data><data key="Disabled">false</data></edge>
<edge id="e36" source="n30" target="n7" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Hobbies</data><data key="Disabled">false</data></edge>
<edge id="e37" source="n30" target="n24" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F06</data><data key="Name">IT</data></edge>
<edge id="e38" source="n30" target="n24" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F07</data><data key="Name">Account</data></edge>
<edge id="e39" source="n31" target="n29" label="Reference"><data key="label">Reference</data><data key="Id">F08</data><data key="Name">Computers</data></edge>
<edge id="e40" source="n31" target="n4" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F04</data><data key="Name">Position</data><data key="Disabled">false</data></edge>
<edge id="e41" source="n31" target="n5" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Hobbies</data><data key="Disabled">false</data></edge>
<edge id="e42" source="n31" target="n24" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F06</data><data key="Name">IT</data></edge>
<edge id="e43" source="n31" target="n25" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F06</data><data key="Name">IT</data></edge>
<edge id="e44" source="n31" target="n25" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F07</data><data key="Name">Account</data></edge>
<edge id="e45" source="n32" target="n31" label="Reference"><data key="label">Reference</data><data key="Id">F08</data><data key="Name">Employees</data></edge>
<edge id="e46" source="n32" target="n28" label="Reference"><data key="label">Reference</data><data key="Id">F09</data><data key="Name">Incidents</data></edge>
<edge id="e47" source="n32" target="n12" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F04</data><data key="Name">Make</data><data key="Disabled">false</data></edge>
<edge id="e48" source="n32" target="n13" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Applications</data><data key="Disabled">false</data></edge>
<edge id="e49" source="n32" target="n14" label="ValueSelection"><data key="label">ValueSelection</data><data key="Id">F05</data><data key="Name">Applications</data><data key="Disabled">false</data></edge>
<edge id="e50" source="n32" target="n24" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F06</data><data key="Name">IT</data></edge>
<edge id="e51" source="n32" target="n26" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F06</data><data key="Name">IT</data></edge>
<edge id="e52" source="n32" target="n26" label="USER_LIST"><data key="label">USER_LIST</data><data key="Id">F07</data><data key="Name">AllowedUsers</data></edge>
</graph>
</graphml>

Issue 2:
Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests.

If you have questions on how to use Neo4j, please ask on StackOverflow instead of creating an issue here.

Before creating a new issue, please check whether someone else has raised the same issue. You may be able to add context to that issue instead of duplicating the report. However, each issue should also only be focussed on a single problem, so do not describe new problems within an existing thread - these are very hard to track and manage, and your problem may be ignored. Finally, do not append comments to closed issues; if the same problem re-occurs, open a new issue, and include a link to the old one.

To help us understand your issue, please specify important details, primarily:

Neo4j version: X.Y.Z

Operating system: (for example Windows 95/Ubuntu 16.04)

API/Driver: (for example Cypher/Java API/Python driver vX.Y.Z)

Steps to reproduce

Expected behavior

Actual behavior

Additionally, include (as appropriate) log-files, stacktraces, and other debug output.

Example bug report

I discovered that when I mount data/ to a volume on my host, and then stop the container, the write.lock is not removed as well as a number of other files not being cleaned up properly.

Neo4j Version: 3.0M03

Operating System: Ubuntu 15.10

API: Docker

Steps to reproduce

Pull the image: docker pull neo4j/neo4j:3.0.0-M03

Create a directory on the host that will be a mount for the data: mkdir /home/neo4j-data

Start a new container that mounts to this directory: docker run -d --name neo4j-test -p 7474:7474 -v /home/neo4j-data:/data neo4j/neo4j:3.0.0-M03

Navigate to the write.lock file located in the directory: /data/databases/graph.db/schema/label/lucene/labelStore/1/

Stop the container: docker stop neo4j-test

Expected behavior

write.lock should be removed now.

Actual behavior

write.lock is still present and preventing access by other programs.