geneontology / minerva

BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Document method of model ID URI creation #215

Open dustine32 opened 5 years ago

dustine32 commented 5 years ago

This ticket's just to clarify how model IDs are generated by minerva as well as setting a standard to follow for models created outside of minerva intended to be imported into minerva.

Example model ID: gomodel:8b70d37c-dbc7-49bd-87e5-58356afe0923 Example individual ID URI residing in this model: gomodel:8b70d37c-dbc7-49bd-87e5-58356afe0923/5c53909000000000

We should figure out the document where this will live.

balhoff commented 5 years ago

I'm putting documentation right here so we have it ready to insert wherever we want it:

A model ID prefix is configured as an option at server startup, e.g. http://model.geneontology.org/. When a new model is created, CoreMolecularModelManager.localUnique() is called; the returned ID is appended to the model ID prefix. When a new individual is created in a model, CoreMolecularModelManager.localUnique() is again called; the returned ID is appended to the full model ID (with "/" separator).

CoreMolecularModelManager.localUnique() concatenates two values to make a unique ID. The first is a hex string based on the current time at server startup. The second is a global AtomicLong instance counter that starts at 0 at server startup and increments every time an individual is created by the server.

Links: CoreMolecularModelManager.localUnique() and unique values Create a model Create an individual