@@ -232,11 +232,11 @@ def put(payload):
232
232
233
233
# add or replace CVE node
234
234
cve_node_replace_script_template = """\
235
- cve_v=g.V().has('cve_id',cve_id).tryNext().orElseGet{\
235
+ cve_v=g.V().has('cve_id',cve_id).has('cecosystem', ecosystem). tryNext().orElseGet{\
236
236
graph.addVertex(label, 'CVE',\
237
237
'vertex_label', 'CVE',\
238
238
'cve_id', cve_id)};\
239
- cve_v.property('ecosystem ', ecosystem);\
239
+ cve_v.property('cecosystem ', ecosystem);\
240
240
cve_v.property('description', description);\
241
241
cve_v.property('cvss_v2', cvss_v2);\
242
242
cve_v.property('modified_date', modified_date);\
@@ -249,7 +249,7 @@ def put(payload):
249
249
250
250
# add edge between CVE node and Version node if it does not exist previously
251
251
add_affected_edge_script_template = """\
252
- cve_v=g.V().has('cve_id',cve_id).next();\
252
+ cve_v=g.V().has('cve_id',cve_id).has('cecosystem', '{ecosystem}'). next();\
253
253
version_v=g.V().has('pecosystem','{ecosystem}')\
254
254
.has('pname','{name}')\
255
255
.has('version','{version}');\
@@ -270,7 +270,7 @@ def put(payload):
270
270
# get CVEs for ecosystem
271
271
cve_nodes_for_ecosystem_script_template = """\
272
272
g.V().has("vertex_label", "CVE")\
273
- .has("ecosystem ",ecosystem)\
273
+ .has("cecosystem ",ecosystem)\
274
274
.values("cve_id")\
275
275
.dedup();\
276
276
"""
0 commit comments