From 29718b12bd411b65f500cc8d20307688535427ab Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Sat, 22 Oct 2022 01:23:04 +0200 Subject: [PATCH] Tried fixing failing test on Windows --- ontopy/factpluspluswrapper/owlapi_interface.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ontopy/factpluspluswrapper/owlapi_interface.py b/ontopy/factpluspluswrapper/owlapi_interface.py index 22c36ae2f..da4b1c2c1 100644 --- a/ontopy/factpluspluswrapper/owlapi_interface.py +++ b/ontopy/factpluspluswrapper/owlapi_interface.py @@ -30,9 +30,10 @@ def reason(self, graph): graph (Graph): An rdflib graph to execute the reasoner on. """ - with tempfile.NamedTemporaryFile("wt") as tmpdir: - graph.serialize(tmpdir.name, format="xml") - return self._run(tmpdir.name, command="--run-reasoner") + with tempfile.TemporaryDirectory("wt") as tmpdir: + tmpfile = os.path.join(tmpdir, "tmponto.xml") + graph.serialize(tmpfile, format="xml") + return self._run(tmpfile, command="--run-reasoner") def reason_files(self, *owl_files): """Merge the given owl and generate the inferred axioms.