Skip to content

Conversation

@samwaseda
Copy link
Member

from semantikon import request_values

database_graph = get_knowledge_graph(my_workflow.run(distance=1.0, time=2.0, mass=3.0))
wf_before_execution = my_workflow.serialize_workflow()
wf_before_execution["inputs"]["distance"]["value"] = 1.0
wf_before_execution["inputs"]["time"]["value"] = 2.0
wf_before_execution["inputs"]["mass"]["value"] = 3.0
print(request_values(wf_before_execution, database_graph)["outputs"])

Output: {"kinetic_energy": {"value": 0.375}}

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Binder 👈 Launch a binder notebook on branch pyiron/semantikon/graph

@samwaseda samwaseda requested a review from Copilot January 9, 2026 08:20
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.29%. Comparing base (dcbf050) to head (3bda4e7).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
semantikon/ontology.py 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #351      +/-   ##
==========================================
- Coverage   97.30%   97.29%   -0.01%     
==========================================
  Files           9        9              
  Lines        1445     1479      +34     
==========================================
+ Hits         1406     1439      +33     
- Misses         39       40       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new request_values function that enables retrieval of previously computed workflow results from a knowledge graph based on matching input values. This allows workflows to check if results already exist for given inputs before re-executing computations.

Key changes:

  • Added request_values function that queries an RDF knowledge graph using hash identifiers to populate workflow dictionaries with cached values
  • Refactored serialize_and_convert_to_networkx to accept hash_data and remove_data parameters, moving hash computation logic from get_knowledge_graph
  • Updated flowrep dependency from 0.1.7 to 0.1.8 to support the new hashing functionality

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
semantikon/ontology.py Added request_values function for value retrieval; refactored serialize_and_convert_to_networkx to handle data hashing; updated hash node creation for consistency
tests/unit/test_ontology.py Added comprehensive test for request_values; updated existing hash tests to explicitly pass hash_data=False
semantikon/api.py Exported new request_values function
semantikon/init.py Exported new request_values function
pyproject.toml Updated flowrep dependency to 0.1.8
docs/environment.yml Updated flowrep dependency to 0.1.8
.ci_support/lower_bound.yml Updated flowrep dependency to 0.1.8
.ci_support/environment.yml Updated flowrep dependency to 0.1.8
.binder/environment.yml Updated flowrep dependency to 0.1.8
notebooks/knowledge_graph.ipynb Added documentation and examples for request_values feature; updated cell execution numbers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@samwaseda samwaseda merged commit 3e705f0 into main Jan 9, 2026
22 checks passed
@samwaseda samwaseda deleted the graph branch January 9, 2026 08:36
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.

3 participants