From c1eab4b6bbcc9ed504d4c5817ea7613ce1cfba47 Mon Sep 17 00:00:00 2001 From: Caglar Demir Date: Mon, 16 Sep 2024 12:26:26 +0200 Subject: [PATCH] save can except IRI or str --- owlapy/owl_ontology.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/owlapy/owl_ontology.py b/owlapy/owl_ontology.py index c4596e3..44b064a 100644 --- a/owlapy/owl_ontology.py +++ b/owlapy/owl_ontology.py @@ -928,7 +928,9 @@ def remove_axiom(self, axiom: Union[OWLAxiom, Iterable[OWLAxiom]]): for ax in axiom: _remove_axiom(ax, self, self._world) - def save(self, path: str = None, rdf_format = "rdfxml"): + def save(self, path: Union[str,IRI] = None, rdf_format = "rdfxml"): + if isinstance(path, IRI): + path=path.as_str() ont_x:owlready2.namespace.Ontology assert isinstance(path,str), f"path must be string. Currently it is {type(path)}" ont_x = self._world.get_ontology(self.get_ontology_id().get_ontology_iri().as_str())