Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing topquadrant inference #108

Merged
merged 20 commits into from
Feb 10, 2024
Merged

Fixing topquadrant inference #108

merged 20 commits into from
Feb 10, 2024

Conversation

gtfierro
Copy link
Member

No description provided.

…py`.

# Aider chat conversation:

USER: I did `git reset --hard HEAD~1` to discard the last edits.

ASSISTANT: Understood. Since you've performed a hard reset to undo the last commit, I will now provide the changes to revert the `expand` method and the `_expand_helper` method to their state before the commit with hash `b27e5cc`.

Here are the diffs for those changes:

```diff
--- brickschema/graph.py
+++ brickschema/graph.py
@@ ... @@
     def expand(
         self, profile, backend=None, simplify=True, ontology_graph=None, iterative=True
     ):
         """
         Expands the current graph with the inferred triples under the given entailment regime
         and with the given backend. Possible profiles are:
         - 'rdfs': runs RDFS rules
         - 'owlrl': runs full OWLRL reasoning
         - 'vbis': adds VBIS tags
         - 'shacl': does SHACL-AF reasoning (including tag inference, if the extension is loaded)
@@ ... @@
         elif profile == "owlrl":
-            self._inferbackend = OWLRLNaiveInferenceSession()
-            try:
-                if backend is None or backend == "reasonable":
-                    self._inferbackend = OWLRLReasonableInferenceSession()
-                    backend = "reasonable"
-            except ImportError:
-                warn(
-                    "Could not load Reasonable reasoner. Needs 'reasonable' option during install."
-                )
-                self._inferbackend = OWLRLNaiveInferenceSession()
-
-            try:
-                if backend is None or backend == "allegrograph":
-                    self._inferbackend = OWLRLAllegroInferenceSession()
-                    backend = "allegrograph"
-            except (ImportError, ConnectionError):
-                warn(
-                    "Could not load Allegro reasoner. Needs 'allegro' option during install."
-                )
-                self._inferbackend = OWLRLNaiveInferenceSession()
+            self._inferbackend = OWLRLReasonableInferenceSession()
         elif profile == "vbis":
             self._inferbackend = VBISTagInferenceSession(
                 brick_version=self._brick_version
             )
         else:
             raise Exception(f"Invalid profile '{profile}'")
-        self._inferbackend.expand(self)
+        OWLRLNaiveInferenceSession().expand(self)

         if simplify:
             self.simplify()
         return self
```

This diff will revert the changes made to the `expand` method in the `brickschema/graph.py` file, effectively undoing the commit with hash `b27e5cc`.
…serve bnode identities

Reverted changes to the `expand` method in `brickschema/graph.py`.

USER: I did `git reset --hard HEAD~1` to discard the last edits.

ASSISTANT: Understood. Since you've performed a hard reset to undo the last commit, I will now provide the changes to revert the `expand` method and the `_expand_helper` method to their state before the commit with hash `b27e5cc`.

Here are the diffs for those changes:

```diff
--- brickschema/graph.py
+++ brickschema/graph.py
@@ ... @@
     def expand(
         self, profile, backend=None, simplify=True, ontology_graph=None, iterative=True
     ):
         """
         Expands the current graph with the inferred triples under the given entailment regime
         and with the given backend. Possible profiles are:
         - 'rdfs': runs RDFS rules
         - 'owlrl': runs full OWLRL reasoning
         - 'vbis': adds VBIS tags
         - 'shacl': does SHACL-AF reasoning (including tag inference, if the extension is loaded)
@@ ... @@
         elif profile == "owlrl":
-            self._inferbackend = OWLRLNaiveInferenceSession()
-            try:
-                if backend is None or backend == "reasonable":
-                    self._inferbackend = OWLRLReasonableInferenceSession()
-                    backend = "reasonable"
-            except ImportError:
-                warn(
-                    "Could not load Reasonable reasoner. Needs 'reasonable' option during install."
-                )
-                self._inferbackend = OWLRLNaiveInferenceSession()
-
-            try:
-                if backend is None or backend == "allegrograph":
-                    self._inferbackend = OWLRLAllegroInferenceSession()
-                    backend = "allegrograph"
-            except (ImportError, ConnectionError):
-                warn(
-                    "Could not load Allegro reasoner. Needs 'allegro' option during install."
-                )
-                self._inferbackend = OWLRLNaiveInferenceSession()
+            self._inferbackend = OWLRLReasonableInferenceSession()
         elif profile == "vbis":
             self._inferbackend = VBISTagInferenceSession(
                 brick_version=self._brick_version
             )
         else:
             raise Exception(f"Invalid profile '{profile}'")
-        self._inferbackend.expand(self)
+        OWLRLNaiveInferenceSession().expand(self)

         if simplify:
             self.simplify()
         return self
```

This diff will revert the changes made to the `expand` method in the `brickschema/graph.py` file, effectively undoing the commit with hash `b27e5cc`.
…mized data graph stops changing in size. Then, return the deskolemized data graph.
…/py-brickschema into fixing-topquadrant-inference
@gtfierro gtfierro merged commit 35edb1d into master Feb 10, 2024
4 checks passed
@gtfierro gtfierro deleted the fixing-topquadrant-inference branch February 10, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant