Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
OWL2YAMS
Commits
3da33d6d0976
Commit
3da33d6d
authored
Nov 16, 2021
by
Fabien Amarger
Browse files
fix(test): Use proper owl_model_to_yams return types
parent
31206698ad1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
owl2yams/__init__.py
View file @
3da33d6d
...
...
@@ -3,7 +3,7 @@
import
os
from
pathlib
import
Path
import
shutil
from
typing
import
Iterable
,
Optional
,
List
,
Dict
from
typing
import
Iterable
,
Optional
,
List
,
Dict
,
Tuple
from
argparse
import
ArgumentParser
import
itertools
...
...
@@ -58,7 +58,9 @@
return
fragments
def
owl_model_to_yams
(
owl_model
:
Graph
,
instance_name
:
str
)
->
Schema
:
def
owl_model_to_yams
(
owl_model
:
Graph
,
instance_name
:
str
)
->
Tuple
[
Schema
,
Dict
[
str
,
str
],
Dict
[
str
,
str
]]:
entitytype_fragment_to_uri
:
Dict
[
str
,
str
]
=
{}
relationtype_fragment_to_uri
:
Dict
[
str
,
str
]
=
{}
# 0. Create a new YAMS Schema
...
...
test/test_owl2yams.py
View file @
3da33d6d
...
...
@@ -18,7 +18,7 @@
owl_model
=
Graph
()
owl_model
.
parse
(
str
(
data_input
),
format
=
"turtle"
)
schema
=
owl_model_to_yams
(
owl_model
,
"TEST"
)
(
schema
,
_
,
_
)
=
owl_model_to_yams
(
owl_model
,
"TEST"
)
if
yams_schema_file_name
is
not
None
:
expected_output
=
TEST_DATA
/
yams_schema_file_name
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment