Skip to content

Add POST/ASK interactions to knowledge base and client#18

Merged
DaviddeBest-TNO merged 7 commits into
mainfrom
15-post-ask-handlers
May 20, 2026
Merged

Add POST/ASK interactions to knowledge base and client#18
DaviddeBest-TNO merged 7 commits into
mainfrom
15-post-ask-handlers

Conversation

@DaviddeBest-TNO
Copy link
Copy Markdown
Contributor

Solves #15

This PR adds POST and ASK interactions to the Knowledge Base and KE Client.
The TestClient is moved to src, to be used by users of the package as well.

@DaviddeBest-TNO DaviddeBest-TNO self-assigned this May 11, 2026
@DaviddeBest-TNO DaviddeBest-TNO marked this pull request as ready for review May 11, 2026 13:31
from .kb import TestBinding, ask_for_values_of_subject, kb, repeat_value_post

# In your tests you likely want to use the TestClient to mock results from the KE.
# A Knowledge Base instance is initialized with a real Client that makes HTTP requests
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth it to extend the documentation on the knowledge mapper at some point (https://docs.knowledge-engine.eu/get-started/knowledge-base/knowledge-mapper)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! Will do soon

Comment thread examples/testing/test_kb.py
Comment thread examples/post_measurement.py
Comment thread src/knowledge_base.py
name="ask-ki",
graph_pattern="""
?person a ex:Person .
ex:hasName ?name .
Copy link
Copy Markdown

@Sophietje Sophietje May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ; (instead of .) as you're reusing the subject in the following clauses

Comment thread tests/test_ask_and_post.py
Comment thread tests/test_ask_and_post.py
Comment thread tests/test_ask_and_post.py
Comment thread tests/test_ask_and_post.py
Comment thread examples/testing/test_kb.py
Comment thread tests/test_ask_and_post.py
@DaviddeBest-TNO DaviddeBest-TNO merged commit 889f0ff into main May 20, 2026
3 checks passed
@DaviddeBest-TNO DaviddeBest-TNO deleted the 15-post-ask-handlers branch May 20, 2026 15:37
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.

2 participants