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

Add UniqueConstraint for Graph.slug where Graph.source_identifier = None #11565

Open
jacobtylerwalls opened this issue Oct 22, 2024 · 2 comments

Comments

@jacobtylerwalls
Copy link
Member

There are four ways to get JSON-LD data into arches:

  1. the POST api
  2. the PUT api
  3. the load_jsonld management command
  4. the json-ld bulk import module, which is a wrapper around no. 3

All four allow you to pass a graph by slug. In dev/8.0.x we currently assume the user means the original graph. But if your tile data has already migrated away to some future graph version, that assumption would leave you working against an outdated version.

Should we assume when these four places are given a graph slug, that the caller wants to work against the latest graph?

cc/ @robgaston


Noticed while dev'ing archesproject/arches-lingo#103, which might create a fifth place to look up graphs by slug.

@apeters
Copy link
Member

apeters commented Oct 24, 2024

I would agree that, although, we can never know where the data originally came from, assuming the latest graph makes sense to me.

@jacobtylerwalls jacobtylerwalls moved this to 🔖 Ready in pipeline Oct 30, 2024
@jacobtylerwalls
Copy link
Member Author

jacobtylerwalls commented Nov 11, 2024

I misunderstood the number of graph rows sharing a slug: should only ever be 2 no matter how many versions there are. The versioning happens in json. A UniqueConstraint across slug and source_identifier=None could potentially clarify this or improve performance slightly.

@jacobtylerwalls jacobtylerwalls changed the title Should resource API & JSON-LD import module assume latest graph when importing? Add UniqueConstraint for Graph.alias where Graph.source_identifier = None Nov 11, 2024
@jacobtylerwalls jacobtylerwalls changed the title Add UniqueConstraint for Graph.alias where Graph.source_identifier = None Add UniqueConstraint for Graph.slug where Graph.source_identifier = None Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants