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

Add document header tags #35

Merged
merged 12 commits into from
May 27, 2024
Merged

Add document header tags #35

merged 12 commits into from
May 27, 2024

Conversation

omaus
Copy link
Member

@omaus omaus commented May 23, 2024

This PR

  • extends the OboOntology by adding all document header tags to the model
    • updates the fromLines function accordingly
    • adds unit tests
    • does the same for OboEntries function

@omaus omaus requested a review from kMutagene May 23, 2024 16:33
@omaus omaus marked this pull request as ready for review May 23, 2024 16:36
Copy link
Member

@kMutagene kMutagene left a comment

Choose a reason for hiding this comment

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

LGTM, comments are only suggestions


loop en [] [] 1
loop en terms (parsedTypeDef :: typedefs) formatVersion dataVersion ontology date savedBy autoGeneratedBy subsetdefs imports synonymtypedefs idSpaces defaultRelationshipIdPrefix idMappings remarks treatXrefsAsEquivalents treatXrefsAsGenusDifferentias treatXrefsAsRelationships treatXrefsAsIsAs relaxUniqueIdentifierAssumptionForNamespaces relaxUniqueLabelAssumptionForNamespaces lineNumber
| x when (rxFormatVersion.Match x).Success ->
Copy link
Member

Choose a reason for hiding this comment

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

rewriting these match cases as active patterns would severely increase the readability of this giant match case

/// Takes a list of OboEntries and the document header tags and returns the OboOntology based on them.
static member FromOboEntries(entries, formatVersion, ?DataVersion, ?Ontology, ?Date, ?SavedBy, ?AutoGeneratedBy, ?Subsetdefs, ?Imports, ?Synonymtypedefs, ?Idspaces, ?DefaultRelationshipIdPrefix, ?IdMappings, ?Remarks, ?TreatXrefsAsEquivalents, ?TreatXrefsAsGenusDifferentias, ?TreatXrefsAsRelationships, ?TreatXrefsAsIsAs, ?RelaxUniqueIdentifierAssumptionForNamespaces, ?RelaxUniqueLabelAssumptionForNamespaces) =
//let subsetdefs = match Subsetdefs with None -> [] | _ -> Subsetdefs.Value
OboOntology.fromOboEntries formatVersion DataVersion Ontology Date SavedBy AutoGeneratedBy (defaultArg Subsetdefs []) (defaultArg Imports []) (defaultArg Synonymtypedefs []) (defaultArg Idspaces []) DefaultRelationshipIdPrefix (defaultArg IdMappings []) (defaultArg Remarks []) (defaultArg TreatXrefsAsEquivalents []) (defaultArg TreatXrefsAsGenusDifferentias []) (defaultArg TreatXrefsAsRelationships []) (defaultArg TreatXrefsAsIsAs []) (defaultArg RelaxUniqueIdentifierAssumptionForNamespaces []) (defaultArg RelaxUniqueLabelAssumptionForNamespaces []) entries

/// Writes an OBO Ontology to term and type def stanzas in line form.
static member toLines (oboOntology : OboOntology) =
Copy link
Member

Choose a reason for hiding this comment

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

this should also reflect the new header additions, otherwise roundtrip tests will fail

Copy link
Member

@kMutagene kMutagene left a comment

Choose a reason for hiding this comment

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

LGTM, comments are only suggestions

@omaus omaus merged commit fdac911 into main May 27, 2024
2 checks passed
@omaus omaus deleted the feature-DocumentHeaderTags-#33 branch May 27, 2024 10:29
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