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

OBO Foundry synchronization script failing with JSON::ParserError #78

Closed
jvendetti opened this issue Apr 16, 2024 · 1 comment
Closed
Assignees
Labels

Comments

@jvendetti
Copy link
Member

The obofoundry_sync script is erring out before running to completion with a JSON::ParserError: unexpected token error.

The script makes a call to GitHub's GraphQL API to get the contents of the OBO Foundry's ontology registry, located here:

https://github.com/OBOFoundry/OBOFoundry.github.io/blob/master/registry/ontologies.jsonld

This is the GraphQL query:

query {
  repository(name: "OBOFoundry.github.io", owner: "OBOFoundry") {
    object(expression: "master:registry/ontologies.jsonld") {
    	... on Blob {
        text
      }
    }
  }
}

When this script was originally written, the above query returned the entire contents of the ontology registry file. It turns out that now it doesn't due to limitations on response size. As can be seen in the documentation for Blob objects, there's an isTruncated property to indicate if the contents are truncated. If you issue the above query and ask for this property in the return, the value is true, indicating that the file contents are truncated. This is the underlying issue that's causing the JSON parsing error, i.e., despite a 200 OK status code from the API, we don't get the full contents of the file back.

Here's a screenshot of the query executed in GitHub's GraphQL Explorer, showing the truncated data and the isTruncated property:

Screenshot 2024-04-16 at 12 03 56 PM

The script will need to be modified is some way to fetch the complete contents of the registry file.

@jvendetti jvendetti self-assigned this Apr 16, 2024
@jvendetti jvendetti added the bug label Apr 16, 2024
@cmungall
Copy link

You can also just use purls like http://purl.obolibrary.org/meta/ontologies.jsonld - no need for github API!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants