Commit ef9c11ec authored by Fabien Amarger's avatar Fabien Amarger
Browse files

feat(owl2yams): Raise ValueError if relation already defined

parent 3eeda7b1a671
Pipeline #90264 passed with stages
in 3 minutes and 3 seconds
......@@ -133,6 +133,8 @@
if object_property_uri_fragment is None:
print(f"Warning: object property {object_property_uri} could not be parsed")
if object_property_uri_fragment in schema:
raise ValueError(f"Error: relation {object_property_uri} already defined")
all_types = list(ETYPE_URI.keys())
domain_fragments = yams_domain_from_urirefs(
......@@ -2,5 +2,5 @@
@prefix loutre2: <>.
@prefix owl: <>.
loutre:toto a owl:DatatypeProperty.
loutre2:toto a owl:DatatypeProperty.
loutre:toto a owl:ObjectProperty.
loutre2:toto a owl:ObjectProperty.
......@@ -45,6 +45,10 @@
with self.assertRaises(ValueError):
def test_raise_multi_relation(self):
with self.assertRaises(ValueError):
if __name__ == "__main__":
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment