Need your help in sharing a best possible query or possible to combine these 2 queries in 1 query.
Here c.EQUIP_NATIVENAME can be either IPV6 (2400:122:44:aec2:33e) or IPV4 ( 10.127.12.123 )
Query 1)
MATCH (sc:SITE_CODE_TABLE)-[:site2sitecode]-(s:SITE)-[utilsite2container]-(c:CONTAINER)
WHERE c.EQUIP_TYPE = 'ESC' and s.SITE_TYPE IN
['AG2-OTN','AG3-IDC','CLS','AG3','SAG2'] AND c.EQUIP_VENDOR = 'EMERSON NETWORK POWER' AND c.EQUIP_NATIVENAME CONTAINS ':'
RETURN
'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+replace(c.EQUIP_NATIVENAME,':','_') AS MO,
'.oc.'+s.SITE_REGION+'_LFLRTU' AS OC
LIMIT 10
Query 2)
MATCH (sc:SITE_CODE_TABLE)-[:site2sitecode]-(s:SITE)-[utilsite2container]-(c:CONTAINER)
WHERE c.EQUIP_TYPE = 'ESC' and s.SITE_TYPE IN
['AG2-OTN','AG3-IDC','CLS','AG3','SAG2'] AND c.EQUIP_VENDOR = 'EMERSON NETWORK POWER' AND c.EQUIP_NATIVENAME CONTAINS '.'
RETURN 'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+replace(c.EQUIP_NATIVENAME,'.','_') AS MO,
'.oc.'+s.SITE_REGION+'_LFLRTU' AS OC
LIMIT 10
MATCH (sc:SITE_CODE_TABLE)-[:site2sitecode]-(s:SITE)-[utilsite2container]-(c:CONTAINER)
WHERE c.EQUIP_TYPE = 'ESC'
AND s.SITE_TYPE IN ['AG2-OTN','AG3-IDC','CLS','AG3','SAG2']
AND c.EQUIP_VENDOR = 'EMERSON NETWORK POWER'
AND c.EQUIP_NATIVENAME CONTAINS ':'
WITH sc, c, s
CALL {
WITH sc, c, s
RETURN 'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+replace(c.EQUIP_NATIVENAME,':','_') AS MO,
'.oc.'+s.SITE_REGION+'_LFLRTU' AS OC
LIMIT 10
UNION
WITH sc, c, s
RETURN 'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+replace(c.EQUIP_NATIVENAME,'.','_') AS MO,
'.oc.'+s.SITE_REGION+'_LFLRTU' AS OC
LIMIT 10
}
RETURN MO, OC
MATCH (sc:SITE_CODE_TABLE)-[:site2sitecode]-(s:SITE)-[utilsite2container]-(c:CONTAINER)
WHERE c.EQUIP_TYPE = 'ESC'
AND s.SITE_TYPE IN ['AG2-OTN','AG3-IDC','CLS','AG3','SAG2']
AND c.EQUIP_VENDOR = 'EMERSON NETWORK POWER'
AND c.EQUIP_NATIVENAME CONTAINS ':'
RETURN 'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+replace(c.EQUIP_NATIVENAME,':','_') AS MO_1,
'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+replace(c.EQUIP_NATIVENAME,'.','_') AS MO_2,
'.oc.'+s.SITE_REGION+'_LFLRTU' AS OC
LIMIT 10
Use a UNION ALL between the two queries, that way you can use a single query to execute and get the results for both.
If you need something on the row to differentiate which query the result is associated with, add an additional RETURN variable where the value indicates which one it came from.
MATCH (sc:SITE_CODE_TABLE)-[:site2sitecode]-(s:SITE)-[utilsite2container]-(c:CONTAINER)
WHERE c.EQUIP_TYPE = 'ESC'
AND s.SITE_TYPE IN ['AG2-OTN','AG3-IDC','CLS','AG3','SAG2']
AND c.EQUIP_VENDOR = 'EMERSON NETWORK POWER'
RETURN 'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+
CASE WHEN c.EQUIP_NATIVENAME CONTAINS ':'
THEN replace(c.EQUIP_NATIVENAME,':','_')
ELSE replace(c.EQUIP_NATIVENAME,'.','_') END AS MO,
'.oc.'+s.SITE_REGION+'_LFLRTU' AS OC
MATCH (sc:SITE_CODE_TABLE)-[:site2sitecode]-(s:SITE)-[utilsite2container]-(c:CONTAINER)
WHERE c.EQUIP_TYPE = 'ESC'
AND s.SITE_TYPE IN ['AG2-OTN','AG3-IDC','CLS','AG3','SAG2']
AND c.EQUIP_VENDOR = 'EMERSON NETWORK POWER'
SET c.MO = 'GENERIC .x'+toLower(sc.SITE_CIRCLE_CODE_OC)+'.'+
CASE WHEN c.EQUIP_NATIVENAME CONTAINS ':'
THEN replace(c.EQUIP_NATIVENAME,':','_')
ELSE replace(c.EQUIP_NATIVENAME,'.','_') END,
c.OC = '.oc.'+s.SITE_REGION+'_LFLRTU'