feat: Initial version of CleverRDFLib #4

Merged
CoreRasurae merged 2 commits from feat/initial_version-#1 into master 2026-01-14 21:42:25 +00:00
Member

ISSUES CLOSED: #1

ISSUES CLOSED: #1
CoreRasurae requested review from khird 2025-12-09 13:24:08 +00:00
CoreRasurae requested review from aditya 2025-12-09 13:24:08 +00:00
CoreRasurae added the
Type
Feature
label 2025-12-09 13:24:25 +00:00
CoreRasurae force-pushed feat/initial_version-#1 from ef1b7b1760 to cbee72c78d 2025-12-09 13:30:30 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from cbee72c78d to 33165418a1 2025-12-09 13:34:15 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 33165418a1 to b412bde0e9 2025-12-09 13:38:38 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from b412bde0e9 to 1be110eca9 2025-12-09 13:41:35 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 1be110eca9 to 969c51e3bf 2025-12-09 13:44:14 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 969c51e3bf to 59650c3a0a 2025-12-09 13:46:29 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 59650c3a0a to 23355ad08a 2025-12-09 13:47:13 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 23355ad08a to c210884198 2025-12-09 13:48:16 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from c210884198 to cf2d24a160 2025-12-09 13:49:11 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from cf2d24a160 to e5517bc3ed 2025-12-09 14:18:46 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from e5517bc3ed to cc86e5a93e 2025-12-09 14:23:54 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from cc86e5a93e to 20c909ba0d 2025-12-09 15:01:04 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 20c909ba0d to b0ac316167 2025-12-09 15:03:37 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from b0ac316167 to 477bd4e72c 2025-12-09 16:07:27 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 477bd4e72c to eeadefa5b6 2025-12-09 18:17:52 +00:00 Compare
salcedo requested review from hamza.khyari 2025-12-09 18:54:13 +00:00
aditya approved these changes 2025-12-10 14:45:26 +00:00
CoreRasurae requested review from freemo 2025-12-10 15:40:29 +00:00
CoreRasurae force-pushed feat/initial_version-#1 from eeadefa5b6 to 6536ff2a44 2025-12-10 21:56:33 +00:00 Compare
hamza.khyari approved these changes 2025-12-10 23:49:21 +00:00
@@ -0,0 +155,4 @@
result = self.check_consistency()
return result.unsatisfiable_classes
def _check_unsatisfiable_classes(self) -> list[ConsistencyIssue]:
Member

just a question let's suppose that we have such classes that are equivalent or subclass of owl:nothing does this get flagged as error or just something to be reported

just a question let's suppose that we have such classes that are equivalent or subclass of `owl:nothing` does this get flagged as error or just something to be reported
Author
Member

this won't cause a failure, the application will resume processing but the potential issue gets reported

this won't cause a failure, the application will resume processing but the potential issue gets reported
CoreRasurae force-pushed feat/initial_version-#1 from 6536ff2a44 to f3cfc42aaf 2025-12-11 20:07:22 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from f3cfc42aaf to 4f33602813 2025-12-11 21:01:09 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 4f33602813 to 8b679b515b 2025-12-11 21:28:17 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 8b679b515b to 235beb3727 2025-12-12 22:27:38 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 235beb3727 to 65f26ec777 2025-12-13 22:11:24 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 65f26ec777 to f93a81262c 2025-12-15 18:07:20 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from f93a81262c to a43e7325d9 2025-12-15 20:51:50 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from a43e7325d9 to 742817f65b 2025-12-15 22:32:38 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 742817f65b to 8196a35afc 2025-12-15 22:59:41 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 8196a35afc to 4f20a23eae 2025-12-16 21:54:01 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 4f20a23eae to 868084dc6b 2025-12-16 22:12:14 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 868084dc6b to 9fc69a1f56 2025-12-18 13:51:07 +00:00 Compare
CoreRasurae force-pushed feat/initial_version-#1 from 9fc69a1f56 to e828acf175 2025-12-19 22:26:49 +00:00 Compare
khird reviewed 2026-01-14 21:02:59 +00:00
@@ -0,0 +112,4 @@
found = False
for prop_node in context.properties_list:
if prop_node.iri == iri:
found = True
Member

For this and functions like this, any(prop_node.iri == iri for prop_node in context.properties_list) might be a clearer way to express what you're doing

For this and functions like this, `any(prop_node.iri == iri for prop_node in context.properties_list)` might be a clearer way to express what you're doing
Author
Member

yes, i have been applying that for the production code, but the tests have more relaxed rules. Personally i think that condensing the logic in a single line does not make it any more readable, even if it written in a slightly different manner. i believe most people are used to those kinds of for loops like even if not from other languages.

yes, i have been applying that for the production code, but the tests have more relaxed rules. Personally i think that condensing the logic in a single line does not make it any more readable, even if it written in a slightly different manner. i believe most people are used to those kinds of for loops like even if not from other languages.
@@ -0,0 +35,4 @@
# Note: We cannot use a context manager here because addinfourl takes ownership
# of the file object and will close it when the response is closed.
try:
file_obj = open(local_path, "rb") # noqa: SIM115
Member

If you're suppressing the warning, I think it's wise to finally: file_obj.close() after your exception handling

If you're suppressing the warning, I think it's wise to `finally: file_obj.close()` after your exception handling
khird reviewed 2026-01-14 21:03:05 +00:00
@@ -0,0 +271,4 @@
def _find_ontology_iris(self) -> set[URIRef]:
"""
Find all ontology IRI declarations in the graph.
Member

Where this is used in exctract_ontology_iri, the calling code just accesses the first ontology. Should an exception be raised, or a warning logged, when this returns a multi-element list? Otherwise you are silently dropping any subsequent IRIs.

Where this is used in exctract_ontology_iri, the calling code just accesses the first ontology. Should an exception be raised, or a warning logged, when this returns a multi-element list? Otherwise you are silently dropping any subsequent IRIs.
khird reviewed 2026-01-14 21:03:09 +00:00
@@ -0,0 +375,4 @@
# Check for direct circular references
for class_a, superclasses in subclass_relations.items():
for class_b in superclasses:
if class_b in subclass_relations and class_a in subclass_relations[class_b]:
Member

This looks like it catches non-trivial cycles, but it doesn't look like it catches trivial ones. E.g. you'd catch "a Foo is a subclass of Bar, and a Bar is a subclass of Foo" but I don't think it'd catch "a Foo is a subclass of Foo". Not 100% sure but I think that's the case.

This looks like it catches non-trivial cycles, but it doesn't look like it catches trivial ones. E.g. you'd catch "a Foo is a subclass of Bar, and a Bar is a subclass of Foo" but I don't think it'd catch "a Foo is a subclass of Foo". Not 100% sure but I think that's the case.
khird reviewed 2026-01-14 21:03:14 +00:00
@@ -0,0 +61,4 @@
Returns:
Tuple of (uri, depth) for the next item to process
"""
return self._stack.pop()
Member

In the breadth-first search you had to cast the equivalent call. If I were maintaining this, I'd find helpful a comment explaining why it's necessary there but not here.

In the breadth-first search you had to cast the equivalent call. If I were maintaining this, I'd find helpful a comment explaining why it's necessary there but not here.
khird approved these changes 2026-01-14 21:04:32 +00:00
khird left a comment
Member

Looks good. A handful of questions but given that I'm not an expert in the problem space, I'm approving anyway and just ask that you consider them.

Looks good. A handful of questions but given that I'm not an expert in the problem space, I'm approving anyway and just ask that you consider them.
CoreRasurae merged commit e828acf175 into master 2026-01-14 21:42:25 +00:00
Sign in to join this conversation.
No Label
Type
Feature
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleverlibre/CleverRDFlib#4