updated node properties

This commit is contained in:
Lea Gütebier 2025-05-15 11:27:14 +02:00
parent 03570a30e6
commit 47abe86ba8
8 changed files with 231 additions and 135 deletions

0
docker/.gitkeep Normal file
View File

View File

@ -9,10 +9,16 @@ skinparam node {
} }
node "localhost" { node "localhost" {
file "conf" as conf
folder "input Files" as input { folder "input Files" as input {
file "xml" as xml1 collections "xml" as xml
file "xml" as xml2 collections "json" as json
collections "rrf" as rrf
collections "owl" as owl
folder "nested folders" {
collections "…" as other
}
} }
node "Container" <<Docker>> { node "Container" <<Docker>> {
@ -20,16 +26,19 @@ node "localhost" {
artifact "mdm_to_neo4j" as mdm artifact "mdm_to_neo4j" as mdm
py -- mdm py -- mdm
} }
}
rectangle "User's neo4j location" #line.dashed {
component "Neo4j" <<DBMS>> as neo4j component "Neo4j" <<DBMS>> as neo4j
folder "Database Storage" { folder "Database Storage" {
database "Neo4j-Database" as db database "Neo4j-Database" as db
} }
}
input <.. mdm input <.. mdm
mdm --> neo4j mdm --> neo4j
neo4j -- db neo4j -- db
} mdm -> conf :read
@enduml @enduml

80
docs/uml/docker.svg Normal file
View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="725px" preserveAspectRatio="none" style="width:738px;height:725px;" version="1.1" viewBox="0 0 738 725" width="738px" zoomAndPan="magnify"><defs/><g><text fill="#888888" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="95" x="631" y="10.69">version: 19.03.2024</text><text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="249" x="238.5" y="32.8619">Dockerisation mdm_to_neo4j</text><!--MD5=[abc113dbf5572a754f3e11cedb95eafe]
cluster localhost--><polygon fill="#FFFFFF" points="22,72.6358,32,62.6358,692,62.6358,692,402.1358,682,412.1358,22,412.1358,22,72.6358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="682" x2="691" y1="72.6358" y2="63.6358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="22" x2="682" y1="72.6358" y2="72.6358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="682" x2="682" y1="72.6358" y2="412.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="63" x="321.5" y="90.6018">localhost</text><!--MD5=[44054a76cb8470e06432330e4e5ed321]
cluster input--><polygon fill="#FFFFFF" points="327,121.6358,405,121.6358,412,146.7038,660,146.7038,660,380.1358,327,380.1358,327,121.6358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="327" x2="412" y1="146.7038" y2="146.7038"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="72" x="331" y="138.6018">input Files</text><!--MD5=[dae3d4cfef7aa4a09b066ae497866822]
cluster nested folders--><polygon fill="#FFFFFF" points="513,175.6358,618,175.6358,625,200.7038,628,200.7038,628,268.6358,513,268.6358,513,175.6358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="513" x2="625" y1="200.7038" y2="200.7038"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="99" x="517" y="192.6018">nested folders</text><!--MD5=[8e1ca234e67c2d8bfc0f296ca0077fd7]
cluster Container--><polygon fill="#CCCCFF" points="135,161.6358,145,151.6358,295,151.6358,295,363.6358,285,373.6358,135,373.6358,135,161.6358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="285" x2="294" y1="161.6358" y2="152.6358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="135" x2="285" y1="161.6358" y2="161.6358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="285" x2="285" y1="161.6358" y2="373.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="57" x="182.5" y="179.6018">«Docker»</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="68" x="177" y="198.6697">Container</text><!--MD5=[4f967aee9238652dbf7a1146814d905b]
cluster User's neo4j location--><rect fill="#FFFFFF" height="269" style="stroke: #000000; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;" width="208" x="111" y="445.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="145" x="142.5" y="462.1018">User's neo4j location</text><!--MD5=[ff363e7c794a6d5b01c3bb39e3f1de81]
cluster Database Storage--><polygon fill="#FFFFFF" points="135,588.1358,263,588.1358,270,613.2038,295,613.2038,295,690.1358,135,690.1358,135,588.1358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="135" x2="270" y1="613.2038" y2="613.2038"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="122" x="139" y="605.1018">Database Storage</text><!--MD5=[00b4040e603364f3b74d798c0912c1e4]
entity conf--><polygon fill="#FEFECE" points="38.5,317.1358,38.5,356.2038,87.5,356.2038,87.5,327.1358,77.5,317.1358,38.5,317.1358" style="stroke: #000000; stroke-width: 1.5;"/><path d="M77.5,317.1358 L77.5,327.1358 L87.5,327.1358 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="29" x="48.5" y="342.1018">conf</text><!--MD5=[69faa7ec202dfabe15aa1561f53126bf]
entity xml--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="40" x="374" y="217.6358"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="40" x="370" y="213.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="24" x="378" y="236.6018">xml</text><!--MD5=[a264f174970795e6f8e9a8e3ba271873]
entity json--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="44" x="453" y="217.6358"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="44" x="449" y="213.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="28" x="457" y="236.6018">json</text><!--MD5=[93cba841e3482ba771221a53651bf62d]
entity rrf--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="33" x="377.5" y="321.1358"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="33" x="373.5" y="317.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="17" x="381.5" y="340.1018">rrf</text><!--MD5=[c2ef28c02a1996081c340f235b6b1057]
entity owl--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="39" x="449.5" y="321.1358"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="39" x="445.5" y="317.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="23" x="453.5" y="340.1018">owl</text><!--MD5=[31021d34eca147fafb8355324c9d51aa]
entity other--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="27" x="560.5" y="217.6358"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="27" x="556.5" y="213.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="11" x="564.5" y="236.6018"></text><!--MD5=[fd71a720deb277bbd1af72c03fa35a41]
entity py--><rect fill="#FEFECE" height="39.0679" style="stroke: #A80036; stroke-width: 1.5;" width="66" x="182" y="213.6358"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="177" y="218.6358"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="177" y="242.7038"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="46" x="192" y="238.6018">Python</text><!--MD5=[405b1b76be19e5378968a026940b4d18]
entity mdm--><rect fill="#FEFECE" height="42.0679" style="stroke: #000000; stroke-width: 1.5;" width="127" x="151.5" y="315.6358"/><polygon fill="#FEFECE" points="261.5,320.6358,261.5,334.6358,273.5,334.6358,273.5,326.6358,267.5,320.6358,261.5,320.6358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="267.5" x2="267.5" y1="320.6358" y2="326.6358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="273.5" x2="267.5" y1="326.6358" y2="326.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="97" x="161.5" y="343.6018">mdm_to_neo4j</text><!--MD5=[bce8ed80e0b7aad8739b0649b735fd39]
entity neo4j--><rect fill="#FEFECE" height="58.1358" style="stroke: #A80036; stroke-width: 1.5;" width="70" x="180" y="483.1358"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="175" y="488.1358"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="175" y="531.2717"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="50" x="190" y="508.1018">«DBMS»</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="39" x="195.5" y="527.1697">Neo4j</text><!--MD5=[7468467f3b6b392f1d176d828c753b77]
entity db--><path d="M151.5,636.1358 C151.5,626.1358 215,626.1358 215,626.1358 C215,626.1358 278.5,626.1358 278.5,636.1358 L278.5,664.2038 C278.5,674.2038 215,674.2038 215,674.2038 C215,674.2038 151.5,674.2038 151.5,664.2038 L151.5,636.1358 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><path d="M151.5,636.1358 C151.5,646.1358 215,646.1358 215,646.1358 C215,646.1358 278.5,646.1358 278.5,636.1358 " fill="none" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="107" x="161.5" y="665.1018">Neo4j-Database</text><!--MD5=[80b8e05bf5e73ddffb6a186645c1e05f]
link py to mdm--><path d="M215,252.7558 C215,270.4958 215,297.1358 215,315.3958 " fill="none" id="py-mdm" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[32e95ccbe5b83da5556e4fca56814923]
reverse link input to mdm--><path d="M326.8647,243.7276 C326.8164,243.7832 326.7679,243.8389 326.7192,243.8947 C325.1621,245.6825 323.4291,247.648 321.5588,249.7321 C314.0775,258.0683 304.4,268.3008 295,276.6358 C279.25,290.6058 260.34,304.6658 244.86,315.5458 " fill="none" id="input&lt;-mdm" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#A80036" points="326.8647,243.7276,317.939,247.8908,323.5823,247.4994,323.9738,253.1427,326.8647,243.7276" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[e584dd2e33ec26a17b9fa0455df39b80]
link mdm to neo4j--><path d="M215,357.8758 C215,387.3558 215,442.4458 215,477.9158 " fill="none" id="mdm-&gt;neo4j" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="215,483.0058,219,474.0058,215,478.0058,211,474.0058,215,483.0058" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[bf8098567680cbfad8bb4f6bfba054ac]
link neo4j to db--><path d="M215,541.3158 C215,566.3658 215,602.5558 215,625.9658 " fill="none" id="neo4j-db" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[f7050e45f226ca77f25233d36e44c1cf]
link mdm to conf--><path d="M151.22,336.6358 C130.94,336.6358 109.46,336.6358 92.78,336.6358 " fill="none" id="mdm-&gt;conf" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="87.76,336.6358,96.76,340.6358,92.76,336.6358,96.76,332.6358,87.76,336.6358" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="27" x="106" y="329.5328">read</text><!--MD5=[2bb8f5b254c75ef8834bcf76390e1034]
link xml to json--><!--MD5=[0c59b606008c7c7cba28eb87de2bfd57]
link xml to rrf--><!--MD5=[85880606e4d0ca61876d01475efc1504]
link rrf to owl--><!--MD5=[5c4ab3295cbab12660a3429c419101ef]
@startuml
title: Dockerisation mdm_to_neo4j
header version: 19.03.2024
skinparam shadowing false
skinparam node {
backgroundColor<<Docker>> #ccccff
}
node "localhost" {
file "conf" as conf
folder "input Files" as input {
collections "xml" as xml
collections "json" as json
collections "rrf" as rrf
collections "owl" as owl
folder "nested folders" {
collections "…" as other
}
}
node "Container" <<Docker>> {
component "Python" as py
artifact "mdm_to_neo4j" as mdm
py - - mdm
}
}
rectangle "User's neo4j location" #line.dashed {
component "Neo4j" <<DBMS>> as neo4j
folder "Database Storage" {
database "Neo4j-Database" as db
}
}
input <.. mdm
mdm - -> neo4j
neo4j - - db
mdm -> conf :read
@enduml
PlantUML version 1.2020.02(Sun Mar 01 11:22:07 CET 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 17.0.13+11-Debian-2deb12u1
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: GB
--></g></svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,6 +1,6 @@
@startuml @startuml
title: Python-Structure Overview mdm_to_neo4j title: Python-Structure Overview mdm2neo4j
header version: 17.09.2024 header version: 17.09.2024
left to right direction left to right direction
@ -37,7 +37,7 @@ rectangle "mdm2neo4j" {
**XmlProcessor** **XmlProcessor**
____ ____
- parse XML file - parse XML file
- logic for inport - logic for import
] ]
} }
file run [ file run [

View File

@ -1,27 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="390px" preserveAspectRatio="none" style="width:1335px;height:390px;" version="1.1" viewBox="0 0 1335 390" width="1335px" zoomAndPan="magnify"><defs/><g><text fill="#888888" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="95" x="1228" y="10.69">version: 17.09.2024</text><text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="359" x="482" y="32.8619">Python-Structure Overview mdm_to_neo4j</text><!--MD5=[337a2b82978a806ce5bcf4ad5fd16aa2] <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="352px" preserveAspectRatio="none" style="width:1323px;height:352px;" version="1.1" viewBox="0 0 1323 352" width="1323px" zoomAndPan="magnify"><defs/><g><!--MD5=[337a2b82978a806ce5bcf4ad5fd16aa2]
cluster xmls--><polygon fill="#FFFFFF" points="76.5,260.1358,141.5,260.1358,148.5,285.2038,180.5,285.2038,180.5,378.1358,76.5,378.1358,76.5,260.1358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="76.5" x2="148.5" y1="285.2038" y2="285.2038"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="59" x="80.5" y="277.1018">xml-files</text><!--MD5=[45650538d9e692597bc237bf2338e219] cluster xmls--><polygon fill="#FFFFFF" points="76.5,222,141.5,222,148.5,247.0679,180.5,247.0679,180.5,340,76.5,340,76.5,222" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="76.5" x2="148.5" y1="247.0679" y2="247.0679"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="59" x="80.5" y="238.9659">xml-files</text><!--MD5=[45650538d9e692597bc237bf2338e219]
cluster mdm2neo4j--><rect fill="#FFFFFF" height="275" style="stroke: #000000; stroke-width: 1.5;" width="715" x="326" y="63.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="83" x="642" y="80.1018">mdm2neo4j</text><!--MD5=[d7497fff2e6a9a1d994f1cc59d903d3b] cluster mdm2neo4j--><rect fill="#FFFFFF" height="275" style="stroke: #000000; stroke-width: 1.5;" width="719" x="326" y="25"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="83" x="644" y="41.9659">mdm2neo4j</text><!--MD5=[d7497fff2e6a9a1d994f1cc59d903d3b]
cluster database_connector--><polygon fill="#FFFFFF" points="826,158.1358,971,158.1358,978,183.2038,1017,183.2038,1017,280.1358,826,280.1358,826,158.1358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="826" x2="978" y1="183.2038" y2="183.2038"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="139" x="830" y="175.1018">database_connector</text><!--MD5=[bd29416b877ecfc5c3cef04f79efb9f2] cluster database_connector--><polygon fill="#FFFFFF" points="830,120,975,120,982,145.0679,1021,145.0679,1021,242,830,242,830,120" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="830" x2="982" y1="145.0679" y2="145.0679"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="139" x="834" y="136.9659">database_connector</text><!--MD5=[bd29416b877ecfc5c3cef04f79efb9f2]
cluster xml_processor--><polygon fill="#FFFFFF" points="600,109.1358,706,109.1358,713,134.2038,793,134.2038,793,259.1358,600,259.1358,600,109.1358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="600" x2="713" y1="134.2038" y2="134.2038"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="100" x="604" y="126.1018">xml_processor</text><!--MD5=[3bec78ca12dc16b09861f7009b8d0a05] cluster xml_processor--><polygon fill="#FFFFFF" points="600,71,706,71,713,96.0679,797,96.0679,797,221,600,221,600,71" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="600" x2="713" y1="96.0679" y2="96.0679"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="100" x="604" y="87.9659">xml_processor</text><!--MD5=[3bec78ca12dc16b09861f7009b8d0a05]
cluster Neo4j DBMS--><polygon fill="#FFFFFF" points="1137,173.1358,1147,163.1358,1297,163.1358,1297,260.1358,1287,270.1358,1137,270.1358,1137,173.1358" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1287" x2="1296" y1="173.1358" y2="164.1358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1137" x2="1287" y1="173.1358" y2="173.1358"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1287" x2="1287" y1="173.1358" y2="270.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="84" x="1171" y="191.1018">Neo4j DBMS</text><!--MD5=[8fc3522a43f8c7199df5e09e5bb0188e] cluster Neo4j DBMS--><polygon fill="#FFFFFF" points="1141,135,1151,125,1301,125,1301,222,1291,232,1141,232,1141,135" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1291" x2="1300" y1="135" y2="126"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1141" x2="1291" y1="135" y2="135"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1291" x2="1291" y1="135" y2="232"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="84" x="1175" y="152.9659">Neo4j DBMS</text><!--MD5=[8fc3522a43f8c7199df5e09e5bb0188e]
entity user--><ellipse cx="128.5" cy="164.1358" fill="#FEFECE" rx="8" ry="8" style="stroke: #A80036; stroke-width: 1.5;"/><path d="M128.5,172.1358 L128.5,199.1358 M115.5,180.1358 L141.5,180.1358 M128.5,199.1358 L115.5,214.1358 M128.5,199.1358 L141.5,214.1358 " fill="none" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="31" x="113" y="231.6018">User</text><!--MD5=[00b4040e603364f3b74d798c0912c1e4] entity user--><ellipse cx="128.5" cy="126" fill="#FEFECE" rx="8" ry="8" style="stroke: #A80036; stroke-width: 1.5;"/><path d="M128.5,134 L128.5,161 M115.5,142 L141.5,142 M128.5,161 L115.5,176 M128.5,161 L141.5,176 " fill="none" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="31" x="113" y="193.4659">User</text><!--MD5=[00b4040e603364f3b74d798c0912c1e4]
entity conf--><polygon fill="#FEFECE" points="38,78.1358,38,144.2717,219,144.2717,219,88.1358,209,78.1358,38,78.1358" style="stroke: #000000; stroke-width: 1.5;"/><path d="M209,78.1358 L209,88.1358 L219,88.1358 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="71" x="48" y="103.1018">mdm.conf</text><line style="stroke: #000000; stroke-width: 1.5;" x1="39" x2="218" y1="107.2038" y2="107.2038"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="149" x="54" y="126.1697">- database connection</text><!--MD5=[598c7458f910f9705370ab7196b85f6e] entity conf--><polygon fill="#FEFECE" points="38,40,38,106.1358,219,106.1358,219,50,209,40,38,40" style="stroke: #000000; stroke-width: 1.5;"/><path d="M209,40 L209,50 L219,50 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="71" x="48" y="64.9659">mdm.conf</text><line style="stroke: #000000; stroke-width: 1.5;" x1="39" x2="218" y1="69.0679" y2="69.0679"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="149" x="54" y="88.0339">- database connection</text><!--MD5=[598c7458f910f9705370ab7196b85f6e]
entity *.xml--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="52" x="104.5" y="310.6358"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="52" x="100.5" y="306.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="36" x="108.5" y="329.6018">*.xml</text><!--MD5=[983d0794f401e349a629364dfc448d7d] entity *.xml--><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="52" x="104.5" y="272.5"/><rect fill="#FEFECE" height="35.0679" style="stroke: #000000; stroke-width: 1.5;" width="52" x="100.5" y="268.5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="36" x="108.5" y="291.4659">*.xml</text><!--MD5=[983d0794f401e349a629364dfc448d7d]
entity run--><polygon fill="#FEFECE" points="342,143.1358,342,247.4075,503,247.4075,503,153.1358,493,143.1358,342,143.1358" style="stroke: #000000; stroke-width: 1.5;"/><path d="M493,143.1358 L493,153.1358 L503,153.1358 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="45" x="352" y="168.1018">run.py</text><line style="stroke: #000000; stroke-width: 1.5;" x1="343" x2="502" y1="172.2038" y2="172.2038"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="81" x="358" y="191.1697">Parameters:</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="118" x="358" y="210.2376">- path to xml-files</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="129" x="358" y="229.3055">- path to mdm.conf</text><!--MD5=[7feca6f6a073612d3294a2c89b6a5708] entity run--><polygon fill="#FEFECE" points="342,105,342,209.2717,503,209.2717,503,115,493,105,342,105" style="stroke: #000000; stroke-width: 1.5;"/><path d="M493,105 L493,115 L503,115 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="45" x="352" y="129.9659">run.py</text><line style="stroke: #000000; stroke-width: 1.5;" x1="343" x2="502" y1="134.0679" y2="134.0679"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="81" x="358" y="153.0339">Parameters:</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="118" x="358" y="172.1018">- path to xml-files</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="129" x="358" y="191.1697">- path to mdm.conf</text><!--MD5=[7feca6f6a073612d3294a2c89b6a5708]
entity c_neo--><rect fill="#FEFECE" height="68.1358" style="stroke: #A80036; stroke-width: 1.5;" width="159" x="842" y="196.1358"/><rect fill="#FEFECE" height="10" style="stroke: #A80036; stroke-width: 1.5;" width="15" x="981" y="201.1358"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="979" y="203.1358"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="979" y="207.1358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="73" x="880" y="231.1018">«Singleton»</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="119" x="857" y="250.1697">Neo4jConnection</text><!--MD5=[be93e3bd3068dc9387925b2bab7c0091] entity c_neo--><rect fill="#FEFECE" height="68.1358" style="stroke: #A80036; stroke-width: 1.5;" width="159" x="846" y="158"/><rect fill="#FEFECE" height="10" style="stroke: #A80036; stroke-width: 1.5;" width="15" x="985" y="163"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="983" y="165"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="983" y="169"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="73" x="884" y="192.9659">«Singleton»</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="119" x="861" y="212.0339">Neo4jConnection</text><!--MD5=[be93e3bd3068dc9387925b2bab7c0091]
entity p_xml--><rect fill="#FEFECE" height="95.2038" style="stroke: #A80036; stroke-width: 1.5;" width="161" x="616" y="147.6358"/><rect fill="#FEFECE" height="10" style="stroke: #A80036; stroke-width: 1.5;" width="15" x="757" y="152.6358"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="755" y="154.6358"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="755" y="158.6358"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="95" x="631" y="182.6018">XmlProcessor</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="617" x2="776" y1="186.7038" y2="186.7038"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="104" x="637" y="205.6697">- parse XML file</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="109" x="637" y="224.7376">- logic for inport</text><!--MD5=[7468467f3b6b392f1d176d828c753b77] entity p_xml--><rect fill="#FEFECE" height="95.2038" style="stroke: #A80036; stroke-width: 1.5;" width="165" x="616" y="109.5"/><rect fill="#FEFECE" height="10" style="stroke: #A80036; stroke-width: 1.5;" width="15" x="761" y="114.5"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="759" y="116.5"/><rect fill="#FEFECE" height="2" style="stroke: #A80036; stroke-width: 1.5;" width="4" x="759" y="120.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="95" x="631" y="144.4659">XmlProcessor</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="617" x2="780" y1="148.5679" y2="148.5679"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="104" x="637" y="167.5339">- parse XML file</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="113" x="637" y="186.6018">- logic for import</text><!--MD5=[7468467f3b6b392f1d176d828c753b77]
entity db--><path d="M1188,216.1358 C1188,206.1358 1216.5,206.1358 1216.5,206.1358 C1216.5,206.1358 1245,206.1358 1245,216.1358 L1245,244.2038 C1245,254.2038 1216.5,254.2038 1216.5,254.2038 C1216.5,254.2038 1188,254.2038 1188,244.2038 L1188,216.1358 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><path d="M1188,216.1358 C1188,226.1358 1216.5,226.1358 1216.5,226.1358 C1216.5,226.1358 1245,226.1358 1245,216.1358 " fill="none" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="37" x="1198" y="245.1018">neo4j</text><!--MD5=[f271a736112486e7ec41007a5c5ce53c] entity db--><path d="M1192,178 C1192,168 1220.5,168 1220.5,168 C1220.5,168 1249,168 1249,178 L1249,206.0679 C1249,216.0679 1220.5,216.0679 1220.5,216.0679 C1220.5,216.0679 1192,216.0679 1192,206.0679 L1192,178 " fill="#FEFECE" style="stroke: #000000; stroke-width: 1.5;"/><path d="M1192,178 C1192,188 1220.5,188 1220.5,188 C1220.5,188 1249,188 1249,178 " fill="none" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="37" x="1202" y="206.9659">neo4j</text><!--MD5=[f271a736112486e7ec41007a5c5ce53c]
link user to run--><path d="M144.38,195.1358 C176.8,195.1358 256.17,195.1358 321.69,195.1358 " fill="none" id="user-&gt;run" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="321.96,188.1358,341.96,195.1358,321.96,202.1358,321.96,188.1358" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="28" x="266.5" y="191.0328">start</text><!--MD5=[ba94fa49a806251d7bf299e72d969fd6] link user to run--><path d="M144.38,157 C176.8,157 256.17,157 321.69,157 " fill="none" id="user-&gt;run" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="321.96,150,341.96,157,321.96,164,321.96,150" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="28" x="266.5" y="152.897">start</text><!--MD5=[ba94fa49a806251d7bf299e72d969fd6]
link run to p_xml--><path d="M503.27,195.1358 C537.04,195.1358 576.42,195.1358 610.71,195.1358 " fill="none" id="run-&gt;p_xml" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="615.73,195.1358,606.73,191.1358,610.73,195.1358,606.73,199.1358,615.73,195.1358" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="49" x="534" y="173.0328">1 Object</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="43" x="537" y="190.7389">per File</text><!--MD5=[0a3e5cb278b49f4eda44a0ba082371fa] link run to p_xml--><path d="M503.12,157 C536.85,157 576.25,157 610.73,157 " fill="none" id="run-&gt;p_xml" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="615.78,157,606.78,153,610.78,157,606.78,161,615.78,157" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="49" x="534" y="134.897">1 Object</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="43" x="537" y="152.603">per File</text><!--MD5=[0a3e5cb278b49f4eda44a0ba082371fa]
link run to c_neo--><path d="M496.68,247.2158 C525.06,264.4258 558.71,281.3958 592,290.1358 C681.85,313.7158 710.61,311.5558 801,290.1358 C821.62,285.2458 842.72,276.2258 861.35,266.6258 " fill="none" id="run-&gt;c_neo" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#A80036" points="866.03,264.1758,856.2025,264.824,861.6045,266.5028,859.9256,271.9048,866.03,264.1758" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="19" x="687" y="268.0328">init</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="67" x="663" y="285.7389">connection</text><!--MD5=[8a7386d18f110db2ce9aedfd23e4f484] link run to c_neo--><path d="M496.68,209.08 C525.06,226.29 558.71,243.26 592,252 C683.57,276.03 712.88,273.83 805,252 C825.62,247.11 846.72,238.09 865.35,228.49 " fill="none" id="run-&gt;c_neo" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#A80036" points="870.03,226.04,860.2025,226.6881,865.6045,228.367,863.9256,233.769,870.03,226.04" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="19" x="689" y="229.897">init</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="67" x="665" y="247.603">connection</text><!--MD5=[8a7386d18f110db2ce9aedfd23e4f484]
link run to conf--><path d="M341.98,172.2558 C305.61,161.7958 262.23,149.3158 224.19,138.3758 " fill="none" id="run-&gt;conf" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="219.09,136.9058,226.6498,143.2185,223.8987,138.2757,228.8415,135.5246,219.09,136.9058" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="57" x="252" y="144.0328">read-only</text><!--MD5=[c6c1c7183ed8c16cfda3e0bc9fd1c103] link run to conf--><path d="M341.98,134.12 C305.61,123.66 262.23,111.18 224.19,100.24 " fill="none" id="run-&gt;conf" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="219.09,98.77,226.6498,105.0827,223.8987,100.1398,228.8415,97.3887,219.09,98.77" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="57" x="252" y="105.897">read-only</text><!--MD5=[c6c1c7183ed8c16cfda3e0bc9fd1c103]
reverse link xmls to run--><path d="M180.8434,370.3673 C181.589,370.3094 182.3383,370.2482 183.0909,370.1838 C184.5962,370.0548 186.115,369.9125 187.6447,369.7559 C193.7637,369.1293 200.0577,368.2729 206.3622,367.121 C218.9713,364.8171 231.6225,361.3308 243,356.1358 C297.1,331.4358 346.28,284.3458 379.25,247.4458 " fill="none" id="xmls&lt;-run" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="180.8434,370.3673,190.1263,373.658,185.8284,369.98,189.5065,365.6821,180.8434,370.3673" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="57" x="252" y="311.0328">read-only</text><!--MD5=[bb19df8b27ca915d940688a46e47b57a] reverse link xmls to run--><path d="M180.8434,332.2315 C181.589,332.1736 182.3383,332.1124 183.0909,332.0479 C184.5962,331.919 186.115,331.7767 187.6447,331.6201 C193.7637,330.9935 200.0577,330.1371 206.3622,328.9852 C218.9713,326.6813 231.6225,323.195 243,318 C297.1,293.3 346.28,246.21 379.25,209.31 " fill="none" id="xmls&lt;-run" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="180.8434,332.2315,190.1263,335.5222,185.8284,331.8441,189.5065,327.5462,180.8434,332.2315" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="57" x="252" y="272.897">read-only</text><!--MD5=[bb19df8b27ca915d940688a46e47b57a]
link p_xml to c_neo--><path d="M777.06,207.6258 C796.44,210.6658 817.21,213.9258 836.77,216.9958 " fill="none" id="p_xml-&gt;c_neo" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="841.72,217.7658,833.4445,212.4259,836.7798,216.9948,832.2108,220.3302,841.72,217.7658" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[168b4436ec304b879fe0277419ebc878] link p_xml to c_neo--><path d="M781.05,169.69 C800.53,172.72 821.35,175.95 840.91,179 " fill="none" id="p_xml-&gt;c_neo" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="845.86,179.77,837.5845,174.43,840.9198,178.999,836.3508,182.3343,845.86,179.77" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[168b4436ec304b879fe0277419ebc878]
link c_neo to db--><path d="M1001.02,230.1358 C1060.47,230.1358 1139.12,230.1358 1182.77,230.1358 " fill="none" id="c_neo-&gt;db" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1187.91,230.1358,1178.91,226.1358,1182.91,230.1358,1178.91,234.1358,1187.91,230.1358" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="62" x="1058" y="226.0328">read/write</text><!--MD5=[5ab261c7ae6e0a3bf4e4d0c104556701] link c_neo to db--><path d="M1005.02,192 C1064.47,192 1143.12,192 1186.77,192 " fill="none" id="c_neo-&gt;db" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1191.91,192,1182.91,188,1186.91,192,1182.91,196,1191.91,192" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="62" x="1062" y="187.897">read/write</text><!--MD5=[db7c712e0b3330f54b656f96ab9a54ae]
@startuml @startuml
title: Python-Structure Overview mdm_to_neo4j
header version: 17.09.2024
left to right direction left to right direction
@ -56,7 +54,7 @@ rectangle "mdm2neo4j" {
**XmlProcessor** **XmlProcessor**
____ ____
- parse XML file - parse XML file
- logic for inport - logic for import
] ]
} }
file run [ file run [
@ -86,7 +84,7 @@ PlantUML version 1.2020.02(Sun Mar 01 11:22:07 CET 2020)
(GPL source distribution) (GPL source distribution)
Java Runtime: OpenJDK Runtime Environment Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM JVM: OpenJDK 64-Bit Server VM
Java Version: 17.0.12+7-Debian-2deb12u1 Java Version: 17.0.13+11-Debian-2deb12u1
Operating System: Linux Operating System: Linux
Default Encoding: UTF-8 Default Encoding: UTF-8
Language: en Language: en

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -62,7 +62,7 @@ class Neo4jConnection:
logger.debug("Connection to Neo4j database closed") logger.debug("Connection to Neo4j database closed")
self.__connection = None self.__connection = None
def create_study_node(self, data: DataFrame): def create_study_node(self, data: DataFrame, modelid):
""" """
based on https://neo4j.com/docs/python-manual/current/query-simple/ based on https://neo4j.com/docs/python-manual/current/query-simple/
""" """
@ -70,71 +70,71 @@ class Neo4jConnection:
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MERGE (st:Study {OID: $studyoid, Name: $studyname, Description: $studydescr, Protocol: $studyprotocol})", "MERGE (st:Study {OID: $studyoid, Name: $studyname, Description: $studydescr, Protocol: $studyprotocol, ModelID: $modelid})",
studyoid=row['oid'], studyname=row['name'], studydescr=row['descr'], studyprotocol=row["protocol"] studyoid=row['oid'], studyname=row['name'], studydescr=row['descr'], studyprotocol=row["protocol"], modelid=modelid
) )
logger.debug(f"Inserted Study node with OID {row['oid']}") logger.debug(f"Inserted Study node with OID {row['oid']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_studyevent_node(self, data: DataFrame, studyoid: str): def create_studyevent_node(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query("MERGE (:StudyEvent {OID: $oid, Name: $name, Type: $type, StudyOID: $study_oid})", conn.execute_query("MERGE (:StudyEvent {OID: $oid, Name: $name, Type: $type, StudyOID: $study_oid, ModelID: $modelid})",
oid=row['OID'], name=row['Name'], type=row['Type'], study_oid=studyoid oid=row['OID'], name=row['Name'], type=row['Type'], study_oid=studyoid, modelid=modelid
) )
logger.debug(f"Inserted StudyEvent node with OID {row['OID']}") logger.debug(f"Inserted StudyEvent node with OID {row['OID']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_form_node(self, data: DataFrame, studyoid: str): def create_form_node(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MERGE (:Form {OID: $oid, Name: $name, StudyOID: $studyoid})", "MERGE (:Form {OID: $oid, Name: $name, StudyOID: $studyoid, ModelID: $modelid})",
oid=row['OID'], name=row['Name'], studyoid=studyoid) oid=row['OID'], name=row['Name'], studyoid=studyoid, modelid=modelid)
logger.debug(f"Inserted Form node with OID {row['OID']}") logger.debug(f"Inserted Form node with OID {row['OID']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_itemgroup_node(self, data: DataFrame, studyoid: str): def create_itemgroup_node(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MERGE (:ItemGroup {OID: $oid, Name: $name, StudyOID: $studyoid})", "MERGE (:ItemGroup {OID: $oid, Name: $name, StudyOID: $studyoid, ModelID: $modelid})",
oid=row['OID'], name=row['Name'], studyoid=studyoid) oid=row['OID'], name=row['Name'], studyoid=studyoid, modelid=modelid)
logger.debug(f"Inserted ItemGroup node with OID {row['OID']}") logger.debug(f"Inserted ItemGroup node with OID {row['OID']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_item_node(self, data: DataFrame, studyoid: str): def create_item_node(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MERGE (:Item {OID: $oid, Name: $name, DataType: $datatype, Question: $question, StudyOID: $studyoid})", "MERGE (:Item {OID: $oid, Name: $name, DataType: $datatype, Question: $question, StudyOID: $studyoid, ModelID: $modelid})",
oid=row['itemoid'], name=row['name'], datatype=row['datatype'], question=row['question'], oid=row['itemoid'], name=row['name'], datatype=row['datatype'], question=row['question'],
studyoid=studyoid) studyoid=studyoid, modelid=modelid)
logger.debug(f"Inserted Item node with OID {row['itemoid']}") logger.debug(f"Inserted Item node with OID {row['itemoid']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_alias_node(self, data: DataFrame, def create_alias_node(self, data: DataFrame,
studyoid: str): studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MERGE (:Alias {Context: $context, Name: $name, ItemOID: $item, StudyOID: $study})", "MERGE (:Alias {Context: $context, Name: $name, ItemOID: $item, StudyOID: $study, ModelID: $modelid})",
context=row['end'], name=row['end_two'], item=row['start'], study=studyoid) context=row['end'], name=row['end_two'], item=row['start'], study=studyoid, modelid=modelid)
logger.debug(f"Inserted Alias node with name {row['end_two']}") logger.debug(f"Inserted Alias node with name {row['end_two']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
@ -152,11 +152,11 @@ class Neo4jConnection:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_basedef_node(self, studyoid: str): def create_basedef_node(self, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
conn.execute_query( conn.execute_query(
"MERGE (:BasicDefinitions {StudyOID: $studyoid})", studyoid=studyoid) "MERGE (:BasicDefinitions {StudyOID: $studyoid, ModelID: $modelid})", studyoid=studyoid, modelid=modelid)
logger.debug(f"Inserted BasicDefinitions node for study {studyoid}") logger.debug(f"Inserted BasicDefinitions node for study {studyoid}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
@ -174,13 +174,13 @@ class Neo4jConnection:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_codelist_node(self, data: DataFrame, studyoid): def create_codelist_node(self, data: DataFrame, studyoid, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MERGE (:CodeList {OID: $oid, Name: $name, DataType: $type, StudyOID: $studyoid})", "MERGE (:CodeList {OID: $oid, Name: $name, DataType: $type, StudyOID: $studyoid, ModelID: $modelid})",
oid=row['OID'], name=row['Name'], type=row['DataType'], studyoid=studyoid) oid=row['OID'], name=row['Name'], type=row['DataType'], studyoid=studyoid, modelid=modelid)
logger.debug(f"Inserted CodeList node") logger.debug(f"Inserted CodeList node")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
@ -198,102 +198,102 @@ class Neo4jConnection:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_study_to_studyevent_rel(self, studyoid: str): def create_study_to_studyevent_rel(self, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
conn.execute_query( conn.execute_query(
"MATCH (start:Study {OID: $studyoid}), (end:StudyEvent {StudyOID: $studyoid}) MERGE (start)-[:STUDY_HAS_STUDYEVENT]->(end)-[:BACKTRACK]->(start)", "MATCH (start:Study {OID: $studyoid, ModelID: $modelid}), (end:StudyEvent {StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:STUDY_HAS_STUDYEVENT]->(end)-[:BACKTRACK]->(start)",
studyoid=studyoid studyoid=studyoid, modelid=modelid
) )
logger.debug(f"Inserted rels betw Study and StudyEvent") logger.debug(f"Inserted rels betw Study and StudyEvent")
except Exception as e: except Exception as e:
logger.error(f"Failed to populate Neo4j database: {e}") logger.error(f"Failed to populate Neo4j database: {e}")
raise raise
def create_itemgroup_to_item_rel(self, data: DataFrame, studyoid: str): def create_itemgroup_to_item_rel(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:ItemGroup {OID: $startoid, StudyOID: $studyoid}), (end:Item {OID: $endoid, StudyOID: $studyoid}) MERGE (start)-[:ITEMGROUP_HAS_ITEM]->(end)-[:BACKTRACK]->(start)", "MATCH (start:ItemGroup {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:Item {OID: $endoid, StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:ITEMGROUP_HAS_ITEM]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endoid=row['end'], studyoid=studyoid) startoid=row['start'], endoid=row['end'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw ItemGroup {row['start']} and Item {row['end']}") f"Inserted rels betw ItemGroup {row['start']} and Item {row['end']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_form_to_itemgroup_rel(self, data: DataFrame, studyoid: str): def create_form_to_itemgroup_rel(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:Form {OID: $startoid, StudyOID: $studyoid}), (end:ItemGroup {OID: $endoid, StudyOID: $studyoid}) MERGE (start)-[:FORM_HAS_ITEMGROUP]->(end)-[:BACKTRACK]->(start)", "MATCH (start:Form {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:ItemGroup {OID: $endoid, StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:FORM_HAS_ITEMGROUP]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endoid=row['end'], studyoid=studyoid) startoid=row['start'], endoid=row['end'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw Form {row['start']} and ItemGroup {row['end']}") f"Inserted rels betw Form {row['start']} and ItemGroup {row['end']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_studyevent_to_form_rel(self, data: DataFrame, studyoid: str): def create_studyevent_to_form_rel(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:StudyEvent {OID: $startoid, StudyOID: $studyoid}), (end:Form {OID: $endoid, StudyOID: $studyoid}) MERGE (start)-[:STUDYEVENT_HAS_FORM]->(end)-[:BACKTRACK]->(start)", "MATCH (start:StudyEvent {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:Form {OID: $endoid, StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:STUDYEVENT_HAS_FORM]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endoid=row['end'], studyoid=studyoid) startoid=row['start'], endoid=row['end'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw StudyEvent {row['start']} and Form {row['end']}") f"Inserted rels betw StudyEvent {row['start']} and Form {row['end']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_item_to_alias_rel(self, data: DataFrame, studyoid: str): def create_item_to_alias_rel(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:Item {OID: $startoid, StudyOID: $studyoid}), (end:Alias {Context: $endcontext, Name: $endname, ItemOID: $startoid, StudyOID: $studyoid}) MERGE (start)-[:ITEM_HAS_ALIAS]->(end)-[:BACKTRACK]->(start)", "MATCH (start:Item {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:Alias {Context: $endcontext, Name: $endname, ItemOID: $startoid, StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:ITEM_HAS_ALIAS]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endcontext=row['end'], endname=row['end_two'], studyoid=studyoid) startoid=row['start'], endcontext=row['end'], endname=row['end_two'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw Item {row['start']} and Alias {row['end']}") f"Inserted rels betw Item {row['start']} and Alias {row['end']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_itemgroup_to_alias_rel(self, data: DataFrame, studyoid: str): def create_itemgroup_to_alias_rel(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:ItemGroup {OID: $startoid, StudyOID: $studyoid}), (end:Alias {Context: $endcontext, Name: $endname}) MERGE (start)-[:ITEMGROUP_HAS_ALIAS]->(end)-[:BACKTRACK]->(start)", "MATCH (start:ItemGroup {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:Alias {Context: $endcontext, Name: $endname}) MERGE (start)-[:ITEMGROUP_HAS_ALIAS]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endcontext=row['end'], endname=row['end_two'], studyoid=studyoid) startoid=row['start'], endcontext=row['end'], endname=row['end_two'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw ItemGroup {row['start']} and Alias {row['end']}") f"Inserted rels betw ItemGroup {row['start']} and Alias {row['end']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_item_to_measurement_rel(self, data: DataFrame, studyoid: str): def create_item_to_measurement_rel(self, data: DataFrame, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:Item {OID: $startoid, StudyOID: $studyoid}), (end:MeasurementUnit {OID: $endoid, Name: $endname}) MERGE (start)-[:ITEM_HAS_MEASUREMENTUNIT]->(end)-[:BACKTRACK]->(start)", "MATCH (start:Item {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:MeasurementUnit {OID: $endoid, Name: $endname}) MERGE (start)-[:ITEM_HAS_MEASUREMENTUNIT]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endoid=row['endoid'], endname=row['endname'], studyoid=studyoid) startoid=row['start'], endoid=row['endoid'], endname=row['endname'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw Item {row['start']} and MeasurementUnit {row['endname']}") f"Inserted rels betw Item {row['start']} and MeasurementUnit {row['endname']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_basedef_to_study_rel(self, studyoid: str): def create_basedef_to_study_rel(self, studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
conn.execute_query( conn.execute_query(
"MATCH (start:Study {OID: $studyoid}), (end:BasicDefinitions {StudyOID: $studyoid}) MERGE (start)-[:HAS_BASEDEF]->(end)", "MATCH (start:Study {OID: $studyoid, ModelID: $modelid}), (end:BasicDefinitions {StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:HAS_BASEDEF]->(end)",
studyoid=studyoid) studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw Study {studyoid} and BasicDefinitions") f"Inserted rels betw Study {studyoid} and BasicDefinitions")
except Exception as e: except Exception as e:
@ -301,20 +301,20 @@ class Neo4jConnection:
raise raise
def create_basedef_to_measurement_rel(self, data: DataFrame, def create_basedef_to_measurement_rel(self, data: DataFrame,
studyoid: str): studyoid: str, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:BasicDefinitions {StudyOID: $studyoid}), (end:MeasurementUnit {OID: $endoid, Name: $endname, Symbol: $endsymbol}) MERGE (start)-[:BASEDEF_HAS_MEASUREMENTUNIT]->(end)", "MATCH (start:BasicDefinitions {StudyOID: $studyoid, ModelID: $modelid}), (end:MeasurementUnit {OID: $endoid, Name: $endname, Symbol: $endsymbol}) MERGE (start)-[:BASEDEF_HAS_MEASUREMENTUNIT]->(end)",
endoid=row['oid'], endname=row['name'], endsymbol=row['symbol'], studyoid=studyoid) endoid=row['oid'], endname=row['name'], endsymbol=row['symbol'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw BasicDefinitions and MeasurementUnit {row['name']}") f"Inserted rels betw BasicDefinitions and MeasurementUnit {row['name']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_item_to_rangecheck_rel(self, data: DataFrame): def create_item_to_rangecheck_rel(self, data: DataFrame): #TODO check for Item properties (missing StudyOID?)
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
@ -327,26 +327,26 @@ class Neo4jConnection:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_item_to_codelist_rel(self, data: DataFrame, studyoid): def create_item_to_codelist_rel(self, data: DataFrame, studyoid, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:Item {OID: $startoid, StudyOID: $studyoid}), (end:CodeList {OID: $endoid, StudyOID: $studyoid}) MERGE (start)-[:ITEM_HAS_CODELIST]->(end)-[:BACKTRACK]->(start)", "MATCH (start:Item {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:CodeList {OID: $endoid, StudyOID: $studyoid, ModelID: $modelid}) MERGE (start)-[:ITEM_HAS_CODELIST]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], endoid=row['end'], studyoid=studyoid) startoid=row['start'], endoid=row['end'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw Item {row['start']} and CodeList {row['end']}") f"Inserted rels betw Item {row['start']} and CodeList {row['end']}")
except Exception as e: except Exception as e:
logger.error(f"Failed to execute query: {e}") logger.error(f"Failed to execute query: {e}")
raise raise
def create_codelist_to_codelistitem_rel(self, data: DataFrame, studyoid): def create_codelist_to_codelistitem_rel(self, data: DataFrame, studyoid, modelid):
conn = self.__connection conn = self.__connection
try: try:
for index, row in data.iterrows(): for index, row in data.iterrows():
conn.execute_query( conn.execute_query(
"MATCH (start:CodeList {OID: $startoid, StudyOID: $studyoid}), (end:CodeListItem {CodedValue: $cv, Decode: $dc}) MERGE (start)-[:CODELIST_HAS_CODELISTITEM]->(end)-[:BACKTRACK]->(start)", "MATCH (start:CodeList {OID: $startoid, StudyOID: $studyoid, ModelID: $modelid}), (end:CodeListItem {CodedValue: $cv, Decode: $dc}) MERGE (start)-[:CODELIST_HAS_CODELISTITEM]->(end)-[:BACKTRACK]->(start)",
startoid=row['start'], cv=row['endcodedvalue'], dc=row['enddecode'], studyoid=studyoid) startoid=row['start'], cv=row['endcodedvalue'], dc=row['enddecode'], studyoid=studyoid, modelid=modelid)
logger.debug( logger.debug(
f"Inserted rels betw CodeList {row['start']} and CodeListItem {row['endcodedvalue']}") f"Inserted rels betw CodeList {row['start']} and CodeListItem {row['endcodedvalue']}")
except Exception as e: except Exception as e:

View File

@ -10,7 +10,7 @@ MDM2NEO4J_VERSION: str = "0.1"
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.info('mdm2neo4j v'+MDM2NEO4J_VERSION) logger.info("mdm2neo4j v{0}".format(MDM2NEO4J_VERSION))
# define parameters - pass xml files dir and db conf as arguments when running the script # define parameters - pass xml files dir and db conf as arguments when running the script
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()

View File

@ -522,6 +522,7 @@ def parse_xml(
neo4jconnection_object = db.Neo4jConnection() neo4jconnection_object = db.Neo4jConnection()
for file in os.listdir(path_to_datafiles): for file in os.listdir(path_to_datafiles):
if file.endswith(".xml"): if file.endswith(".xml"):
filename = os.path.splitext(file)[0]
filepath = os.path.join(path_to_datafiles, file) filepath = os.path.join(path_to_datafiles, file)
with open(filepath) as fp: with open(filepath) as fp:
parsed_xml = BeautifulSoup(fp, "xml") parsed_xml = BeautifulSoup(fp, "xml")
@ -531,23 +532,24 @@ def parse_xml(
study_oid = xmlprocessor_object.get_studyoid() study_oid = xmlprocessor_object.get_studyoid()
# create nodes # create nodes
try:
study_data = xmlprocessor_object.extract_study_data() study_data = xmlprocessor_object.extract_study_data()
neo4jconnection_object.create_study_node(study_data) neo4jconnection_object.create_study_node(study_data, filename)
itemgroup_data = xmlprocessor_object.extract_itemgroup_data() itemgroup_data = xmlprocessor_object.extract_itemgroup_data()
neo4jconnection_object.create_itemgroup_node(itemgroup_data, study_oid) neo4jconnection_object.create_itemgroup_node(itemgroup_data, study_oid, filename)
item_data = xmlprocessor_object.extract_item_data() item_data = xmlprocessor_object.extract_item_data()
neo4jconnection_object.create_item_node(item_data, study_oid) neo4jconnection_object.create_item_node(item_data, study_oid, filename)
studyevent_data = xmlprocessor_object.extract_studyevent_data() studyevent_data = xmlprocessor_object.extract_studyevent_data()
neo4jconnection_object.create_studyevent_node(studyevent_data, study_oid) neo4jconnection_object.create_studyevent_node(studyevent_data, study_oid, filename)
form_data = xmlprocessor_object.extract_form_data() form_data = xmlprocessor_object.extract_form_data()
neo4jconnection_object.create_form_node(form_data, study_oid) neo4jconnection_object.create_form_node(form_data, study_oid, filename)
alias_data = xmlprocessor_object.extract_item_to_alias_data() alias_data = xmlprocessor_object.extract_item_to_alias_data()
neo4jconnection_object.create_alias_node(alias_data, study_oid) neo4jconnection_object.create_alias_node(alias_data, study_oid, filename)
measurement_data = xmlprocessor_object.extract_measurement_data() measurement_data = xmlprocessor_object.extract_measurement_data()
neo4jconnection_object.create_measurementunit_node(measurement_data) neo4jconnection_object.create_measurementunit_node(measurement_data)
@ -556,51 +558,58 @@ def parse_xml(
neo4jconnection_object.create_rangecheck_node(rangecheck_data) neo4jconnection_object.create_rangecheck_node(rangecheck_data)
codelist_data = xmlprocessor_object.extract_codelist_data() codelist_data = xmlprocessor_object.extract_codelist_data()
neo4jconnection_object.create_codelist_node(codelist_data, study_oid) neo4jconnection_object.create_codelist_node(codelist_data, study_oid, filename)
codelistitem_data = xmlprocessor_object.extract_codelistitem_data() codelistitem_data = xmlprocessor_object.extract_codelistitem_data()
neo4jconnection_object.create_clitem_node(codelistitem_data) neo4jconnection_object.create_clitem_node(codelistitem_data)
if parsed_xml.findAll('BasicDefinitions'): if parsed_xml.findAll('BasicDefinitions'):
neo4jconnection_object.create_basedef_node(study_oid) neo4jconnection_object.create_basedef_node(study_oid, filename)
logger.info(f"Inserted all nodes for study {study_oid}") logger.info(f"Inserted all nodes for file {filename}.xml")
except:
print(f"Nodes for file {filename}.xml could not be inserted")
# create rels # create rels
try:
itemgroup_to_item_data = xmlprocessor_object.extract_itemgroup_to_item_data itemgroup_to_item_data = xmlprocessor_object.extract_itemgroup_to_item_data
neo4jconnection_object.create_itemgroup_to_item_rel(itemgroup_to_item_data, study_oid) neo4jconnection_object.create_itemgroup_to_item_rel(itemgroup_to_item_data, study_oid, filename)
item_to_alias_data = xmlprocessor_object.extract_item_to_alias_data() item_to_alias_data = xmlprocessor_object.extract_item_to_alias_data()
neo4jconnection_object.create_item_to_alias_rel(item_to_alias_data, study_oid) neo4jconnection_object.create_item_to_alias_rel(item_to_alias_data, study_oid, filename)
itemgroup_to_alias_data = xmlprocessor_object.extract_itemgroup_to_alias_data() itemgroup_to_alias_data = xmlprocessor_object.extract_itemgroup_to_alias_data()
neo4jconnection_object.create_itemgroup_to_alias_rel(itemgroup_to_alias_data, study_oid) neo4jconnection_object.create_itemgroup_to_alias_rel(itemgroup_to_alias_data, study_oid, filename)
form_to_itemgroup_data = xmlprocessor_object.extract_form_to_itemgroup_data() form_to_itemgroup_data = xmlprocessor_object.extract_form_to_itemgroup_data()
neo4jconnection_object.create_form_to_itemgroup_rel(form_to_itemgroup_data, study_oid) neo4jconnection_object.create_form_to_itemgroup_rel(form_to_itemgroup_data, study_oid, filename)
studyevent_to_form_data = xmlprocessor_object.extract_studyevent_to_form_data() studyevent_to_form_data = xmlprocessor_object.extract_studyevent_to_form_data()
neo4jconnection_object.create_studyevent_to_form_rel(studyevent_to_form_data, study_oid) neo4jconnection_object.create_studyevent_to_form_rel(studyevent_to_form_data, study_oid, filename)
neo4jconnection_object.create_study_to_studyevent_rel(study_oid) neo4jconnection_object.create_study_to_studyevent_rel(study_oid, filename)
item_to_measurement_data = xmlprocessor_object.extract_item_to_measurement_data() item_to_measurement_data = xmlprocessor_object.extract_item_to_measurement_data()
neo4jconnection_object.create_item_to_measurement_rel(item_to_measurement_data, study_oid) neo4jconnection_object.create_item_to_measurement_rel(item_to_measurement_data, study_oid, filename)
item_to_rangecheck_data = xmlprocessor_object.extract_item_to_rangecheck_data() item_to_rangecheck_data = xmlprocessor_object.extract_item_to_rangecheck_data()
neo4jconnection_object.create_item_to_rangecheck_rel(item_to_rangecheck_data) neo4jconnection_object.create_item_to_rangecheck_rel(item_to_rangecheck_data)
item_to_cl_data = xmlprocessor_object.extract_item_to_codelist_data() item_to_cl_data = xmlprocessor_object.extract_item_to_codelist_data()
neo4jconnection_object.create_item_to_codelist_rel(item_to_cl_data, study_oid) neo4jconnection_object.create_item_to_codelist_rel(item_to_cl_data, study_oid, filename)
cl_to_clitem_data = xmlprocessor_object.extract_codelist_to_codelistitem_data() cl_to_clitem_data = xmlprocessor_object.extract_codelist_to_codelistitem_data()
neo4jconnection_object.create_codelist_to_codelistitem_rel(cl_to_clitem_data, study_oid) neo4jconnection_object.create_codelist_to_codelistitem_rel(cl_to_clitem_data, study_oid, filename)
# rels to and from BasicDefinitions node # rels to and from BasicDefinitions node
neo4jconnection_object.create_basedef_to_study_rel(study_oid) neo4jconnection_object.create_basedef_to_study_rel(study_oid, filename)
neo4jconnection_object.create_basedef_to_measurement_rel(measurement_data, study_oid) neo4jconnection_object.create_basedef_to_measurement_rel(measurement_data, study_oid, filename)
logger.info(f"Inserted all rels for study {study_oid}") except:
print(f"Relationships for file {filename}.xml could not be inserted")
logger.info(f"Inserted all rels for file {filename}.xml")
# postprocess # postprocess
neo4jconnection_object.postprocess_set_label_post() neo4jconnection_object.postprocess_set_label_post()
@ -608,4 +617,4 @@ def parse_xml(
datatuple = dict_to_list_of_tuples(dictionary) datatuple = dict_to_list_of_tuples(dictionary)
neo4jconnection_object.postprocess_connect_postcoord_aliases(datatuple) neo4jconnection_object.postprocess_connect_postcoord_aliases(datatuple)
logger.info(f"Post-processing done for study {study_oid}") logger.info(f"Post-processing done for file {filename}.xml")