Fixed queries

This commit is contained in:
luca.frosini 2023-11-16 14:09:57 +01:00
parent ffd20403da
commit 816c7693dc
15 changed files with 120 additions and 52 deletions

View File

@ -1,10 +1,10 @@
SELECT EXPAND(eservice) FROM ( SELECT EXPAND(ret) FROM (
MATCH MATCH
{class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')} {class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')}
.outE('IsIdentifiedBy').inV("SoftwareFacet") {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')} .outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')}
.inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf') {where: (propagationConstraint.add='propagate')} .outE('ConsistsOf') {where: (propagationConstraint.add='propagate')}
.inV("StateFacet") {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value="down")} .inV('StateFacet') {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value='down')}
RETURN RETURN
eservice DISTINCT(eservice) as ret
) )

View File

@ -1,15 +1,15 @@
SELECT EXPAND(eservice) FROM ( SELECT EXPAND(ret) FROM (
MATCH MATCH
{class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')} {class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')}
.outE('IsIdentifiedBy').inV("SoftwareFacet") {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')} .outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')}
.inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf') {where: (propagationConstraint.add='propagate')} .outE('ConsistsOf') {where: (propagationConstraint.add='propagate')}
.inV("StateFacet") {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value="down")} .inV('StateFacet') {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value='down')}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf').inV("AccessPointFacet") {where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND endpoint="http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource")} .outE('ConsistsOf').inV('AccessPointFacet') {where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND endpoint='http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource')}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.inE('Activates') {where: (id='bd89a311-780d-4efe-93e5-08281e53bce7')} .inE('Activates') {where: (id='bd89a311-780d-4efe-93e5-08281e53bce7')}
.outV("HostingNode") {where: (id='44fac329-eed5-4f18-90ba-a54d5aad316e')} .outV('HostingNode') {where: (id='44fac329-eed5-4f18-90ba-a54d5aad316e')}
RETURN RETURN
eservice DISTINCT(eservice) as ret
) )

View File

@ -1,31 +1,14 @@
SELECT EXPAND(eservice) FROM (
MATCH
{class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')}
.outE('IsIdentifiedBy').inV("SoftwareFacet") {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')}
.inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf') {where: (propagationConstraint.add='propagate')}
.inV("StateFacet") {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value="down")}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf').inV("AccessPointFacet") {where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND endpoint="http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource")}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.inE('Activates').outV("HostingNode").outE('ConsistsOf').inV("CPUFacet") {where: (vendor='GenuineIntel')}
RETURN
eservice
)
SELECT EXPAND(ret) FROM ( SELECT EXPAND(ret) FROM (
MATCH MATCH
{class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')} {class: EService, as: eservice, where: ($currentMatch['@class'] INSTANCEOF 'EService')}
.outE('IsIdentifiedBy').inV("SoftwareFacet") {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')} .outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')}
.inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf') {where: (propagationConstraint.add='propagate')} .outE('ConsistsOf') {where: (propagationConstraint.add='propagate')}
.inV("StateFacet") {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value="ready")} .inV('StateFacet') {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value='ready')}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf').inV("AccessPointFacet") {where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND endpoint="http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource")} .outE('ConsistsOf').inV('AccessPointFacet') {where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND endpoint='http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource')}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)} .inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.inE('Activates').outV("HostingNode").outE('ConsistsOf').inV("CPUFacet") {where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND vendor='GenuineIntel')} .inE('Activates').outV('HostingNode').outE('ConsistsOf').inV('CPUFacet') {where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND vendor='GenuineIntel')}
RETURN RETURN
DISTINCT(eservice) as ret DISTINCT(eservice) as ret

View File

@ -0,0 +1,20 @@
SELECT EXPAND(ret) FROM (
MATCH
{class: StateFacet, as: statefacet, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value='down')}
.inE('ConsistsOf').outV('Eservice') {
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'
)
)
)
}
RETURN
DISTINCT(statefacet) as ret
)

View File

@ -1 +1 @@
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM EService WHERE ((id = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND metadata.createdBy <> "luca.frosini") OR (id = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"))))) WHERE value = "down" AND @class INSTANCEOF "StateFacet" SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM EService WHERE ((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"))))) WHERE value = "down" AND @class INSTANCEOF "StateFacet"

View File

@ -24,9 +24,9 @@ SELECT FROM (
SELECT FROM CPUFacet WHERE vendor = "GenuineIntel" SELECT FROM CPUFacet WHERE vendor = "GenuineIntel"
) )
) )
) WHERE id = "5fbc1a56-d450-4f0f-85c1-9b1684581717" ) WHERE id = "44fac329-eed5-4f18-90ba-a54d5aad316e"
) )
) WHERE id = "d3f58e52-5346-47bc-b736-9d77a0b554ce" ) WHERE id = "bd89a311-780d-4efe-93e5-08281e53bce7"
) )
) )
) )
@ -41,7 +41,7 @@ SELECT FROM (
) )
) )
) )
) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service" ) WHERE endpoint = "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"
) )
) )
) WHERE id = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND @class INSTANCEOF "EService" ) WHERE id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND @class INSTANCEOF "EService"

View File

@ -1,6 +1,6 @@
{ {
"type": "EService", "type": "EService",
"id": "0255b7ec-e3da-4071-b456-9a2907ece1db", "id": "93995af0-4f95-4816-a53e-3e1bc27ef475",
"consistsOf": [ "consistsOf": [
{ {
"type": "ConsistsOf", "type": "ConsistsOf",
@ -24,17 +24,17 @@
"type": "ConsistsOf", "type": "ConsistsOf",
"target": { "target": {
"type": "AccessPointFacet", "type": "AccessPointFacet",
"endpoint": "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service" "endpoint": "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"
} }
} }
], ],
"isRelatedTo" : [ "isRelatedTo" : [
{ {
"type": "Activates", "type": "Activates",
"id": "d3f58e52-5346-47bc-b736-9d77a0b554ce", "id": "bd89a311-780d-4efe-93e5-08281e53bce7",
"source": { "source": {
"type": "HostingNode", "type": "HostingNode",
"id" : "5fbc1a56-d450-4f0f-85c1-9b1684581717", "id" : "44fac329-eed5-4f18-90ba-a54d5aad316e",
"consistsOf": [ "consistsOf": [
{ {
"type": "ConsistsOf", "type": "ConsistsOf",

View File

@ -0,0 +1,17 @@
SELECT EXPAND(ret) FROM (
MATCH
{class: EService, as: eservice, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND id="93995af0-4f95-4816-a53e-3e1bc27ef475")}
.outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='data-transfer-service' AND group='DataTransfer')}
.inE('IsIdentifiedBy').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf') {where: (propagationConstraint.add='propagate')}
.inV('StateFacet') {where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND value='down')}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.outE('ConsistsOf').inV('AccessPointFacet') {where: (($currentMatch['@class'] INSTANCEOF 'AccessPointFacet') AND endpoint='http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource')}
.inE('ConsistsOf').outV('Eservice') {where: ($matched.eservice == $currentMatch)}
.inE('Activates') {where: (id='bd89a311-780d-4efe-93e5-08281e53bce7')}
.outV('HostingNode') {where: (id='44fac329-eed5-4f18-90ba-a54d5aad316e')}
.outE('ConsistsOf').inV('CPUFacet') {where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND vendor='GenuineIntel')}
RETURN
DISTINCT(eservice) as ret
)

View File

@ -1 +1 @@
SELECT FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") 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 ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( SELECT FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM CPUFacet WHERE vendor = "GenuineIntel"))) WHERE id = "5fbc1a56-d450-4f0f-85c1-9b1684581717")) WHERE id = "d3f58e52-5346-47bc-b736-9d77a0b554ce")))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))) WHERE id = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND @class INSTANCEOF "EService" SELECT FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") 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 ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( SELECT FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM CPUFacet WHERE vendor = "GenuineIntel"))) WHERE id = "44fac329-eed5-4f18-90ba-a54d5aad316e")) WHERE id = "bd89a311-780d-4efe-93e5-08281e53bce7")))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://smartexecutor1.dev.int.d4science.net:80/data-transfer-service/gcube/resource"))) WHERE id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND @class INSTANCEOF "EService"

View File

@ -3,8 +3,8 @@ SELECT FROM (
TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outE("ConsistsOf") FROM (
SELECT FROM EService SELECT FROM EService
WHERE ( WHERE (
(id = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND metadata.createdBy <> "luca.frosini") OR (id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND metadata.createdBy <> "luca.frosini") OR
(id = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080") (id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80")
) )
) )
) )

View File

@ -5,14 +5,22 @@
"source" : { "source" : {
"type" : "EService", "type" : "EService",
"_or": [ "_or": [
{"_and": { {
"id" : "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925", "_and": {
"metadata" :{ "createdBy": {"_ne": "luca.frosini"} } "id" : "93995af0-4f95-4816-a53e-3e1bc27ef475",
}}, "metadata" : {
{"_and": { "createdBy": {"_ne": "luca.frosini"}
"id" : "0255b7ec-e3da-4071-b456-9a2907ece1db", }
"metadata" : { "createdBy": "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080" } }
}} },
{
"_and": {
"id" : "bd4402a0-2b72-41c5-a970-321343649e7d",
"metadata" : {
"createdBy": "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"
}
}
}
] ]
} }
} }

View File

@ -0,0 +1,20 @@
SELECT EXPAND(ret) FROM (
MATCH
{class: StateFacet, as: statefacet, where: ($currentMatch['@class'] INSTANCEOF 'StateFacet')}
.inE('ConsistsOf').outV('Eservice') {
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'
)
)
)
}
RETURN
DISTINCT(statefacet) as ret
)

View File

@ -1 +1 @@
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM EService WHERE ((id = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND metadata.createdBy <> "luca.frosini") OR (id = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"))))) WHERE @class INSTANCEOF "StateFacet" SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM EService WHERE ((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"))))) WHERE @class INSTANCEOF "StateFacet"

View File

@ -0,0 +1,9 @@
SELECT EXPAND(ret) FROM (
MATCH
{class: CallsFor, as: callsfor, where: ($currentMatch['@class'] INSTANCEOF 'CallsFor')}
.inV('EService').outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='gcat' AND group='org.gcube.data-catalogue')}
.inE('IsIdentifiedBy').outV('Eservice').outE('CallsFor') {where: ($matched.callsfor == $currentMatch)}
.outV('VirtualService').outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='catalogue-virtual-service' AND group='org.gcube.data-catalogue')}
RETURN
DISTINCT(callsfor) as ret
)

View File

@ -0,0 +1,11 @@
SELECT EXPAND(ret) FROM (
MATCH
{class: SimpleFacet, as: simplefacet, where: ($currentMatch['@class'] INSTANCEOF 'SimpleFacet')}
.inE('ConsistsOf').outV('Configuration') {as: configuration, where: ($currentMatch['@class'] INSTANCEOF 'Configuration')}
.outE('IsIdentifiedBy').inV('IdentifierFacet') {where: (($currentMatch['@class'] INSTANCEOF 'IdentifierFacet') AND value='gcat-configuration')}
.inE('IsIdentifiedBy').outV('Configuration') {where: ($matched.configuration == $currentMatch)}
.outE('IsCustomizedBy').inV('VirtualService')
.outE('IsIdentifiedBy').inV('SoftwareFacet') {where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND name='catalogue-virtual-service' AND group='org.gcube.data-catalogue')}
RETURN
DISTINCT(simplefacet) as ret
)