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

Make use of a SPARQL endpoint for all CEL algorithms #374

Open
MichaelRoeder opened this issue Apr 11, 2024 · 2 comments
Open

Make use of a SPARQL endpoint for all CEL algorithms #374

MichaelRoeder opened this issue Apr 11, 2024 · 2 comments

Comments

@MichaelRoeder
Copy link
Member

User story

As a user of knowledge graphs, I already have my knowledge graph within a triple store with a SPARQL interface. However, for some of the CEL algorithms, it seems like I have to export my data into an OWL file to run them, just so that they load the file again into memory. Would it be possible to just provide a SPARQL endpoint as it is done in the tdl example?

@alkidbaci
Copy link
Collaborator

alkidbaci commented Apr 15, 2024

Hi Michael, as you already mentioned, like in the tdl example you just have to pass a TripleStoreKnowledgeBase instead of KnowledgeBase to any CEL algorithms and there is no need to have the knowledge graph locally.
Currently, some bugs related to triple store implementation have emerged and there may be errors when executing concept learners. We will fix them soon.

@Demirrr
Copy link
Member

Demirrr commented May 8, 2024

For the record, tDL and DRILL can be currently used with an endpoint of a triplestore, e.g.

ontolearn-webservice --endpoint_triple_store http://0.0.0.0:9080/sparql

import json
import requests
with open(f"LPs/Mutagenesis/lps.json") as json_file:
    learning_problems = json.load(json_file)["problems"]
for str_target_concept, examples in learning_problems.items():
    response = requests.get('http://0.0.0.0:8000/cel',
                            headers={'accept': 'application/json', 'Content-Type': 'application/json'},
                            json={"pos": examples['positive_examples'],
                                  "neg": examples['negative_examples'],
                                  "model": "TDL",
                                  })

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

No branches or pull requests

3 participants