--- title: Model V1 Notes tags: model, iSamples --- ```jsonld { "@type": "PhysicalSampleRecord", "sample_identifier":"", "alternate_identifiers":[{ "@type": "IdentifierObjct", "label": "", "identifier": "", "scheme_name": "" }], "complies_with":[""], "curation": { "@type": "SpecimenCuration", "access_constraints":[""], "curation_location": "", "description": "", "label": "", "responsibility": [{ "@type": "Agent", "name": "", "affiliation": "", "contact_information": "", "identifier": "", "role": "" }] }, "description": "", "has_context_category": [{ "@type": "IdentifierObject", "label": "", "identifier": "", "scheme_name": "" }], "has_material_category": [{ "@type": "IdentifierObject", "label": "", "identifier": "", "scheme_name": "" }], "has_specimen_category": [{ "@type": "IdentifierObject", "label": "", "identifier": "", "scheme_name": "" }], "keywords": [{ "@type": "Keyword", "keyword": "", "keyword_uri": "", "scheme_name": "", "scheme_uri": "" }], "label": "", "produced_by": { "@type": "SamplingEvent", "identifier": "", "label": "", "description": "", "has_feature_of_interest": "", "responsibility": { "@type": "Agent", "name": "", "affiliation": "", "contact_information": "", "identifier": "", "role": "" }, "result_time": "2023-01-01", "sampling_site": { "@type": "SamplingSite", "description":"", "label": "", "location": { "@type": "GeospatialCoordLocation", "elevation": "", "latitude": "", "longitude": "" }, "place_name": [""] }, "authorized_by": "" }, "registrant": { "@type": "Agent", "name": "", "affiliation": "", "contact_information": "", "identifier": "", "role": "" }, "related_resource": [{ "@type": "SampleRelation", "description": "", "label": "", "relationship": "", "target": "" }], "sampling_purpose": "" } ``` ## Persistence in Postgres Draft Postgres schema ```plantuml @startuml hide circle skinparam linetype ortho entity "**guids**" { + ""guid"": //character varying [PK]// -- *""thing_id"": //integer [FK]// ""properties"": //jsonb // } entity "**relations**" { + ""src"": //character varying [PK][FK]// + ""dst"": //character varying [PK][FK]// + ""predicate"": //character varying [PK]// -- ""properties"": //jsonb // } entity "**terms**" { + ""id"": //serial [PK]// -- *""uri"": //character varying // *""scheme"": //character varying // ""name"": //character varying // ""broader"": //character varying[] // ""related"": //character varying[] // ""properties"": //jsonb // } entity "**things**" { + ""id"": //serial [PK]// -- ""ttype"": //character varying // ""properties"": //jsonb // } entity "**things_terms**" { + ""things_id"": //integer [PK][FK]// + ""terms_id"": //integer [PK][FK]// -- } "**guids**" }-- "**things**" "**relations**" }-- "**guids**" "**relations**" }-- "**guids**" "**things_terms**" }-- "**terms**" "**things_terms**" }-- "**things**" @enduml ``` A thing can be a physical sample record or any "significant" components there of, e.g. an agent or sampling event. Each thing has one or more guids. Relationships between things is defined by relations between guids. Things may have terms associated with them (keywords, controlled vocabulary values)