-
Notifications
You must be signed in to change notification settings - Fork 9
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
Merge TripleStoreKnowledgeBase and TripleStore #497
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't really merge TripleStoreKnowledgeBase and TripleStore but rather put already defined class of TripleStoreKnowledgeBase into TripleStore. What is the benefits of this ?
assert h | ||
assert DLSyntaxObjectRenderer().render(h) | ||
save_owl_class_expressions(h) | ||
sparql = Owl2SparqlConverter().as_query("?x", h) | ||
assert sparql | ||
else: | ||
pass | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
if name == "main":
test_triplestore = TestTriplestore()
test_triplestore.test_remote_triplestore_dbpedia_tdl()
No need these three lines.
@@ -53,12 +52,16 @@ def test_remote_triplestore_dbpedia_tdl(self): | |||
typed_neg = set(map(OWLNamedIndividual, map(IRI.create, examples["negative_examples"]))) | |||
lp = PosNegLPStandard(pos=typed_pos, neg=typed_neg) | |||
h = model.fit(learning_problem=lp).best_hypotheses() | |||
print(h) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to print
@@ -53,12 +52,16 @@ def test_remote_triplestore_dbpedia_tdl(self): | |||
typed_neg = set(map(OWLNamedIndividual, map(IRI.create, examples["negative_examples"]))) | |||
lp = PosNegLPStandard(pos=typed_pos, neg=typed_neg) | |||
h = model.fit(learning_problem=lp).best_hypotheses() | |||
print(h) | |||
assert h | |||
assert DLSyntaxObjectRenderer().render(h) | |||
save_owl_class_expressions(h) | |||
sparql = Owl2SparqlConverter().as_query("?x", h) | |||
assert sparql | |||
else: | |||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass is problematic. This is not a really test
|
||
def __init__(self, url: str=None): | ||
assert url is not None, "url must be string" | ||
self.g = TripleStoreReasonerOntology(url=url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. We cannot have TripleStoreOntology, TripleStoreReasoner, and TripleStoreReasonerOntology, can we ?
I thought merging was putting them together so we don't have two defined
classes. I did not define new functions, but merged already existing ones.
…On Fri, Nov 29, 2024, 11:22 Caglar Demir ***@***.***> wrote:
***@***.**** requested changes on this pull request.
You didn't really merge TripleStoreKnowledgeBase and TripleStore but
rather put already defined class of TripleStoreKnowledgeBase into
TripleStore. What is the benefits of this ?
------------------------------
In tests/test_triplestore.py
<#497 (comment)>:
> assert h
assert DLSyntaxObjectRenderer().render(h)
save_owl_class_expressions(h)
sparql = Owl2SparqlConverter().as_query("?x", h)
assert sparql
else:
pass
- """
+
Remove
if *name* == "*main*":
test_triplestore = TestTriplestore()
test_triplestore.test_remote_triplestore_dbpedia_tdl()
No need these three lines.
------------------------------
In tests/test_triplestore.py
<#497 (comment)>:
> @@ -53,12 +52,16 @@ def test_remote_triplestore_dbpedia_tdl(self):
typed_neg = set(map(OWLNamedIndividual, map(IRI.create, examples["negative_examples"])))
lp = PosNegLPStandard(pos=typed_pos, neg=typed_neg)
h = model.fit(learning_problem=lp).best_hypotheses()
+ print(h)
No need to print
------------------------------
In tests/test_triplestore.py
<#497 (comment)>:
> @@ -53,12 +52,16 @@ def test_remote_triplestore_dbpedia_tdl(self):
typed_neg = set(map(OWLNamedIndividual, map(IRI.create, examples["negative_examples"])))
lp = PosNegLPStandard(pos=typed_pos, neg=typed_neg)
h = model.fit(learning_problem=lp).best_hypotheses()
+ print(h)
assert h
assert DLSyntaxObjectRenderer().render(h)
save_owl_class_expressions(h)
sparql = Owl2SparqlConverter().as_query("?x", h)
assert sparql
else:
pass
pass is problematic. This is not a really test
------------------------------
In ontolearn/triple_store.py
<#497 (comment)>:
>
+ def __init__(self, url: str=None):
+ assert url is not None, "url must be string"
+ self.g = TripleStoreReasonerOntology(url=url)
This is incorrect. We cannot have TripleStoreOntology,
TripleStoreReasoner, and TripleStoreReasonerOntology, can we ?
—
Reply to this email directly, view it on GitHub
<#497 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK4X4ERYEY6CRNJYVD6ODRT2DA57DAVCNFSM6AAAAABSOIIVOGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINRZGU3TQOBRGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@alkidbaci could you please review this PR ? Important that the existing merged class should work seamlsy with TDL, DRILL and others. Please note that it is important that TDL and DRILL work without a problem. |
I noticed that TDL and Drill works. Drill tried only on family dataset. These changes can be considered temporary but I suggest we have a more long lasting solution for this problem. |
I have implemented a simple merge of TripleStore and TripleStoreKnowledgeBase. Tests work locally. Please review and merge