Add has_direct_output
slot to Activity
class
#11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8
Summary
These changes bring the input and output slots on the
Activity
class more inline with the ShEx schema. In particular:has_direct_input
slothas_input
andhas_output
slots which are multivaluedhas_primary_input
andhas_primary_output
slots which are single-valuedDetails
MoleculeAssociation
, which was previously used as the range of thehas_direct_input
slot.MinervaWrapper.minerva_object_to_model
method has been updated so that it populates thehas_input
,has_output
,has_primary_input
, andhas_primary_output
slots based on facts with theRO:0002233 (has input)
,RO:0002234 (has output)
,RO:0004009 (has primary input)
, andRO:0004008 (has primary output)
properties, respectively.MinervaWrapper.minerva_object_to_model
method has been updated to emit warnings when the values of single-valued slotspart_of
,occurs_in
,has_primary_input
, orhas_primary_output
are overwritten. This is purely informative for now. The warnings may help us suss out areas where the modeling needs to be updated.exclude_unset
vsexclude_defaults
insrc/gocam/cli.py
. I was seeing an issue wherehas_input
andhas_output
were not appearing the YAML serialization produced by thegocam fetch
command. The reason was that in the the LinkML-generated Pydantic model, multivalued slots have a default value of an empty list. The code inMinervaWrapper
appended to those empty lists. As far asexclude_unset
is concerned, mutating that default value means it is still "unset" (i.e. still equal by identity to the default). This didn't happen for thecausal_associations
slot because of a bit of code (now removed) that swapped out the default empty list for a new empty list. That's unnecessary, in general, but it did have the effect of satisfyingexclude_unset
. Sinceexclude_default
does a compare-by-value with the default, it notices that the default value was modified in place and includes it in the output.