Thanks Michael and Wes! I suspect it says "Oh, I can't evaluate the '(()-[:nicowner]->(nic))' expression", because NIC is NULL, so it fails the WHERE clause. My guess is that reversing the order of the OR would also fail.
On 09/04/2015 01:04 AM, Michael Hunger wrote: > Ah cool !! > > I thought that it would automatically handle the NULL case :) > > M > >> Am 04.09.2015 um 00:54 schrieb Alan Robertson <[email protected] >> <mailto:[email protected]>>: >> >> But this one looks like it works! >> >> START ip=node:IPaddrNode('*:*') >> OPTIONAL MATCH (nic)-[:ipowner]->(ip) >> WITH nic,ip >> WHERE nic IS NULL OR NOT (()-[:nicowner]->(nic)) >> RETURN ip, nic >> ORDER BY ip.ipaddr >> >> Konsole output >> >> >> >> >> On 09/03/2015 04:46 PM, Alan Robertson wrote: >>> Hi Michael, >>> >>> I finally had time to try your suggestion. Thanks much for your >>> reply! Unfortunately it's still not quite here yet... >>> >>> >>> On 09/01/2015 05:37 PM, Michael Hunger wrote: >>>> >>>> START ip=node:IPaddrNode('*:*') >>>> OPTIONAL MATCH (nic)-[:ipowner]->(ip) >>>> WITH nic,ip >>>> WHERE NOT (()-[:nicowner]->(nic)) >>>> RETURN ip, nic >>>> ORDER BY ip.ipaddr >>>> >>> Well... It produces output including the MAC address for every node >>> which *has* a MAC address. >>> >>> But it omits any which doesn't have a MAC address (NIC). >>> >>> Here's what I mean: >>> Konsole output >>> *$ cma/assimcli.py query allips* >>> 2601:280:4080:79e5:ca0a:a9ff:fe88:1d52 c8-0a-a9-88-1d-52 ubuntu72 >>> ::ffff:10.10.10.100 00-c0-48-21-92-9f undefined >>> ::ffff:10.10.10.12 00-1e-c0-89-40-7f undefined >>> ::ffff:10.10.10.130 c8-0a-a9-88-1d-52 ubuntu72 >>> ::ffff:10.10.10.21 6c-62-6d-84-98-4b undefined >>> ::ffff:10.10.10.249 a0-21-b7-a1-83-5f a0-21-b7-a1-83-5f >>> ::ffff:10.10.10.254 c4-3d-c7-a8-1b-5b undefined >>> *::ffff:10.10.10.5 undefined undefined* >>> ::ffff:10.10.10.66 00-26-18-21-8b-58 undefined >>> ::ffff:10.10.10.95 00-11-d9-5f-f8-ca undefined >>> ::ffff:172.17.42.1 56-84-7a-fe-97-99 ubuntu72 >>> ::ffff:192.168.122.1 ca-1d-7f-2a-80-c5 ubuntu72 >>> *ubuntu72:~/monitor/secure.src $ cma/assimcli.py query unknownips * >>> ::ffff:10.10.10.100 MAC(00-c0-48-21-92-9f) >>> ::ffff:10.10.10.12 MAC(00-1e-c0-89-40-7f) >>> ::ffff:10.10.10.21 MAC(6c-62-6d-84-98-4b) >>> ::ffff:10.10.10.254 MAC(c4-3d-c7-a8-1b-5b) >>> ::ffff:10.10.10.66 MAC(00-26-18-21-8b-58) >>> ::ffff:10.10.10.95 MAC(00-11-d9-5f-f8-ca) >>> >>> The address *10.10.10.5* doesn't have an associated NIC (MAC >>> address), and it is not included in the "unknown" IPs - and it >>> should be. >>> >>> We have two different mechanisms to discover IP addresses. One is >>> through client connections - in which case we typically don't know >>> the MAC address. The other is through listening to ARP packets - in >>> which case we will know the MAC address. >>> >>> In our software, we equate a MAC address with a NIC. It may not be >>> strictly true, but it's not a bad first approximation ;-). >>> >>> >>> -- >>> >>> Alan Robertson / CTO >>> [email protected] >>> <mailto:[email protected]>/ +1 303.947.7999 >>> >>> Assimilation Systems Limited >>> http://AssimilationSystems.com <http://assimilationsystems.com/> >>> >>> <Mail-Anhang.png> <https://twitter.com/ossalanr> <Mail-Anhang.png> >>> <https://www.linkedin.com/in/alanr> <Mail-Anhang.png> >>> <https://htmlsig.com/skype?username=alanr_unix.sh> >>> >> >> >> -- >> >> Alan Robertson / CTO >> [email protected] <mailto:[email protected]>/ >> +1 303.947.7999 >> >> Assimilation Systems Limited >> http://AssimilationSystems.com <http://assimilationsystems.com/> >> >> <twitter.png> <https://twitter.com/ossalanr> <linkedin.png> >> <https://www.linkedin.com/in/alanr> <skype.png> >> <https://htmlsig.com/skype?username=alanr_unix.sh> >> > -- Alan Robertson / CTO [email protected] <mailto:[email protected]>/ +1 303.947.7999 Assimilation Systems Limited http://AssimilationSystems.com Twitter <https://twitter.com/ossalanr> Linkedin <https://www.linkedin.com/in/alanr> skype <https://htmlsig.com/skype?username=alanr_unix.sh> -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
