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
606dfd507b80
Commit
606dfd50
authored
Nov 25, 2021
by
Fabien Amarger
Browse files
fix(schema): Do not support multiple heritage, use the first super class
parent
7238fcef1eb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
owl2yams/__init__.py
View file @
606dfd50
...
...
@@ -115,8 +115,7 @@
f
"Error: class
{
class_uri
}
and
{
entitytype_fragment_to_uri
[
class_fragment
]
}
"
"use the same fragment"
)
schema
.
add_entity_type
(
EntityType
(
class_fragment
))
entity_schema
=
schema
.
_entities
[
class_fragment
]
entity_schema
=
schema
.
add_entity_type
(
EntityType
(
class_fragment
))
entitytype_fragment_to_uri
[
class_fragment
]
=
class_uri
superior_classes
=
[]
for
_
,
_
,
superior_class_uri
in
owl_model
.
triples
(
...
...
@@ -128,7 +127,12 @@
if
superior_class_fragment
is
not
None
:
superior_classes
.
append
(
superior_class_fragment
)
if
superior_classes
:
entity_schema
.
_specialized_type
=
", "
.
join
(
superior_classes
)
print
(
f
"Warning: multi heritage is not support yet.
{
class_fragment
}
will speizialize "
,
f
"
{
superior_classes
[
0
]
}
and
{
superior_classes
[
1
::]
}
"
,
"specialization will be ignored"
,
)
entity_schema
.
_specialized_type
=
superior_classes
[
0
]
# 2. fetch all datatype properties
...
...
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