draeger-lab / ModelPolisher

ModelPolisher accesses the BiGG Models knowledgebase to annotate SBML models.
MIT License
23 stars 7 forks source link

failing tests on master #109

Closed Schmoho closed 2 years ago

Schmoho commented 2 years ago

Trying to run gradle build yields two assertion errors:

RegistryTest > retrieveNamespaceNonCanonical() STANDARD_ERROR
    May 03, 2022 8:53:47 PM edu.ucsd.sbrg.miriam.Registry checkResourceUrl
    SEVERE: Please report this URI http://purl.obolibrary.org/obo/GSSO_002368

RegistryTest > retrieveNamespaceNonCanonical() FAILED
    org.opentest4j.AssertionFailedError at RegistryTest.java:53

RegistryTest > getPartsFromCanonicalURITest() FAILED
    org.opentest4j.AssertionFailedError at RegistryTest.java:119

this happens via

    Miriam miriam = RegistryProvider.getInstance().getMiriam();
    namespaces = new LinkedHashSet<>(miriam.getNamespaces().values());

and

    for (Namespace ns : namespaces) {
      // Given sample identifier does not match provided pattern for GWAS and Pattern is wrong for GOLD genome
      String name = ns.getName();
      if (name.equals("GWAS Central Phenotype") || name.equals("GOLD genome")) {
        continue;
      }
      for (Resource res : ns.getResources()) {
        // id from sciwalker is slightly different, ignore for now
        // Panther Pattern is interpreted incorrectly - '^G|P|U|C|S\\d{5}$' should be '^[GPUCS]\\d{5}$' instead
        // Onto bee has a weird id pattern that we currently don't handle, ignore for now
        name = res.getName();
        if (name.equals("SciWalker Open Data") || name.equals("PANTHER Pathway Component at USC (Los Angeles)") || name.equals("VariO at Lund University")) {
          continue;
        }
        String id = res.getSampleId();
        String urlPattern = res.getUrlPattern();
        String sourceURL = urlPattern.replaceAll("\\{\\$id}", id);
        Optional<String> canonicalURL = Registry.checkResourceUrl(sourceURL);
        assertTrue(canonicalURL.isPresent());
        canonicalURL.ifPresent(url -> {
          assertTrue(url.startsWith("https://identifiers.org"));

This seems to boil down to some messy code in Registry::checkResourceUrl which could be hotfixed by exiting on empty "NonCanonical" return pair.

Schmoho commented 2 years ago

It appears to me these issues are somewhat resolved in the 2.1 branch. In any case, it is not the same tests that are failing.

I have added a commit to ignore the failing test for now, in case someone wants to try and build the current master branch. However, since it is not expected that further development parallel to the 2.1 branch will occur any time soon, I have closed the issue.

I.e. will be resolved in 2.1, won't fix here.