Where to store external links and IDs?#
When registering data in LaminDB, you might want to store a reference link or ID to indicate the source of the dataset.
We have reference
and reference_type
fields for this purpose, they are available for Dataset
, Transform
, Run
and ULabel
.
!lamin init --storage testreference
✅ saved: User(id='DzTjkKse', handle='testuser1', email='testuser1@lamin.ai', name='Test User1', updated_at=2023-09-26 15:21:28)
✅ saved: Storage(id='VkfVQzpZ', root='/home/runner/work/lamindb/lamindb/docs/faq/testreference', type='local', updated_at=2023-09-26 15:21:28, created_by_id='DzTjkKse')
💡 loaded instance: testuser1/testreference
💡 did not register local instance on hub (if you want, call `lamin register`)
import lamindb as ln
💡 loaded instance: testuser1/testreference (lamindb 0.54.2)
Let’s say we have a few donor samples that came form Vendor X, in order to chase back the orders, I’d like to keep track the donor ids provided by the vendor:
ln.ULabel(
name="donor 001", reference="VX984545", reference_type="Donor ID from Vendor X"
)
ULabel(id='qgeXdtIZ', name='donor 001', reference='VX984545', reference_type='Donor ID from Vendor X', created_by_id='DzTjkKse')
!lamin delete --force testreference
💡 deleting instance testuser1/testreference
✅ deleted instance settings file: /home/runner/.lamin/instance--testuser1--testreference.env
✅ instance cache deleted
✅ deleted '.lndb' sqlite file
❗ consider manually deleting your stored data: /home/runner/work/lamindb/lamindb/docs/faq/testreference