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
74ddd091ef27
Commit
74ddd091
authored
Oct 26, 2021
by
Fabien Amarger
Browse files
feat(test): Add test class
parent
4a98155b6c34
Changes
5
Hide whitespace changes
Inline
Side-by-side
test/data/expected_schema.yams
deleted
100644 → 0
View file @
4a98155b
from yams.buildobjs import *
class FirstClass(EntityType):
toto = Int()
name = String()
class SubClass(FirstClass):
name = String()
class rel1(RelationDefinition):
subject = ('SubClass',)
object = ('FirstClass',)
class rel2(RelationDefinition):
subject = ('FirstClass', 'SubClass',)
object = ('FirstClass', 'SubClass',)
class rel3(RelationDefinition):
subject = ('FirstClass', 'SubClass',)
object = ('SubClass', 'FirstClass',)
test/data/model.owl
deleted
100644 → 0
View file @
4a98155b
@prefix : <http://loutre.fr/>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
:FirstClass a owl:Class.
:SubClass a owl:Class;
rdfs:subClassOf :FirstClass.
:toto a owl:DatatypeProperty;
rdfs:domain :FirstClass;
rdfs:range xsd:int.
:rel1 a owl:ObjectProperty;
rdfs:domain :SubClass;
rdfs:range :FirstClass.
:rel2 a owl:ObjectProperty.
:name a owl:DatatypeProperty;
rdfs:domain owl:Thing.
:rel3 a owl:ObjectProperty;
rdfs:range :SubClass, :FirstClass.
test/data/test_class.owl
0 → 100644
View file @
74ddd091
@prefix : <http://loutre.fr/>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
:FirstClass a owl:Class.
test/data/test_class.yams
0 → 100644
View file @
74ddd091
from yams.buildobjs import *
class FirstClass(EntityType):
pass
test/test_owl2yams.py
View file @
74ddd091
...
...
@@ -25,8 +25,8 @@
self
.
assertEquals
(
serialize_to_python
(
schema
),
expected_yams_schema
)
return
schema
def
test_transform_
owl_to_yam
s
(
self
):
self
.
_load_owl_and_yams
(
"
model.owl"
,
"expected_schema
.yams"
)
def
test_transform_
clas
s
(
self
):
self
.
_load_owl_and_yams
(
"
test_class.owl"
,
"test_class
.yams"
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
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