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

Importing hierarchical JSON-AD with local-id parents is order dependent #558

Open
joepio opened this issue Jan 11, 2023 · 0 comments
Open

Comments

@joepio
Copy link
Member

joepio commented Jan 11, 2023

Have a JSON-AD object that references a parent using a local-id, and the parent defined after that:

[
    {
        "https://atomicdata.dev/properties/localId": "child",
        "https://atomicdata.dev/properties/parent": "parent"
    },
    {
        "https://atomicdata.dev/properties/localId": "parent"
    }
]

We get an error:

Unable to import JSON-AD. Unable to parse resource in array. Unauthorized. No parent found for https://atomicdata.dev/importer/3cdk2343yrq/child

This happens, because the parent mentioned does not exist when the first resource is being parsed.

If we invert the order, we're good to go:

[
    {
        "https://atomicdata.dev/properties/localId": "parent"
    },
    {
        "https://atomicdata.dev/properties/localId": "child",
        "https://atomicdata.dev/properties/parent": "parent"
    }
]

How to deal with this

  • Improve error message, instruct users to use a specific import order (first the parents, then the children)
  • Automatically generate referenced parents as empty resources, they'll be overwritten later on automatically.
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

No branches or pull requests

1 participant