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

Making prefix mapping less strict, fixes #702 #761

Merged
merged 10 commits into from
Jun 5, 2024
Merged

Making prefix mapping less strict, fixes #702 #761

merged 10 commits into from
Jun 5, 2024

Conversation

cmungall
Copy link
Collaborator

Adds test that currently codifies ambiguous behavior.

See also #760 for broader issue.

This PR also extends the obo test suite to include this,
and adds some derived files previously missing.

cmungall added 2 commits May 15, 2024 10:46
Adds test that currently codifies ambiguous behavior.

See also #760 for broader issue.

This PR also extends the obo test suite to include this,
and adds some derived files previously missing.
@cmungall cmungall requested review from gouttegd and matentzn May 15, 2024 20:05
Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

Nice suite! Cant see anything particularly wrong, left two comments.

Probably too late now but this is a robot jar we could run after this is merged to check all the changes in obographs-json and obo format against the suite:

https://incenp.org/files/softs/robot/1.10/robot-1.10.0-SNAPSHOT.jar

# Class: <http://purl.obolibrary.org/obo/X_1> (<http://purl.obolibrary.org/obo/X_1>)

AnnotationAssertion(<http://www.geneontology.org/formats/oboInOwl#id> <http://purl.obolibrary.org/obo/X_1> "X:1")
SubClassOf(Annotation(<http://www.geneontology.org/formats/oboInOwl#gci_predicate> "R:2") <http://purl.obolibrary.org/obo/X_1> <http://purl.obolibrary.org/obo/X_2>)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this expected? Should it be R:2 some X:2 subClassOf X:1?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is because the input file is using the wrong qualifier (see my other comment below).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch.

The main issue with this suite (as I mentioned here #751) is that it's self-bootstrapping there is a one-off TestByGuru run where both inputs and outputs need carefully checked against the spec.

@@ -0,0 +1,4 @@
name: prefixes-conflict-main-idspace
name: prefixes-conflict-main-idspace
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do the metadata yaml files have the same line twice? All of them.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is a bug in the split_compiled_obo function (src/tests/test_converters/test_obo_format.py), lines 113–119. The name: ... line is added to the yamls[ontology_id] dictionary twice:

if k == "name":
    ontology_id = v
    if ontology_id in blocks:
        raise ValueError(f"Duplicate ontology id: {ontology_id}")
    metadata[ontology_id] = {}
    yamls[ontology_id] = [yaml.rstrip()] # First addition of `name: ...`
    blocks[ontology_id] = [
        "format-version: 1.4\n",
        f"ontology: {ontology_id}\n",
    ]
metadata[ontology_id][k.strip()] = v.strip()
yamls[ontology_id].append(yaml.strip()) # Second addition of `name: ...`


[Term]
id: X:1
is_a: X:2 {gci_predicate="R:2", gci_filler="X:3"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn’t that be gci_relation instead of gci_predicate? I don’t think I have ever seen that gci_predicate qualifier, and the OBO spec does not mention it at all.

@matentzn
Copy link
Contributor

matentzn commented Jun 5, 2024

I totally lost track of this, and this is now breaking some OAK pipelines we have (especially the multilingual stuff). Oops.

@cmungall cmungall merged commit 8b25588 into main Jun 5, 2024
9 checks passed
@cmungall cmungall deleted the issue-760 branch June 5, 2024 22:31
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