diff --git a/modules/Database/Arangojs.js b/modules/Database/Arangojs.js index f71115a76..2b113bd0e 100644 --- a/modules/Database/Arangojs.js +++ b/modules/Database/Arangojs.js @@ -231,23 +231,26 @@ class ArangoJS { if (startVertex === undefined || startVertex._key === undefined) { return []; } - const queryString = `FOR vertex, edge, path - IN 1 .. ${depth} - OUTBOUND 'ot_vertices/${startVertex._key}' - ot_edges - OPTIONS {bfs: false, uniqueVertices: 'path'} - FILTER edge.edge_type != 'IDENTIFIES' - AND edge.edge_type != 'IDENTIFIED_BY' - AND edge._to != 'ot_vertices/Actor' - AND edge._to != 'ot_vertices/Product' - AND edge._to != 'ot_vertices/Location' - AND edge._to != 'ot_vertices/Transport' - AND edge._to != 'ot_vertices/Transformation' - AND edge._to != 'ot_vertices/Observation' - AND edge._to != 'ot_vertices/Ownership' - AND vertex.vertex_type != 'CLASS' - AND vertex.vertex_type != 'IDENTIFIER' - RETURN path`; + const queryString = `let vertices = (FOR v, e, p IN 0..${depth} OUTBOUND 'ot_vertices/${startVertex._key}' ot_edges + OPTIONS { + bfs: true, + uniqueVertices: 'global', + uniqueEdges: 'path' + } + FILTER p.vertices[*].vertex_type ALL != 'CLASS' + FILTER p.edges[*].edge_type ALL != 'IDENTIFIES' + RETURN v) + + let edges = (FOR v, e, p IN 0..${depth} OUTBOUND 'ot_vertices/${startVertex._key}' ot_edges + OPTIONS { + bfs: true, + uniqueVertices: 'global', + uniqueEdges: 'path' + } + FILTER p.vertices[*].vertex_type ALL != 'CLASS' + FILTER p.edges[*].edge_type ALL != 'IDENTIFIES' + RETURN e) + RETURN {vertices, edges}`; const rawGraph = await this.runQuery(queryString); diff --git a/package-lock.json b/package-lock.json index bfc88c7d2..72bb5d61b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "2.0.50", + "version": "2.0.51", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -12451,7 +12451,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -21828,7 +21828,7 @@ }, "jsonfile": { "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { "graceful-fs": "4.1.11" diff --git a/package.json b/package.json index 461d46ac6..bcc0b48dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "2.0.50", + "version": "2.0.51", "description": "OriginTrail node", "main": ".eslintrc.js", "config": {