From c324b3ab415f80a1f61284b9e9f91bb456c885e0 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Wed, 29 Nov 2023 13:19:48 +0100 Subject: [PATCH] Fixed JSON queries --- .../queries/json/base/JsonQueryERElement.java | 2 +- .../json/base/entities/JsonQueryFacet.java | 2 +- .../json/base/entities/JsonQueryResource.java | 2 +- .../base/relations/JsonQueryConsistsOf.java | 2 +- .../base/relations/JsonQueryIsRelatedTo.java | 2 +- .../queries/JsonQueryTest.java | 2 +- .../resources/queries/query1.match.oquery | 6 +++--- src/test/resources/queries/query10.json | 12 ++++++++++++ .../resources/queries/query10.match.oquery | 12 ++++++++++++ .../queries/query10.traversal.oquery | 19 +++++++++++++++++++ .../resources/queries/query2.match.oquery | 12 ++++++------ .../resources/queries/query3.match.oquery | 10 +++++----- .../resources/queries/query4.match.oquery | 4 ++-- .../resources/queries/query5.match.oquery | 4 ++-- .../resources/queries/query6.match.oquery | 16 ++++++++-------- .../resources/queries/query7.match.oquery | 2 +- .../resources/queries/query8.match.oquery | 4 ++-- .../resources/queries/query9.match.oquery | 4 ++-- 18 files changed, 80 insertions(+), 37 deletions(-) create mode 100644 src/test/resources/queries/query10.json create mode 100644 src/test/resources/queries/query10.match.oquery create mode 100644 src/test/resources/queries/query10.traversal.oquery diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/JsonQueryERElement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/JsonQueryERElement.java index c96dcd1..53c8afa 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/JsonQueryERElement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/JsonQueryERElement.java @@ -400,7 +400,7 @@ public abstract class JsonQueryERElement { StringBuffer sb = null; if(size > 1) { - sb = addConstraints(jsonNode, null, alias); + sb = addConstraints(jsonNode, null, null); } StringBuffer entryBuffer = new StringBuffer(); diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryFacet.java b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryFacet.java index 674bb7d..12e08cb 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryFacet.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryFacet.java @@ -139,7 +139,7 @@ public class JsonQueryFacet extends JsonQueryEntity { alias = getAlias(true); StringBuffer sb = null; if(size > 0) { - sb = addConstraints(jsonNode, null, alias); + sb = addConstraints(jsonNode, null, null); } buffer.append(" {"); diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryResource.java b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryResource.java index d36a7b8..2da7ad1 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryResource.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/entities/JsonQueryResource.java @@ -216,7 +216,7 @@ public class JsonQueryResource extends JsonQueryEntity { alias = getAlias(true); StringBuffer sb = null; if(size > 0) { - sb = addConstraints(jsonNode, null, alias); + sb = addConstraints(jsonNode, null, null); } buffer.append(" {"); diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryConsistsOf.java b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryConsistsOf.java index 1e73248..96a4a1f 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryConsistsOf.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryConsistsOf.java @@ -208,7 +208,7 @@ public class JsonQueryConsistsOf extends JsonQueryRelation { alias = getAlias(true); StringBuffer sb = null; if(size > 0) { - sb = addConstraints(jsonNode, null, alias); + sb = addConstraints(jsonNode, null, null); } buffer.append(" {"); diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryIsRelatedTo.java b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryIsRelatedTo.java index 4ac4192..51fc35e 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryIsRelatedTo.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/json/base/relations/JsonQueryIsRelatedTo.java @@ -280,7 +280,7 @@ public class JsonQueryIsRelatedTo extends JsonQueryRelation { alias = getAlias(true); StringBuffer sb = null; if(size > 0) { - sb = addConstraints(jsonNode, null, alias); + sb = addConstraints(jsonNode, null, null); } buffer.append(" {"); diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/queries/JsonQueryTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/queries/JsonQueryTest.java index 9f6b6be..6dc833b 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/queries/JsonQueryTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/queries/JsonQueryTest.java @@ -117,7 +117,7 @@ public class JsonQueryTest extends ContextTest { @Test public void testSingleQuery() throws Exception { File queriesDirectory = getQueriesDirectory(); - File jsonQueryFile = new File(queriesDirectory, "query2.json"); + File jsonQueryFile = new File(queriesDirectory, "query10.json"); ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(jsonQueryFile); logger.info("Going to test the following JSON query {}", jsonNode.toString()); diff --git a/src/test/resources/queries/query1.match.oquery b/src/test/resources/queries/query1.match.oquery index 186da35..e8b4843 100644 --- a/src/test/resources/queries/query1.match.oquery +++ b/src/test/resources/queries/query1.match.oquery @@ -2,13 +2,13 @@ SELECT EXPAND(ret) FROM ( MATCH {class: EService, as: eservice0, where: ($currentMatch['@class'] INSTANCEOF 'EService')} - .outE('ConsistsOf') { as: consistsof00, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (consistsof00.propagationConstraint.add = "propagate"))} - .inV('StateFacet') { as: statefacet000, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet000.value = "down"))} + .outE('ConsistsOf') { as: consistsof00, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (propagationConstraint.add = "propagate"))} + .inV('StateFacet') { as: statefacet000, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "down"))} .inE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('IsIdentifiedBy') { as: isidentifiedby01, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet010, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet010.name = "data-transfer-service" AND softwarefacet010.group = "DataTransfer"))} + .inV('SoftwareFacet') { as: softwarefacet010, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (name = "data-transfer-service" AND group = "DataTransfer"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby01 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} diff --git a/src/test/resources/queries/query10.json b/src/test/resources/queries/query10.json new file mode 100644 index 0000000..ed5addc --- /dev/null +++ b/src/test/resources/queries/query10.json @@ -0,0 +1,12 @@ +{ + "type": "HostingNode", + "consistsOf": [ + { + "type": "ConsistsOf", + "target": { + "type": "StateFacet", + "value": "certified" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/queries/query10.match.oquery b/src/test/resources/queries/query10.match.oquery new file mode 100644 index 0000000..f3e54bb --- /dev/null +++ b/src/test/resources/queries/query10.match.oquery @@ -0,0 +1,12 @@ +SELECT EXPAND(ret) FROM ( + MATCH + {class: HostingNode, as: hostingnode0, where: ($currentMatch['@class'] INSTANCEOF 'HostingNode')} + + .outE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} + .inV('StateFacet') { as: statefacet000, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "certified"))} + .inE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)} + .outV('HostingNode') { where: ($matched.hostingnode0 == $currentMatch)} + + RETURN + DISTINCT(hostingnode0) as ret +) diff --git a/src/test/resources/queries/query10.traversal.oquery b/src/test/resources/queries/query10.traversal.oquery new file mode 100644 index 0000000..7de6f95 --- /dev/null +++ b/src/test/resources/queries/query10.traversal.oquery @@ -0,0 +1,19 @@ +SELECT FROM ( + TRAVERSE outV("EService") FROM ( + TRAVERSE inE("IsIdentifiedBy") FROM ( + SELECT FROM ( + TRAVERSE inV("SoftwareFacet") FROM ( + TRAVERSE outE("IsIdentifiedBy") FROM ( + TRAVERSE outV("EService") FROM ( + SELECT FROM ( + TRAVERSE inE("ConsistsOf") FROM ( + SELECT FROM StateFacet WHERE value = "down" + ) + ) WHERE propagationConstraint.add = "propagate" + ) + ) + ) + ) WHERE name = "data-transfer-service" AND group = "DataTransfer" + ) + ) +) WHERE @class INSTANCEOF "EService" \ No newline at end of file diff --git a/src/test/resources/queries/query2.match.oquery b/src/test/resources/queries/query2.match.oquery index 6b232aa..e2650fc 100644 --- a/src/test/resources/queries/query2.match.oquery +++ b/src/test/resources/queries/query2.match.oquery @@ -2,23 +2,23 @@ SELECT EXPAND(ret) FROM ( MATCH {class: EService, as: eservice0, where: ($currentMatch['@class'] INSTANCEOF 'EService')} - .inE('Activates') { as: activates00, where: (($currentMatch['@class'] INSTANCEOF 'Activates') AND (activates00.id = "bd89a311-780d-4efe-93e5-08281e53bce7"))} - .outV('HostingNode') { as: hostingnode000, where: (($currentMatch['@class'] INSTANCEOF 'HostingNode') AND (hostingnode000.id = "44fac329-eed5-4f18-90ba-a54d5aad316e"))} + .inE('Activates') { as: activates00, where: (($currentMatch['@class'] INSTANCEOF 'Activates') AND (id = "bd89a311-780d-4efe-93e5-08281e53bce7"))} + .outV('HostingNode') { as: hostingnode000, where: (($currentMatch['@class'] INSTANCEOF 'HostingNode') AND (id = "44fac329-eed5-4f18-90ba-a54d5aad316e"))} .outE('Activates') { where: ($matched.activates00 == $currentMatch)} .inV('EService') { where: ($matched.eservice0 == $currentMatch)} - .outE('ConsistsOf') { as: consistsof01, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (consistsof01.propagationConstraint.add = "propagate"))} - .inV('StateFacet') { as: statefacet010, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet010.value = "down"))} + .outE('ConsistsOf') { as: consistsof01, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (propagationConstraint.add = "propagate"))} + .inV('StateFacet') { as: statefacet010, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "down"))} .inE('ConsistsOf') { where: ($matched.consistsof01 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('IsIdentifiedBy') { as: isidentifiedby02, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet020, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet020.name = "data-transfer-service" AND softwarefacet020.group = "DataTransfer"))} + .inV('SoftwareFacet') { as: softwarefacet020, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (name = "data-transfer-service" AND group = "DataTransfer"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby02 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('ConsistsOf') { as: consistsof03, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .inV('AccessPointFacet') { as: accesspointfacet030, where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND (accesspointfacet030.endpoint = "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"))} + .inV('AccessPointFacet') { as: accesspointfacet030, where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND (endpoint = "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"))} .inE('ConsistsOf') { where: ($matched.consistsof03 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} diff --git a/src/test/resources/queries/query3.match.oquery b/src/test/resources/queries/query3.match.oquery index 5c76822..2144a07 100644 --- a/src/test/resources/queries/query3.match.oquery +++ b/src/test/resources/queries/query3.match.oquery @@ -5,24 +5,24 @@ SELECT EXPAND(ret) FROM ( .inE('Activates') { as: activates00, where: ($currentMatch['@class'] INSTANCEOF 'Activates')} .outV('HostingNode') { as: hostingnode000, where: ($currentMatch['@class'] INSTANCEOF 'HostingNode')} .outE('ConsistsOf') { as: consistsof0000, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .inV('CPUFacet') { as: cpufacet00000, where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND (cpufacet00000.vendor = "GenuineIntel"))} + .inV('CPUFacet') { as: cpufacet00000, where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND (vendor = "GenuineIntel"))} .inE('ConsistsOf') { where: ($matched.consistsof0000 == $currentMatch)} .outV('HostingNode') { where: ($matched.hostingnode000 == $currentMatch)} .outE('Activates') { where: ($matched.activates00 == $currentMatch)} .inV('EService') { where: ($matched.eservice0 == $currentMatch)} - .outE('ConsistsOf') { as: consistsof01, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (consistsof01.propagationConstraint.add = "propagate"))} - .inV('StateFacet') { as: statefacet010, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet010.value = "down"))} + .outE('ConsistsOf') { as: consistsof01, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (propagationConstraint.add = "propagate"))} + .inV('StateFacet') { as: statefacet010, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "down"))} .inE('ConsistsOf') { where: ($matched.consistsof01 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('IsIdentifiedBy') { as: isidentifiedby02, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet020, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet020.name = "data-transfer-service" AND softwarefacet020.group = "DataTransfer"))} + .inV('SoftwareFacet') { as: softwarefacet020, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (name = "data-transfer-service" AND group = "DataTransfer"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby02 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('ConsistsOf') { as: consistsof03, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .inV('AccessPointFacet') { as: accesspointfacet030, where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND (accesspointfacet030.endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))} + .inV('AccessPointFacet') { as: accesspointfacet030, where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND (endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))} .inE('ConsistsOf') { where: ($matched.consistsof03 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} diff --git a/src/test/resources/queries/query4.match.oquery b/src/test/resources/queries/query4.match.oquery index 39881e6..399f815 100644 --- a/src/test/resources/queries/query4.match.oquery +++ b/src/test/resources/queries/query4.match.oquery @@ -1,9 +1,9 @@ SELECT EXPAND(ret) FROM ( MATCH - {class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))} + {class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "down"))} .inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .outV('EService') { as: eservice000, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (eservice000.id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))} + .outV('EService') { as: eservice000, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))} .outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)} .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)} RETURN diff --git a/src/test/resources/queries/query5.match.oquery b/src/test/resources/queries/query5.match.oquery index a6a6d3e..c751346 100644 --- a/src/test/resources/queries/query5.match.oquery +++ b/src/test/resources/queries/query5.match.oquery @@ -1,9 +1,9 @@ SELECT EXPAND(ret) FROM ( MATCH - {class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))} + {class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "down"))} .inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .outV('EService') { as: eservice000, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (((eservice000.id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND eservice000.metadata.createdBy <> "luca.frosini") OR (eservice000.id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND eservice000.metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"))))} + .outV('EService') { as: eservice000, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (((id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND metadata.createdBy <> "luca.frosini") OR (id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"))))} .outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)} .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)} RETURN diff --git a/src/test/resources/queries/query6.match.oquery b/src/test/resources/queries/query6.match.oquery index 9c6a1ab..ecc6921 100644 --- a/src/test/resources/queries/query6.match.oquery +++ b/src/test/resources/queries/query6.match.oquery @@ -1,28 +1,28 @@ SELECT EXPAND(ret) FROM ( MATCH - {class: EService, as: eservice0, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (eservice0.id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))} + {class: EService, as: eservice0, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))} - .inE('Activates') { as: activates00, where: (($currentMatch['@class'] INSTANCEOF 'Activates') AND (activates00.id = "bd89a311-780d-4efe-93e5-08281e53bce7"))} - .outV('HostingNode') { as: hostingnode000, where: (($currentMatch['@class'] INSTANCEOF 'HostingNode') AND (hostingnode000.id = "44fac329-eed5-4f18-90ba-a54d5aad316e"))} + .inE('Activates') { as: activates00, where: (($currentMatch['@class'] INSTANCEOF 'Activates') AND (id = "bd89a311-780d-4efe-93e5-08281e53bce7"))} + .outV('HostingNode') { as: hostingnode000, where: (($currentMatch['@class'] INSTANCEOF 'HostingNode') AND (id = "44fac329-eed5-4f18-90ba-a54d5aad316e"))} .outE('ConsistsOf') { as: consistsof0000, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .inV('CPUFacet') { as: cpufacet00000, where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND (cpufacet00000.vendor = "GenuineIntel"))} + .inV('CPUFacet') { as: cpufacet00000, where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND (vendor = "GenuineIntel"))} .inE('ConsistsOf') { where: ($matched.consistsof0000 == $currentMatch)} .outV('HostingNode') { where: ($matched.hostingnode000 == $currentMatch)} .outE('Activates') { where: ($matched.activates00 == $currentMatch)} .inV('EService') { where: ($matched.eservice0 == $currentMatch)} - .outE('ConsistsOf') { as: consistsof01, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (consistsof01.propagationConstraint.add = "propagate"))} - .inV('StateFacet') { as: statefacet010, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet010.value = "down"))} + .outE('ConsistsOf') { as: consistsof01, where: (($currentMatch['@class'] INSTANCEOF 'ConsistsOf') AND (propagationConstraint.add = "propagate"))} + .inV('StateFacet') { as: statefacet010, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (value = "down"))} .inE('ConsistsOf') { where: ($matched.consistsof01 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('IsIdentifiedBy') { as: isidentifiedby02, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet020, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet020.name = "data-transfer-service" AND softwarefacet020.group = "DataTransfer"))} + .inV('SoftwareFacet') { as: softwarefacet020, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (name = "data-transfer-service" AND group = "DataTransfer"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby02 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} .outE('ConsistsOf') { as: consistsof03, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .inV('AccessPointFacet') { as: accesspointfacet030, where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND (accesspointfacet030.endpoint = "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"))} + .inV('AccessPointFacet') { as: accesspointfacet030, where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND (endpoint = "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"))} .inE('ConsistsOf') { where: ($matched.consistsof03 == $currentMatch)} .outV('EService') { where: ($matched.eservice0 == $currentMatch)} diff --git a/src/test/resources/queries/query7.match.oquery b/src/test/resources/queries/query7.match.oquery index 975e33d..402dd24 100644 --- a/src/test/resources/queries/query7.match.oquery +++ b/src/test/resources/queries/query7.match.oquery @@ -3,7 +3,7 @@ SELECT EXPAND(ret) FROM ( {class: StateFacet, as: statefacet0, where: ($currentMatch['@class'] INSTANCEOF 'StateFacet')} .inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')} - .outV('EService') { as: eservice000, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (((eservice000.id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND eservice000.metadata.createdBy <> "luca.frosini") OR (eservice000.id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND eservice000.metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"))))} + .outV('EService') { as: eservice000, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (((id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND metadata.createdBy <> "luca.frosini") OR (id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"))))} .outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)} .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)} RETURN diff --git a/src/test/resources/queries/query8.match.oquery b/src/test/resources/queries/query8.match.oquery index 3f2abc9..0830710 100644 --- a/src/test/resources/queries/query8.match.oquery +++ b/src/test/resources/queries/query8.match.oquery @@ -4,14 +4,14 @@ SELECT EXPAND(ret) FROM ( .inV('VirtualService') { as: virtualservice00, where: ($currentMatch['@class'] INSTANCEOF 'VirtualService')} .outE('IsIdentifiedBy') { as: isidentifiedby000, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet0000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet0000.group = "org.gcube.data-catalogue" AND softwarefacet0000.name = "catalogue-virtual-service"))} + .inV('SoftwareFacet') { as: softwarefacet0000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (group = "org.gcube.data-catalogue" AND name = "catalogue-virtual-service"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby000 == $currentMatch)} .outV('VirtualService') { where: ($matched.virtualservice00 == $currentMatch)} .inE('CallsFor') { where: ($matched.callsfor0 == $currentMatch)} .outV('EService') { as: eservice01, where: ($currentMatch['@class'] INSTANCEOF 'EService')} .outE('IsIdentifiedBy') { as: isidentifiedby010, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet0100, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet0100.group = "org.gcube.data-catalogue" AND softwarefacet0100.name = "gcat"))} + .inV('SoftwareFacet') { as: softwarefacet0100, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (group = "org.gcube.data-catalogue" AND name = "gcat"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby010 == $currentMatch)} .outV('EService') { where: ($matched.eservice01 == $currentMatch)} .outE('CallsFor') { where: ($matched.callsfor0 == $currentMatch)} diff --git a/src/test/resources/queries/query9.match.oquery b/src/test/resources/queries/query9.match.oquery index ce799ac..e71720e 100644 --- a/src/test/resources/queries/query9.match.oquery +++ b/src/test/resources/queries/query9.match.oquery @@ -7,13 +7,13 @@ SELECT EXPAND(ret) FROM ( .inE('IsCustomizedBy') { as: iscustomizedby0000, where: ($currentMatch['@class'] INSTANCEOF 'IsCustomizedBy')} .outV('VirtualService') { as: virtualservice00000, where: ($currentMatch['@class'] INSTANCEOF 'VirtualService')} .outE('IsIdentifiedBy') { as: isidentifiedby000000, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('SoftwareFacet') { as: softwarefacet0000000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet0000000.group = "org.gcube.data-catalogue" AND softwarefacet0000000.name = "catalogue-virtual-service"))} + .inV('SoftwareFacet') { as: softwarefacet0000000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (group = "org.gcube.data-catalogue" AND name = "catalogue-virtual-service"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby000000 == $currentMatch)} .outV('VirtualService') { where: ($matched.virtualservice00000 == $currentMatch)} .outE('IsCustomizedBy') { where: ($matched.iscustomizedby0000 == $currentMatch)} .inV('Configuration') { where: ($matched.configuration000 == $currentMatch)} .outE('IsIdentifiedBy') { as: isidentifiedby0001, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')} - .inV('IdentifierFacet') { as: identifierfacet00010, where: (($currentMatch['@class'] INSTANCEOF 'IdentifierFacet') AND (identifierfacet00010.value = "gcat-configuration"))} + .inV('IdentifierFacet') { as: identifierfacet00010, where: (($currentMatch['@class'] INSTANCEOF 'IdentifierFacet') AND (value = "gcat-configuration"))} .inE('IsIdentifiedBy') { where: ($matched.isidentifiedby0001 == $currentMatch)} .outV('Configuration') { where: ($matched.configuration000 == $currentMatch)} .outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)}