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

Associate artifacts with extracted models #298

Merged
merged 5 commits into from
Aug 7, 2023
Merged

Conversation

brandomr
Copy link
Collaborator

@brandomr brandomr commented Jul 31, 2023

What's new

This PR addresses #297 by allowing models to be associated with artifacts (code) via an extracted_from relationship. Additionally this implements a new type of /provenance/search called models_from_code.

models_from_code accepts a model_id as the root_id and Model as root_type and returns an array of code artifacts from which the model was derived.

Considerations

Realistically, a model should only ever by extracted_from a single code artifact. In practice, this PR does not implement any verification that such a relationship exists--in other words someone could associate a model as being extracted from multiple code artifacts ☹️

Adding this validation is off the table for the time being but should be implemented during an overall refactor of provenance.

Known usage

This functionality is assumed/required by DARPA-ASKEM/knowledge-middleware#7

How to test this PR

  1. Ensure you have a model and an artifact in TDS
  2. Add a provenance relation:
POST /provenance
{
        "relation_type": "EXTRACTED_FROM",
        "left": "model_id",
        "left_type": "Model",
        "right": "articat_id",
        "right_type": "Artifact"
} 
  1. Use the models_from_code provenance search to verify the relationship:
POST /provenance/search?search_type=models_from_code
{
            "root_id": model_id,
            "root_type": "Model"
}
  1. Ensure that the result is [artifact_id] to successfully confirm that the source artifact from which the model was extracted is contained in the TDS response.

@brandomr
Copy link
Collaborator Author

brandomr commented Aug 1, 2023

Provenance is pretty much a mess right now and I think if we can determine which (if any) capabilities Uncharted currently uses @toddroper we can refactor around that. Somehow simple things like: "find the source code from which this model was extracted" are complicated and there are 2 sources of truth. Let's get to the bottom of how /provenance is currently used in the HMI--if at all--this week so we can rip out what we aren't using and build it back piece by piece as needed.

@brandomr brandomr changed the title add artifacts to extracted from [WIP] associate artifacts with extracted models Aug 1, 2023
@brandomr brandomr changed the title [WIP] associate artifacts with extracted models Associate artifacts with extracted models Aug 3, 2023
@toddroper toddroper merged commit e70471e into main Aug 7, 2023
3 of 4 checks passed
@toddroper toddroper deleted the feat/artifact-provenance branch August 7, 2023 20:55
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