Fixing tests and match queries

This commit is contained in:
luca.frosini 2023-11-27 17:44:15 +01:00
parent 0812a0c94c
commit 8af757f3db
30 changed files with 222 additions and 126 deletions

View File

@ -217,7 +217,7 @@ public abstract class JsonQueryERElement {
}
public StringBuffer createQuery(StringBuffer stringBuffer) throws SchemaNotFoundException, InvalidQueryException, SchemaException, ResourceRegistryException {
return createTraversalQuery(stringBuffer);
return createMatchQuery(stringBuffer);
}
public abstract StringBuffer createTraversalQuery(StringBuffer stringBuffer) throws SchemaNotFoundException, InvalidQueryException, SchemaException, ResourceRegistryException;

View File

@ -151,6 +151,7 @@ public class JsonQueryConsistsOf extends JsonQueryRelation {
jsonQueryFacet.setBreadcrumb(childrenBreadcrumb);
jsonQueryFacet.setPosition(childrenPosition++);
jsonQueryFacet.setTraverseBack(false);
jsonQueryFacet.setDirection(Direction.IN);
newBuffer = jsonQueryFacet.createMatchQuery(newBuffer);
}
@ -161,6 +162,7 @@ public class JsonQueryConsistsOf extends JsonQueryRelation {
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
jsonQueryResource.setPosition(childrenPosition++);
jsonQueryResource.setTraverseBack(true);
jsonQueryResource.setDirection(Direction.OUT);
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
}

View File

@ -42,6 +42,36 @@ public class JsonQueryTest extends ContextTest {
return new File(resourcesDirectory, "projection-queries");
}
protected boolean compareQueries(StringBuffer createdSb, StringBuffer expectedSb) {
return compareQueries(createdSb.toString(), expectedSb.toString());
}
protected String normalizeString(String s) {
return s.replaceAll("\n{1,}", "")
.replaceAll("\r{1,}", "")
.replaceAll("\t{1,}", "")
.replaceAll("\\s{2,}", " ")
.replaceAll("\\(\\s{1,}", "(")
.replaceAll("\\s{1,}\\(", "(")
.replaceAll("\\)\\s{1,}", ")")
.replaceAll("\\s{1,}\\)", ")");
}
protected boolean compareQueries(String createdString, String expectedString) {
String created = normalizeString(createdString);
String expected = normalizeString(expectedString);
logger.debug(created);
logger.debug(expected);
return created.compareTo(expected)==0 ? true : false;
}
@Test
public void testCompares() throws Exception {
String a = "))\n\t\r ) ) ) )";
String b = "))))))";
Assert.assertTrue(compareQueries(a, b));
}
@Test
public void testJsonQueries() throws Exception {
ContextTest.setContextByName(DEVVRE);
@ -69,7 +99,7 @@ public class JsonQueryTest extends ContextTest {
logger.info("Created Query from JSON: {}", createdStringBuffer.toString());
StringBuffer expectedStringBuffer = new StringBuffer();
File expectedQueryFile = new File(queriesDirectory, jsonQueryFile.getName().replace("json", "oquery"));
File expectedQueryFile = new File(queriesDirectory, jsonQueryFile.getName().replace("json", "match.oquery"));
try(BufferedReader br = new BufferedReader(new FileReader(expectedQueryFile))) {
for(String line; (line = br.readLine()) != null; ) {
expectedStringBuffer.append(line);
@ -77,8 +107,7 @@ public class JsonQueryTest extends ContextTest {
}
logger.info("Expected Query from JSON: {}", expectedStringBuffer.toString());
Assert.assertTrue(createdStringBuffer.toString().compareTo(expectedStringBuffer.toString())==0);
Assert.assertTrue(compareQueries(createdStringBuffer, expectedStringBuffer));
String result = jsonQuery.query();
logger.info("Result : {}", result);
@ -88,7 +117,7 @@ public class JsonQueryTest extends ContextTest {
@Test
public void testSingleCreateQuery() throws Exception {
File queriesDirectory = getQueriesDirectory();
File jsonQueryFile = new File(queriesDirectory, "query10.json");
File jsonQueryFile = new File(queriesDirectory, "query9.json");
ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(jsonQueryFile);
logger.info("Going to test the following JSON query {}", jsonNode.toString());
@ -100,7 +129,7 @@ public class JsonQueryTest extends ContextTest {
logger.info("Created Query from JSON: {}", createdStringBuffer.toString());
StringBuffer expectedStringBuffer = new StringBuffer();
File expectedQueryFile = new File(queriesDirectory, jsonQueryFile.getName().replace("json", "oquery"));
File expectedQueryFile = new File(queriesDirectory, jsonQueryFile.getName().replace("json", "match.oquery"));
try(BufferedReader br = new BufferedReader(new FileReader(expectedQueryFile))) {
for(String line; (line = br.readLine()) != null; ) {
expectedStringBuffer.append(line);
@ -108,8 +137,7 @@ public class JsonQueryTest extends ContextTest {
}
logger.info("Expected Query from JSON: {}", expectedStringBuffer.toString());
Assert.assertTrue(createdStringBuffer.toString().compareTo(expectedStringBuffer.toString())==0);
Assert.assertTrue(compareQueries(createdStringBuffer, expectedStringBuffer));
String result = jsonQuery.query();
logger.info("Result : {}", result);
@ -220,7 +248,7 @@ public class JsonQueryTest extends ContextTest {
logger.info("Expected Query from JSON: {}", expectedStringBuffer.toString());
Assert.assertTrue(createdStringBuffer.toString().replaceAll("\n", "").compareTo(expectedStringBuffer.toString().replaceAll("\n", ""))==0);
Assert.assertTrue(compareQueries(createdStringBuffer, expectedStringBuffer));
// String result = jsonQuery.query();
// logger.info("Result : {}", result);
@ -257,8 +285,7 @@ public class JsonQueryTest extends ContextTest {
}
logger.info("Expected Query from JSON: {}", expectedStringBuffer.toString());
Assert.assertTrue(createdStringBuffer.toString().replaceAll("\n", "").compareTo(expectedStringBuffer.toString().replaceAll("\n", ""))==0);
Assert.assertTrue(compareQueries(createdStringBuffer, expectedStringBuffer));
//String result = jsonQuery.query();
//logger.info("Result : {}", result);

View File

@ -1,10 +1,17 @@
SELECT EXPAND(ret) 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')}
RETURN
DISTINCT(eservice) as ret
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"))}
.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"))}
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby01 == $currentMatch)}
.outV('EService') { where: ($matched.eservice0 == $currentMatch)}
RETURN
DISTINCT(eservice0) as ret
)

View File

@ -1 +0,0 @@
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"

View File

@ -1,15 +1,27 @@
SELECT EXPAND(ret) 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') {where: (id='bd89a311-780d-4efe-93e5-08281e53bce7')}
.outV('HostingNode') {where: (id='44fac329-eed5-4f18-90ba-a54d5aad316e')}
RETURN
DISTINCT(eservice) as ret
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"))}
.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"))}
.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"))}
.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"))}
.inE('ConsistsOf') { where: ($matched.consistsof03 == $currentMatch)}
.outV('EService') { where: ($matched.eservice0 == $currentMatch)}
RETURN
DISTINCT(eservice0) as ret
)

View File

@ -1 +0,0 @@
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 HostingNode 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 @class INSTANCEOF "EService"

View File

@ -1,15 +1,31 @@
SELECT EXPAND(ret) 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='ready')}
.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: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND vendor='GenuineIntel')}
RETURN
DISTINCT(eservice) as ret
MATCH
{class: EService, as: eservice0, where: ($currentMatch['@class'] INSTANCEOF 'EService')}
.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"))}
.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"))}
.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"))}
.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"))}
.inE('ConsistsOf') { where: ($matched.consistsof03 == $currentMatch)}
.outV('EService') { where: ($matched.eservice0 == $currentMatch)}
RETURN
DISTINCT(eservice0) as ret
)

View File

@ -1 +0,0 @@
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 ( TRAVERSE outE("Activates") FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM CPUFacet WHERE vendor = "GenuineIntel"))))))) 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 @class INSTANCEOF "EService"

View File

@ -1,7 +1,15 @@
DA FIXARE
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')}
RETURN
DISTINCT(statefacet) as ret
MATCH
{class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))}
DOVREBBE ESSERE consistsof00 e tutto di conseguenza
.outE('ConsistsOf') { as: consistsof0, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
.outV('EService') { as: eservice00, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (eservice00.id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))}
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
MANCA -> .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
RETURN
DISTINCT(statefacet0) as ret
)

View File

@ -1 +0,0 @@
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM EService WHERE id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))) WHERE value = "down" AND @class INSTANCEOF "StateFacet"

View File

@ -1,20 +1,12 @@
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
MATCH
{class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))}
DOVREBBE ESSERE consistsof00
.outE('ConsistsOf') { as: consistsof0, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
.outV('EService') { as: eservice00, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (((eservice00.id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND eservice00.metadata.createdBy <> "luca.frosini") OR (eservice00.id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND eservice00.metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"))))}
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
MANCA -> .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
RETURN
DISTINCT(statefacet0) as ret
)

View File

@ -1 +0,0 @@
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

@ -1,17 +1,31 @@
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
MATCH
{class: EService, as: eservice0, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (eservice0.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"))}
.outE('ConsistsOf') { as: consistsof0000, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
.inV('CPUFacet') { as: cpufacet00000, where: (($currentMatch['@class'] INSTANCEOF 'CPUFacet') AND (cpufacet00000.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"))}
.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"))}
.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"))}
.inE('ConsistsOf') { where: ($matched.consistsof03 == $currentMatch)}
.outV('EService') { where: ($matched.eservice0 == $currentMatch)}
RETURN
DISTINCT(eservice0) as ret
)

View File

@ -1 +0,0 @@
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

@ -1,20 +1,14 @@
DA FIXARE
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
MATCH
{class: StateFacet, as: statefacet0, where: ($currentMatch['@class'] INSTANCEOF 'StateFacet')}
DOVREBBE ESSERE consistsof00
.outE('ConsistsOf') { as: consistsof0, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
.outV('EService') { as: eservice00, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (((eservice00.id = "93995af0-4f95-4816-a53e-3e1bc27ef475" AND eservice00.metadata.createdBy <> "luca.frosini") OR (eservice00.id = "bd4402a0-2b72-41c5-a970-321343649e7d" AND eservice00.metadata.createdBy = "DataTransfer:data-transfer-service:smartexecutor1.dev.int.d4science.net_80"))))}
MANCA -> .inE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
MANCA -> .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
RETURN
DISTINCT(statefacet0) as ret
)

View File

@ -1 +0,0 @@
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

@ -1,9 +1,23 @@
DA FIXARE
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
MATCH
{class: CallsFor, as: callsfor0, where: ($currentMatch['@class'] INSTANCEOF 'CallsFor')}
.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"))}
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby000 == $currentMatch)}
.outV('VirtualService') { where: ($matched.virtualservice00 == $currentMatch)}
MANCA -> .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"))}
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby010 == $currentMatch)}
.outV('EService') { where: ($matched.eservice01 == $currentMatch)}
MANCA -> .outE('CallsFor') { where: ($matched.callsfor0 == $currentMatch)}
RETURN
DISTINCT(callsfor0) as ret
)

View File

@ -1 +0,0 @@
SELECT FROM ( TRAVERSE inE("CallsFor") FROM ( TRAVERSE outV("VirtualService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE inV("VirtualService") FROM ( TRAVERSE outE("CallsFor") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM SoftwareFacet WHERE group = "org.gcube.data-catalogue" AND name = "gcat"))))))) WHERE group = "org.gcube.data-catalogue" AND name = "catalogue-virtual-service")))) WHERE @class INSTANCEOF "CallsFor"

View File

@ -1,11 +1,30 @@
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
MATCH
{class: SimpleFacet, as: simplefacet0, where: ($currentMatch['@class'] INSTANCEOF 'SimpleFacet')}
DOVREBBE ESSERE consistsof00 e tutto di conseguenza
.outE('ConsistsOf') { as: consistsof0, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
.outV('Configuration') { as: configuration00, where: ($currentMatch['@class'] INSTANCEOF 'Configuration')}
.inE('IsCustomizedBy') { as: iscustomizedby000, where: ($currentMatch['@class'] INSTANCEOF 'IsCustomizedBy')}
.outV('VirtualService') { as: virtualservice0000, where: ($currentMatch['@class'] INSTANCEOF 'VirtualService')}
.outE('IsIdentifiedBy') { as: isidentifiedby00000, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')}
.inV('SoftwareFacet') { as: softwarefacet000000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet000000.group = "org.gcube.data-catalogue" AND softwarefacet000000.name = "catalogue-virtual-service"))}
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby00000 == $currentMatch)}
.outV('VirtualService') { where: ($matched.virtualservice0000 == $currentMatch)}
.outE('IsCustomizedBy') { where: ($matched.iscustomizedby000 == $currentMatch)}
.inV('Configuration') { where: ($matched.configuration00 == $currentMatch)}
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
MANCA -> .inV('SimpleFacet') { where: ($matched.simplefacet0 == $currentMatch)}
.outE('IsIdentifiedBy') { as: isidentifiedby001, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')}
.inV('IdentifierFacet') { as: identifierfacet0010, where: (($currentMatch['@class'] INSTANCEOF 'IdentifierFacet') AND (identifierfacet0010.value = "gcat-configuration"))}
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby001 == $currentMatch)}
.outV('Configuration') { where: ($matched.configuration00 == $currentMatch)}
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
MANCA -> .inV('SimpleFacet') { where: ($matched.simplefacet0 == $currentMatch)}
RETURN
DISTINCT(simplefacet0) as ret
)

View File

@ -1 +0,0 @@
SELECT FROM ( TRAVERSE inV("SimpleFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("Configuration") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("IdentifierFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE inV("Configuration") FROM ( TRAVERSE outE("IsCustomizedBy") FROM ( TRAVERSE outV("VirtualService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM SoftwareFacet WHERE group = "org.gcube.data-catalogue" AND name = "catalogue-virtual-service"))))))) WHERE value = "gcat-configuration"))))) WHERE @class INSTANCEOF "SimpleFacet"