JSON queries has been switched to match queries
This commit is contained in:
parent
8af757f3db
commit
c5531d7c54
|
@ -96,16 +96,30 @@ public class JsonQueryFacet extends JsonQueryEntity {
|
||||||
throws SchemaException, ResourceRegistryException {
|
throws SchemaException, ResourceRegistryException {
|
||||||
StringBuffer newBuffer = new StringBuffer();
|
StringBuffer newBuffer = new StringBuffer();
|
||||||
|
|
||||||
|
boolean traverseBack = this.traverseBack;
|
||||||
if(jsonNode.has(_SOURCE)) {
|
if(jsonNode.has(_SOURCE)) {
|
||||||
if(!entryPoint) {
|
if(!entryPoint) {
|
||||||
throw new InvalidQueryException(_SOURCE + " property cannot be used in a facet if it is not the entry object");
|
throw new InvalidQueryException(_SOURCE + " property cannot be used in a facet if it is not the entry object");
|
||||||
}
|
}
|
||||||
|
traverseBack = true;
|
||||||
|
|
||||||
JsonNode consistsOfNode = jsonNode.get(_SOURCE);
|
JsonNode consistsOfNode = jsonNode.get(_SOURCE);
|
||||||
JsonQueryConsistsOf jsonQueryConsistsOf = new JsonQueryConsistsOf(consistsOfNode);
|
JsonQueryConsistsOf jsonQueryConsistsOf = new JsonQueryConsistsOf(consistsOfNode);
|
||||||
jsonQueryConsistsOf.setTraverseBack(traverseBack);
|
jsonQueryConsistsOf.setTraverseBack(traverseBack);
|
||||||
jsonQueryConsistsOf.setDirection(Direction.OUT);
|
jsonQueryConsistsOf.setDirection(Direction.IN);
|
||||||
|
jsonQueryConsistsOf.setBreadcrumb(childrenBreadcrumb);
|
||||||
newBuffer = jsonQueryConsistsOf.createMatchQuery(newBuffer);
|
newBuffer = jsonQueryConsistsOf.createMatchQuery(newBuffer);
|
||||||
|
|
||||||
|
newBuffer.append("\n\t");
|
||||||
|
newBuffer.append(".inV('");
|
||||||
|
newBuffer.append(type);
|
||||||
|
newBuffer.append("')");
|
||||||
|
newBuffer.append(" { where: ($matched.");
|
||||||
|
newBuffer.append(alias);
|
||||||
|
newBuffer.append(" == $currentMatch)}");
|
||||||
|
|
||||||
|
traverseBack = false;
|
||||||
|
|
||||||
/* Need to substract 1 from size otherwise
|
/* Need to substract 1 from size otherwise
|
||||||
* it add WHERE at the end because _in
|
* it add WHERE at the end because _in
|
||||||
* is not a property to be used for a WHERE compare
|
* is not a property to be used for a WHERE compare
|
||||||
|
@ -153,15 +167,15 @@ public class JsonQueryFacet extends JsonQueryEntity {
|
||||||
|
|
||||||
buffer.append(newBuffer);
|
buffer.append(newBuffer);
|
||||||
|
|
||||||
if(traverseBack) {
|
// if(traverseBack) {
|
||||||
buffer.append("\n\t");
|
// buffer.append("\n\t");
|
||||||
buffer.append(".outV('");
|
// buffer.append(".inV('");
|
||||||
buffer.append(type);
|
// buffer.append(type);
|
||||||
buffer.append("')");
|
// buffer.append("')");
|
||||||
buffer.append(" { where: ($matched.");
|
// buffer.append(" { where: ($matched.");
|
||||||
buffer.append(alias);
|
// buffer.append(alias);
|
||||||
buffer.append(" == $currentMatch)}");
|
// buffer.append(" == $currentMatch)}");
|
||||||
}
|
// }
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
|
|
|
@ -130,10 +130,14 @@ public class JsonQueryResource extends JsonQueryEntity {
|
||||||
consistsOfSize = consistsOfArray.size();
|
consistsOfSize = consistsOfArray.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int total = consistsOfSize;
|
||||||
|
|
||||||
ArrayNode isRelatedToArray = (ArrayNode) jsonNode.get(Resource.IS_RELATED_TO_PROPERTY);
|
ArrayNode isRelatedToArray = (ArrayNode) jsonNode.get(Resource.IS_RELATED_TO_PROPERTY);
|
||||||
if(isRelatedToArray!=null && isRelatedToArray.size()>0) {
|
if(isRelatedToArray!=null && isRelatedToArray.size()>0) {
|
||||||
--size;
|
--size;
|
||||||
isRelatedToSize = isRelatedToArray.size();
|
isRelatedToSize = isRelatedToArray.size();
|
||||||
|
total += isRelatedToSize;
|
||||||
|
|
||||||
for(int i=0; i<isRelatedToSize; i++) {
|
for(int i=0; i<isRelatedToSize; i++) {
|
||||||
JsonNode isRelatedToJsonNode = isRelatedToArray.get(i);
|
JsonNode isRelatedToJsonNode = isRelatedToArray.get(i);
|
||||||
JsonQueryIsRelatedTo jsonQueryIsRelatedTo = new JsonQueryIsRelatedTo(isRelatedToJsonNode);
|
JsonQueryIsRelatedTo jsonQueryIsRelatedTo = new JsonQueryIsRelatedTo(isRelatedToJsonNode);
|
||||||
|
@ -150,7 +154,6 @@ public class JsonQueryResource extends JsonQueryEntity {
|
||||||
jsonQueryIsRelatedTo.setTraverseBack(traverseBack);
|
jsonQueryIsRelatedTo.setTraverseBack(traverseBack);
|
||||||
|
|
||||||
newBuffer = jsonQueryIsRelatedTo.createMatchQuery(newBuffer);
|
newBuffer = jsonQueryIsRelatedTo.createMatchQuery(newBuffer);
|
||||||
|
|
||||||
|
|
||||||
if(traverseBack) {
|
if(traverseBack) {
|
||||||
newBuffer.append("\n\t.");
|
newBuffer.append("\n\t.");
|
||||||
|
@ -161,7 +164,8 @@ public class JsonQueryResource extends JsonQueryEntity {
|
||||||
newBuffer.append("{ where: ($matched.");
|
newBuffer.append("{ where: ($matched.");
|
||||||
newBuffer.append(getAlias(true));
|
newBuffer.append(getAlias(true));
|
||||||
newBuffer.append(" == $currentMatch)}");
|
newBuffer.append(" == $currentMatch)}");
|
||||||
if(i<(isRelatedToSize-1) || consistsOfSize>0) {
|
|
||||||
|
if(entryPoint && i<(total-1)) {
|
||||||
newBuffer.append("\n");
|
newBuffer.append("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,14 +196,13 @@ public class JsonQueryResource extends JsonQueryEntity {
|
||||||
newBuffer.append(" { where: ($matched.");
|
newBuffer.append(" { where: ($matched.");
|
||||||
newBuffer.append(getAlias(true));
|
newBuffer.append(getAlias(true));
|
||||||
newBuffer.append(" == $currentMatch)}");
|
newBuffer.append(" == $currentMatch)}");
|
||||||
if(i<(consistsOfSize-1)) {
|
if(entryPoint && i<(consistsOfSize-1)) {
|
||||||
newBuffer.append("\n");
|
newBuffer.append("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
if(!entryPoint) {
|
if(!entryPoint) {
|
||||||
|
|
|
@ -143,6 +143,8 @@ public class JsonQueryConsistsOf extends JsonQueryRelation {
|
||||||
throws SchemaException, ResourceRegistryException {
|
throws SchemaException, ResourceRegistryException {
|
||||||
int childrenPosition = 0;
|
int childrenPosition = 0;
|
||||||
|
|
||||||
|
boolean traverseBack = this.traverseBack;
|
||||||
|
|
||||||
StringBuffer newBuffer = new StringBuffer();
|
StringBuffer newBuffer = new StringBuffer();
|
||||||
if(jsonNode.has(ConsistsOf.TARGET_PROPERTY)) {
|
if(jsonNode.has(ConsistsOf.TARGET_PROPERTY)) {
|
||||||
--size;
|
--size;
|
||||||
|
@ -150,9 +152,22 @@ public class JsonQueryConsistsOf extends JsonQueryRelation {
|
||||||
JsonQueryFacet jsonQueryFacet = new JsonQueryFacet(facetJsonNode);
|
JsonQueryFacet jsonQueryFacet = new JsonQueryFacet(facetJsonNode);
|
||||||
jsonQueryFacet.setBreadcrumb(childrenBreadcrumb);
|
jsonQueryFacet.setBreadcrumb(childrenBreadcrumb);
|
||||||
jsonQueryFacet.setPosition(childrenPosition++);
|
jsonQueryFacet.setPosition(childrenPosition++);
|
||||||
jsonQueryFacet.setTraverseBack(false);
|
jsonQueryFacet.setTraverseBack(true);
|
||||||
jsonQueryFacet.setDirection(Direction.IN);
|
Direction direction = Direction.IN;
|
||||||
|
jsonQueryFacet.setDirection(direction);
|
||||||
newBuffer = jsonQueryFacet.createMatchQuery(newBuffer);
|
newBuffer = jsonQueryFacet.createMatchQuery(newBuffer);
|
||||||
|
|
||||||
|
newBuffer.append("\n\t");
|
||||||
|
newBuffer.append(".");
|
||||||
|
newBuffer.append(direction.name().toLowerCase());
|
||||||
|
newBuffer.append("E('");
|
||||||
|
newBuffer.append(type);
|
||||||
|
newBuffer.append("') ");
|
||||||
|
newBuffer.append(" { where: ($matched.");
|
||||||
|
newBuffer.append(getAlias(true));
|
||||||
|
newBuffer.append(" == $currentMatch)}");
|
||||||
|
|
||||||
|
traverseBack = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jsonNode.has(ConsistsOf.SOURCE_PROPERTY)) {
|
if(jsonNode.has(ConsistsOf.SOURCE_PROPERTY)) {
|
||||||
|
@ -162,8 +177,21 @@ public class JsonQueryConsistsOf extends JsonQueryRelation {
|
||||||
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
|
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
|
||||||
jsonQueryResource.setPosition(childrenPosition++);
|
jsonQueryResource.setPosition(childrenPosition++);
|
||||||
jsonQueryResource.setTraverseBack(true);
|
jsonQueryResource.setTraverseBack(true);
|
||||||
jsonQueryResource.setDirection(Direction.OUT);
|
Direction direction = Direction.OUT;
|
||||||
|
jsonQueryResource.setDirection(direction);
|
||||||
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
|
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
|
||||||
|
|
||||||
|
newBuffer.append("\n\t");
|
||||||
|
newBuffer.append(".");
|
||||||
|
newBuffer.append(direction.name().toLowerCase());
|
||||||
|
newBuffer.append("E('");
|
||||||
|
newBuffer.append(type);
|
||||||
|
newBuffer.append("') ");
|
||||||
|
newBuffer.append(" { where: ($matched.");
|
||||||
|
newBuffer.append(getAlias(true));
|
||||||
|
newBuffer.append(" == $currentMatch)}");
|
||||||
|
|
||||||
|
traverseBack = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
|
@ -214,27 +214,56 @@ public class JsonQueryIsRelatedTo extends JsonQueryRelation {
|
||||||
|
|
||||||
int childrenPosition = 0;
|
int childrenPosition = 0;
|
||||||
|
|
||||||
|
boolean traverseBack = this.traverseBack;
|
||||||
|
|
||||||
StringBuffer newBuffer = new StringBuffer();
|
StringBuffer newBuffer = new StringBuffer();
|
||||||
if(jsonNode.has(ConsistsOf.TARGET_PROPERTY)) {
|
if(jsonNode.has(ConsistsOf.TARGET_PROPERTY)) {
|
||||||
--size;
|
--size;
|
||||||
JsonNode targetJsonNode = jsonNode.get(IsRelatedTo.TARGET_PROPERTY);
|
JsonNode targetJsonNode = jsonNode.get(IsRelatedTo.TARGET_PROPERTY);
|
||||||
JsonQueryResource jsonQueryResource = new JsonQueryResource(targetJsonNode);
|
JsonQueryResource jsonQueryResource = new JsonQueryResource(targetJsonNode);
|
||||||
jsonQueryResource.setDirection(Direction.IN);
|
Direction direction = Direction.IN;
|
||||||
|
jsonQueryResource.setDirection(direction);
|
||||||
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
|
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
|
||||||
jsonQueryResource.setPosition(childrenPosition++);
|
jsonQueryResource.setPosition(childrenPosition++);
|
||||||
jsonQueryResource.setTraverseBack(true);
|
jsonQueryResource.setTraverseBack(true);
|
||||||
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
|
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
|
||||||
|
|
||||||
|
newBuffer.append("\n\t");
|
||||||
|
newBuffer.append(".");
|
||||||
|
newBuffer.append(direction.name().toLowerCase());
|
||||||
|
newBuffer.append("E('");
|
||||||
|
newBuffer.append(type);
|
||||||
|
newBuffer.append("') ");
|
||||||
|
newBuffer.append(" { where: ($matched.");
|
||||||
|
newBuffer.append(getAlias(true));
|
||||||
|
newBuffer.append(" == $currentMatch)}");
|
||||||
|
|
||||||
|
traverseBack = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jsonNode.has(ConsistsOf.SOURCE_PROPERTY)) {
|
if(jsonNode.has(ConsistsOf.SOURCE_PROPERTY)) {
|
||||||
--size;
|
--size;
|
||||||
JsonNode sourceJsonNode = jsonNode.get(IsRelatedTo.SOURCE_PROPERTY);
|
JsonNode sourceJsonNode = jsonNode.get(IsRelatedTo.SOURCE_PROPERTY);
|
||||||
JsonQueryResource jsonQueryResource = new JsonQueryResource(sourceJsonNode);
|
JsonQueryResource jsonQueryResource = new JsonQueryResource(sourceJsonNode);
|
||||||
jsonQueryResource.setDirection(Direction.OUT);
|
Direction direction = Direction.OUT;
|
||||||
|
jsonQueryResource.setDirection(direction);
|
||||||
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
|
jsonQueryResource.setBreadcrumb(childrenBreadcrumb);
|
||||||
jsonQueryResource.setPosition(childrenPosition++);
|
jsonQueryResource.setPosition(childrenPosition++);
|
||||||
jsonQueryResource.setTraverseBack(true);
|
jsonQueryResource.setTraverseBack(true);
|
||||||
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
|
newBuffer = jsonQueryResource.createMatchQuery(newBuffer);
|
||||||
|
|
||||||
|
newBuffer.append("\n\t");
|
||||||
|
newBuffer.append(".");
|
||||||
|
newBuffer.append(direction.name().toLowerCase());
|
||||||
|
newBuffer.append("E('");
|
||||||
|
newBuffer.append(type);
|
||||||
|
newBuffer.append("') ");
|
||||||
|
newBuffer.append(" { where: ($matched.");
|
||||||
|
newBuffer.append(getAlias(true));
|
||||||
|
newBuffer.append(" == $currentMatch)}");
|
||||||
|
|
||||||
|
traverseBack = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
@ -288,7 +317,7 @@ public class JsonQueryIsRelatedTo extends JsonQueryRelation {
|
||||||
buffer.append(type);
|
buffer.append(type);
|
||||||
buffer.append("') ");
|
buffer.append("') ");
|
||||||
buffer.append(" { where: ($matched.");
|
buffer.append(" { where: ($matched.");
|
||||||
buffer.append(alias);
|
buffer.append(getAlias(true));
|
||||||
buffer.append(" == $currentMatch)}");
|
buffer.append(" == $currentMatch)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class JsonQueryTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonQueries() throws Exception {
|
public void testQueries() throws Exception {
|
||||||
ContextTest.setContextByName(DEVVRE);
|
ContextTest.setContextByName(DEVVRE);
|
||||||
|
|
||||||
File queriesDirectory = getQueriesDirectory();
|
File queriesDirectory = getQueriesDirectory();
|
||||||
|
@ -115,9 +115,9 @@ public class JsonQueryTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSingleCreateQuery() throws Exception {
|
public void testSingleQuery() throws Exception {
|
||||||
File queriesDirectory = getQueriesDirectory();
|
File queriesDirectory = getQueriesDirectory();
|
||||||
File jsonQueryFile = new File(queriesDirectory, "query9.json");
|
File jsonQueryFile = new File(queriesDirectory, "query2.json");
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
JsonNode jsonNode = objectMapper.readTree(jsonQueryFile);
|
JsonNode jsonNode = objectMapper.readTree(jsonQueryFile);
|
||||||
logger.info("Going to test the following JSON query {}", jsonNode.toString());
|
logger.info("Going to test the following JSON query {}", jsonNode.toString());
|
||||||
|
@ -225,7 +225,7 @@ public class JsonQueryTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSingleMatchQuery() throws Exception {
|
public void testSingleProjectionQuery() throws Exception {
|
||||||
File queriesDirectory = getProjectionQueriesDirectory();
|
File queriesDirectory = getProjectionQueriesDirectory();
|
||||||
File jsonQueryFile = new File(queriesDirectory, "HostingNode-query.json");
|
File jsonQueryFile = new File(queriesDirectory, "HostingNode-query.json");
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
@ -255,7 +255,7 @@ public class JsonQueryTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMatchQueries() throws Exception {
|
public void testProjectionQueries() throws Exception {
|
||||||
File queriesDirectory = getProjectionQueriesDirectory();
|
File queriesDirectory = getProjectionQueriesDirectory();
|
||||||
|
|
||||||
FilenameFilter filenameFilter = new FilenameFilter() {
|
FilenameFilter filenameFilter = new FilenameFilter() {
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
DA FIXARE
|
|
||||||
|
|
||||||
SELECT EXPAND(ret) FROM (
|
SELECT EXPAND(ret) FROM (
|
||||||
MATCH
|
MATCH
|
||||||
{class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))}
|
{class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))}
|
||||||
|
|
||||||
DOVREBBE ESSERE consistsof00 e tutto di conseguenza
|
.inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
|
||||||
.outE('ConsistsOf') { as: consistsof0, 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: eservice00, where: (($currentMatch['@class'] INSTANCEOF 'EService') AND (eservice00.id = "93995af0-4f95-4816-a53e-3e1bc27ef475"))}
|
.outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)}
|
||||||
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
|
.inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
|
||||||
MANCA -> .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
|
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
DISTINCT(statefacet0) as ret
|
DISTINCT(statefacet0) as ret
|
||||||
)
|
)
|
|
@ -2,11 +2,10 @@ SELECT EXPAND(ret) FROM (
|
||||||
MATCH
|
MATCH
|
||||||
{class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))}
|
{class: StateFacet, as: statefacet0, where: (($currentMatch['@class'] INSTANCEOF 'StateFacet') AND (statefacet0.value = "down"))}
|
||||||
|
|
||||||
DOVREBBE ESSERE consistsof00
|
.inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
|
||||||
.outE('ConsistsOf') { as: consistsof0, 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: 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"))))}
|
.outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)}
|
||||||
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
|
.inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
|
||||||
MANCA -> .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
|
|
||||||
RETURN
|
RETURN
|
||||||
DISTINCT(statefacet0) as ret
|
DISTINCT(statefacet0) as ret
|
||||||
)
|
)
|
|
@ -27,5 +27,5 @@ SELECT EXPAND(ret) FROM (
|
||||||
.outV('EService') { where: ($matched.eservice0 == $currentMatch)}
|
.outV('EService') { where: ($matched.eservice0 == $currentMatch)}
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
DISTINCT(eservice0) as ret
|
DISTINCT(eservice0) as ret
|
||||||
)
|
)
|
|
@ -1,14 +1,11 @@
|
||||||
DA FIXARE
|
|
||||||
|
|
||||||
SELECT EXPAND(ret) FROM (
|
SELECT EXPAND(ret) FROM (
|
||||||
MATCH
|
MATCH
|
||||||
{class: StateFacet, as: statefacet0, where: ($currentMatch['@class'] INSTANCEOF 'StateFacet')}
|
{class: StateFacet, as: statefacet0, where: ($currentMatch['@class'] INSTANCEOF 'StateFacet')}
|
||||||
|
|
||||||
DOVREBBE ESSERE consistsof00
|
.inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
|
||||||
.outE('ConsistsOf') { as: consistsof0, 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: 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"))))}
|
.outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)}
|
||||||
MANCA -> .inE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
|
.inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
|
||||||
MANCA -> .inV('StateFacet') { where: ($matched.statefacet0 == $currentMatch)}
|
|
||||||
RETURN
|
RETURN
|
||||||
DISTINCT(statefacet0) as ret
|
DISTINCT(statefacet0) as ret
|
||||||
)
|
)
|
|
@ -1,23 +1,21 @@
|
||||||
|
|
||||||
DA FIXARE
|
|
||||||
|
|
||||||
SELECT EXPAND(ret) FROM (
|
SELECT EXPAND(ret) FROM (
|
||||||
MATCH
|
MATCH
|
||||||
{class: CallsFor, as: callsfor0, where: ($currentMatch['@class'] INSTANCEOF 'CallsFor')}
|
{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')}
|
.inV('VirtualService') { as: virtualservice00, where: ($currentMatch['@class'] INSTANCEOF 'VirtualService')}
|
||||||
.outE('IsIdentifiedBy') { as: isidentifiedby010, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')}
|
.outE('IsIdentifiedBy') { as: isidentifiedby000, 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: softwarefacet0000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet0000.group = "org.gcube.data-catalogue" AND softwarefacet0000.name = "catalogue-virtual-service"))}
|
||||||
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby010 == $currentMatch)}
|
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby000 == $currentMatch)}
|
||||||
.outV('EService') { where: ($matched.eservice01 == $currentMatch)}
|
.outV('VirtualService') { where: ($matched.virtualservice00 == $currentMatch)}
|
||||||
MANCA -> .outE('CallsFor') { where: ($matched.callsfor0 == $currentMatch)}
|
.inE('CallsFor') { where: ($matched.callsfor0 == $currentMatch)}
|
||||||
RETURN
|
|
||||||
DISTINCT(callsfor0) as ret
|
.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)}
|
||||||
|
.outE('CallsFor') { where: ($matched.callsfor0 == $currentMatch)}
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
DISTINCT(callsfor0) as ret
|
||||||
)
|
)
|
|
@ -1,30 +1,23 @@
|
||||||
SELECT EXPAND(ret) FROM (
|
SELECT EXPAND(ret) FROM (
|
||||||
MATCH
|
MATCH
|
||||||
{class: SimpleFacet, as: simplefacet0, where: ($currentMatch['@class'] INSTANCEOF 'SimpleFacet')}
|
{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)}
|
|
||||||
|
|
||||||
|
.inE('ConsistsOf') { as: consistsof00, where: ($currentMatch['@class'] INSTANCEOF 'ConsistsOf')}
|
||||||
.outE('IsIdentifiedBy') { as: isidentifiedby001, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')}
|
.outV('Configuration') { as: configuration000, where: ($currentMatch['@class'] INSTANCEOF 'Configuration')}
|
||||||
.inV('IdentifierFacet') { as: identifierfacet0010, where: (($currentMatch['@class'] INSTANCEOF 'IdentifierFacet') AND (identifierfacet0010.value = "gcat-configuration"))}
|
.inE('IsCustomizedBy') { as: iscustomizedby0000, where: ($currentMatch['@class'] INSTANCEOF 'IsCustomizedBy')}
|
||||||
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby001 == $currentMatch)}
|
.outV('VirtualService') { as: virtualservice00000, where: ($currentMatch['@class'] INSTANCEOF 'VirtualService')}
|
||||||
.outV('Configuration') { where: ($matched.configuration00 == $currentMatch)}
|
.outE('IsIdentifiedBy') { as: isidentifiedby000000, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')}
|
||||||
MANCA -> .outE('ConsistsOf') { where: ($matched.consistsof0 == $currentMatch)}
|
.inV('SoftwareFacet') { as: softwarefacet0000000, where: (($currentMatch['@class'] INSTANCEOF 'SoftwareFacet') AND (softwarefacet0000000.group = "org.gcube.data-catalogue" AND softwarefacet0000000.name = "catalogue-virtual-service"))}
|
||||||
MANCA -> .inV('SimpleFacet') { where: ($matched.simplefacet0 == $currentMatch)}
|
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby000000 == $currentMatch)}
|
||||||
|
.outV('VirtualService') { where: ($matched.virtualservice00000 == $currentMatch)}
|
||||||
|
.outE('IsCustomizedBy') { where: ($matched.iscustomizedby0000 == $currentMatch)}
|
||||||
RETURN
|
.inV('Configuration') { where: ($matched.configuration000 == $currentMatch)}
|
||||||
DISTINCT(simplefacet0) as ret
|
.outE('IsIdentifiedBy') { as: isidentifiedby0001, where: ($currentMatch['@class'] INSTANCEOF 'IsIdentifiedBy')}
|
||||||
|
.inV('IdentifierFacet') { as: identifierfacet00010, where: (($currentMatch['@class'] INSTANCEOF 'IdentifierFacet') AND (identifierfacet00010.value = "gcat-configuration"))}
|
||||||
|
.inE('IsIdentifiedBy') { where: ($matched.isidentifiedby0001 == $currentMatch)}
|
||||||
|
.outV('Configuration') { where: ($matched.configuration000 == $currentMatch)}
|
||||||
|
.outE('ConsistsOf') { where: ($matched.consistsof00 == $currentMatch)}
|
||||||
|
.inV('SimpleFacet') { where: ($matched.simplefacet0 == $currentMatch)}
|
||||||
|
RETURN
|
||||||
|
DISTINCT(simplefacet0) as ret
|
||||||
)
|
)
|
Loading…
Reference in New Issue