Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YKWIM
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sarra Ouelhadj
YKWIM
Commits
d53a380e
Commit
d53a380e
authored
2 years ago
by
Sarra Ouelhadj
Browse files
Options
Downloads
Patches
Plain Diff
in case no enumeration in diagram
parent
c3aefcfc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
YKWIM/generateJSON.py
+18
-16
18 additions, 16 deletions
YKWIM/generateJSON.py
with
18 additions
and
16 deletions
YKWIM/generateJSON.py
+
18
−
16
View file @
d53a380e
...
...
@@ -61,24 +61,26 @@ def generateJSON(file, path=app.config["UPLOAD_FOLDER"]):
element
[
"
IRI
"
]
=
enum
[
1
]
list
.
append
(
element
)
d
[
"
enumerations
"
]
=
list
enum_exist
=
True
if
(
len
(
list
)
!=
0
)
else
False
list_of_all_values
=
[
elem
[
"
name
"
]
for
elem
in
d
[
"
enumerations
"
]]
if
enum_exist
:
list_of_all_values
=
[
elem
[
"
name
"
]
for
elem
in
d
[
"
enumerations
"
]]
#enumeration values sheet parsing
list
=
[]
enumeration
=
book
[
"
Valeurs d
'
énumération
"
][
1
][
0
]
index
=
list_of_all_values
.
index
(
enumeration
)
for
enum
in
filter
(
lambda
value
:
True
if
value
[
1
]
!=
''
else
False
,
book
[
"
Valeurs d
'
énumération
"
][
1
:]):
if
(
enumeration
!=
enum
[
0
]
and
enum
[
0
]
!=
''
):
enumeration
=
enum
[
0
]
index
=
list_of_all_values
.
index
(
enumeration
)
list
=
[]
element
=
{}
element
[
"
name
"
]
=
enum
[
1
]
element
[
"
definition
"
]
=
enum
[
3
]
element
[
"
IRI
"
]
=
enum
[
2
]
list
.
append
(
element
)
d
[
"
enumerations
"
][
index
][
"
values
"
]
=
list
#enumeration values sheet parsing
list
=
[]
enumeration
=
book
[
"
Valeurs d
'
énumération
"
][
1
][
0
]
index
=
list_of_all_values
.
index
(
enumeration
)
for
enum
in
filter
(
lambda
value
:
True
if
value
[
1
]
!=
''
else
False
,
book
[
"
Valeurs d
'
énumération
"
][
1
:]):
if
(
enumeration
!=
enum
[
0
]
and
enum
[
0
]
!=
''
):
enumeration
=
enum
[
0
]
index
=
list_of_all_values
.
index
(
enumeration
)
list
=
[]
element
=
{}
element
[
"
name
"
]
=
enum
[
1
]
element
[
"
definition
"
]
=
enum
[
3
]
element
[
"
IRI
"
]
=
enum
[
2
]
list
.
append
(
element
)
d
[
"
enumerations
"
][
index
][
"
values
"
]
=
list
json_path
=
path
+
"
parsing_result.json
"
with
open
(
json_path
,
'
w
'
)
as
fp
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment