This repository enables an import from the Object-Centric Event Data (OCED) format produced by Konekti into the Event Knowledge Graph (EKG). For this, we use a python script that can automatically read the JSON files produced by Konekti and import the events, objects and the relationships in between. Currently, it is not (yet) supported that the state of an object may change.
The code assumes that Neo4j is installed.
Install Neo4j:
- Use the Neo4j Desktop (recommended), or
- Neo4j Community Server
PromG should be installed as a Python package using pip
pip install promg==2.2.1
.
The source code for PromG can be found PromG Core Github repository.
-
Create database or connect to a database.
Click here for step-by-step instructions
- Select
+Add
(Top right corner) - Choose Local DBMS or Remote Connection with ❗ version 5.9.
- Follow the prompted steps (the default password we assume is 12345678)
- Select
-
Configure the database settings (only do this step when you created a local database)
-
Install APOC:
Neo4j APOC Core library
(see https://neo4j.com/labs/apoc/)Click here for step-by-step instructions
- Select the database in Neo4j desktop
- On the right, click on the
plugins
tab > Open theAPOC
section > Click theinstall
button - Wait until a green check mark shows up next to
APOC
- that means it's good to go!
-
-
Install APOC:
Neo4j APOC Extended library
Click here for step-by-step instructions
- Download the appropriate release (same version numbers as your Neo4j version)
- Look for the release that matches the version number of your Neo4j Database.
- Download the file
apoc-[your neo4j version]-extended.jar
- Locate the
plugins
folder of your database:
Select the Neo4j Server in Neo4j Desktop > Click the three dots > SelectOpen Folder
> SelectPlugins
- Put
apoc-[your neo4j version]-extended.jar
into theplugins
folder of your database - Restart the server (database)
- Download the appropriate release (same version numbers as your Neo4j version)
-
Configure extra settings using the configuration file
$NEO4J_HOME/conf/apoc.conf
Click here for step-by-step instructions
- Locate the
conf
folder of your database
Select the Neo4j Server in Neo4j Desktop > Click the three dots > SelectOpen Folder
> SelectConf
- Create the file
apoc.conf
- Add the following line to
apoc.conf
:apoc.import.file.enabled=true
.
- Locate the
-
Connect to the Neo4j server
Click here for step-by-step instructions
- Select the database in Neo4j desktop
- Click the
Connect
button - Wait until a textbox
• active
is shown - that means it's good to go!
-
Save the data sets
eventstore.json
andsecurebank_eventstore.json
in the folder\data
. The datasets can be found in the release. The dataset can be set on line 8 and 9 ofmain.py
-
Create and store the configuration file
config.yaml
in the root directoryClick here for example
Create aconfig.yaml
fileconfig.yaml
file and store in the root directory. The file should be formatted as follows:# Database Credentials and Information db_name: "neo4j" uri: "bolt://localhost:7687" user: "neo4j" password: "12345678" # Dataset information dataset_name: "KonektiEventStream" semantic_header_path: "" dataset_description_path: "" use_sample: false # Import settings verbose: false batch_size: 25000 use_preprocessed_files: false
NOTES
- Set the URI in
config.yaml
to the URI of your server. Default value isbolt://localhost:7687
. - Set the password in
config.yaml
to the password of your server. Default value is12345678
.
- Set the URI in
-
Install PromG in Python.
PromG should be installed as a Python package using pip
pip install promg==2.2.1
. -
run
main.py
This file is a test dataset created from scratch by Konekti. The underlying relationship diagram is shown below.
The import takes around 3.95 seconds and results in a graph database with the following characteristics.
Number of nodes = 26,808
(:Event) Nodes |
(:Entity) Nodes |
(:Activity) Nodes |
---|---|---|
13,581 | 13,208 | 19 |
Number of relationships = 40,475
(:CORR) Relationships |
(:OBSERVED) Relationships |
(:REL) Relationships |
---|---|---|
13,581 | 13,581 | 13,313 |
This file is an adaptation of the BPIC17 dataset. The adapation has been done by Konekti.
The import takes around 44.71 seconds (4.2 minutes) and results in a graph database with the following characteristics.
Number of nodes = 593,008
(:Event) Nodes |
(:Entity) Nodes |
(:Activity) Nodes |
---|---|---|
432,968 | 160,023 | 17 |
Number of relationships = 991,683
(:CORR) Relationships |
(:OBSERVED) Relationships |
(:REL) Relationships |
---|---|---|
432,968 | 432,968 | 125,747 |
If you're getting stuck (or you have questions), feel free to reach out to me at a.j.e.swevels@tue.nl.