You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: USING_NEO4J.md
+46-11Lines changed: 46 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The Neo4j graph database Python STIX DataStore is a proof-of-concept implementat
4
4
5
5
## Limitations:
6
6
7
-
As a proof-of-concept it is mininal in its functionality.
7
+
As a proof-of-concept it has minimal functionality.
8
8
9
9
## Installing Neo4j
10
10
@@ -14,29 +14,64 @@ This will install the neo4j desktop application, which contains the neo4j browse
14
14
15
15
## Installing Neo4j python library
16
16
17
-
The python neo4j library used is py2neo, available in pypi at https://pypi.org/project/py2neo/. Note this library is no longer being supported and has reached the "end-of-life". A different implementation could be written using https://neo4j.com/docs/api/python-driver/current/.
17
+
The python neo4j library used is py2neo, available in pypi at https://pypi.org/project/py2neo/. Note this library is no longer being supported and has reached the "end-of-life". A different implementation of the DataStore could be written using https://neo4j.com/docs/api/python-driver/current/.
18
18
19
19
## Implementation Details
20
20
21
21
We would like to that the folks at JHU/APL for their implementation of [STIX2NEO4J.py](https://github.com/opencybersecurityalliance/oca-iob/tree/main/STIX2NEO4J%20Converter), which this code is based on.
22
+
22
23
Only the DataSink (for storing STIX data) part of the DataStore object has been implemented. The DataSource part is implemented as a stub. However, the graph database can be queried using the neo4j cypher langauge within
23
24
the neo4j browser
24
25
25
-
The main concept behind any graphs are nodes and edges. STIX data is similar as it contains relationship objects (SROs) and node objects (SDOs, SCOs and SMOs). The division of data in STIX was a natural fit
26
+
The main concept behind any graphs are nodes and edges. STIX data is similar as it contains relationship objects (SROs) and node objects (SDOs, SCOs and SMOs). The division of data in STIX is a natural fit
26
27
into the Neo4j model. Additional edges are provided by STIX embedded relationships, which are expressed as properties in node objects.
27
28
28
-
The order in which STIX objects are added to the graph database is arbitrary. Therefore, when an SRO or embedded relationship is added to the database, the nodes that it connects may not exist. Therefore, whenever a node is
29
-
added to the database, the unconnected relationships must be reviewed to determine if both nodes of those relationships can now be represented using an edge in the graph database. Note that unless both the source and target nodes are added,
30
-
the relationship will not added either. How to address this issue has not been determined.
29
+
The order in which STIX objects are added to the graph database is arbitrary. Therefore, when an SRO or embedded relationship is added via the DataStore, the nodes that it connects may not be present in the database, so the relationship is not added to the database, but remembered by the DataStore code as an unconnected relationship. Whenever a new node is
30
+
added to the database, the unconnected relationships must be reviewed to determine if both nodes of a relationship can now be represented using an edge in the graph database.
31
+
32
+
Note that unless both the source and target nodes are eventually added,
33
+
the relationship will not be added either.
34
+
How to address this issue in the implementation has not been determined.
31
35
32
36
## Demonstrating a neo4j database for STIX
33
37
34
-
Open the neo4j desktop app create a new project named STIX
38
+
Open the neo4j desktop app create a new project named STIX.
Clicking left on a node, gives you a choice of adding all related nodes and edges, removing the node and its edges from the display, or locking the node position.
0 commit comments