Skip to content

ROR sync broken due to schema change #775

@briri

Description

@briri

The ROR file's schema has changed and our services/external_api/ror.rb syncronization script no longer works.

The cron job ran on 1/1/26 and corrupted the existing registry_orgs table which is used to feed our org/affiliation/funder typeahead fields. The site is still operational, any affiliations/funders that we already know about have a record in the orgs table (when a user selects a record from the registry_orgs table in a typeahead, we create a corresponding record in the orgs table). Users still have the ability to manually enter the name of their affiliation/funder if it doesn't come up in the typeahead.

I have asked IAS to restore a snapshot of the database from 12/31 so that we can restore the table. This will involve replacing the corrupted registry_orgs table with the copy from the snapshot. Doing some spot checks to make sure the registry_orgs.org_id foreign key matches up with the correct orgs.id record.

Longer term (before Feb 1) we need to update/fix the ROR sync script.

Notably, the name string has become an array names with the primary having a type of ror_display. It also went from 120,000+ records to under 7,000, so there is a status, field or value that is causing the script to skip most records.

We should also consider using the new domains entry in the ROR record to append to the name so that we're getting things like mit.edu instead of web.mit.edu.

Example of one of the new ROR records.

    {
        "admin": {
            "created": {
                "date": "2018-11-14",
                "schema_version": "1.0"
            },
            "last_modified": {
                "date": "2025-12-15",
                "schema_version": "2.1"
            }
        },
        "domains": [
            "sxau.edu.cn"
        ],
        "established": 1907,
        "external_ids": [
            {
                "all": [
                    "501100013805"
                ],
                "preferred": "501100013805",
                "type": "fundref"
            },
            {
                "all": [
                    "grid.412545.3"
                ],
                "preferred": "grid.412545.3",
                "type": "grid"
            },
            {
                "all": [
                    "0000 0004 1798 1300"
                ],
                "preferred": null,
                "type": "isni"
            },
            {
                "all": [
                    "Q1389327"
                ],
                "preferred": null,
                "type": "wikidata"
            }
        ],
        "id": "https://ror.org/05e9f5362",
        "links": [
            {
                "type": "website",
                "value": "https://www.sxau.edu.cn/index.htm"
            },
            {
                "type": "wikipedia",
                "value": "http://en.wikipedia.org/wiki/Shanxi_Agricultural_University"
            }
        ],
        "locations": [
            {
                "geonames_details": {
                    "continent_code": "AS",
                    "continent_name": "Asia",
                    "country_code": "CN",
                    "country_name": "China",
                    "country_subdivision_code": "SX",
                    "country_subdivision_name": "Shanxi",
                    "lat": 37.73639,
                    "lng": 112.55639,
                    "name": "Xiaodian"
                },
                "geonames_id": 1790274
            },
            {
                "geonames_details": {
                    "continent_code": "AS",
                    "continent_name": "Asia",
                    "country_code": "CN",
                    "country_name": "China",
                    "country_subdivision_code": "SX",
                    "country_subdivision_name": "Shanxi",
                    "lat": 37.40303,
                    "lng": 112.72302,
                    "name": "Taigu Xian"
                },
                "geonames_id": 1793690
            }
        ],
        "names": [
            {
                "lang": "en",
                "types": [
                    "ror_display",
                    "label"
                ],
                "value": "Shanxi Agricultural University"
            },
            {
                "lang": "zh",
                "types": [
                    "label"
                ],
                "value": "\u5c71\u897f\u519c\u4e1a\u5927\u5b66"
            }
        ],
        "relationships": [],
        "status": "active",
        "types": [
            "education",
            "funder"
        ]
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions