@startuml
hide empty members
hide circle
skinparam classAttributeIconSize 0
class _department_departmentid_ as "<department/(departmentid)>"
_department_departmentid_ : {field} a crm:E74_Group
class _department_departmentid_name_ as "<department/(departmentid)/name>"
_department_departmentid_ -down-> _department_departmentid_name_ : crm:P131_is_identified_by
class ulan_500115988_agent as "ulan:500115988-agent"
_department_departmentid_ -down-> ulan_500115988_agent : crm:P107i_is_current_or_former_member_of
_department_departmentid_ : {field}  <color:red>"\ndepartments\n where maintableid=108\n  and departmentid in (1,2,3,4,5,6,12)\n"</color>
_department_departmentid_name_ : {field} a crm:E82_Actor_Appellation
_department_departmentid_name_ : {field} crm:P3_has_note "(department)"
class _id_type_ as "<id/type/>"
_id_type_ : {field} a skos:ConceptScheme
_id_type_ : {field} rdfs:label "Identifier type"
class _id_type_urlify_description_ as "<id/type/urlify(description)>"
_id_type_urlify_description_ : {field} a skos:Concept
_id_type_urlify_description_ -down-> _id_type_ : skos:inScheme
_id_type_urlify_description_ : {field} skos:prefLabel "(description)"
class _object_objectid_ as "<object/(objectid)>"
_object_objectid_ : {field} a crm:E19_Physical_Object
_object_objectid_ -down-> _department_departmentid_ : crm:P50_has_current_keeper
class _object_objectid_id_ as "<object/(objectid)/id>"
_object_objectid_ -right-> _object_objectid_id_ : crm:P48_has_preferred_identifier
class _object_objectid_id_altnumid_ as "<object/(objectid)/id/(altnumid)>"
_object_objectid_ -down-> _object_objectid_id_altnumid_ : crm:P1_is_identified_by
class _object_objectid_inscription_ as "<object/(objectid)/inscription>"
_object_objectid_ -up-> _object_objectid_inscription_ : crm:P65_shows_visual_item
class _object_objectid_marking_ as "<object/(objectid)/marking>"
_object_objectid_ -up-> _object_objectid_marking_ : crm:P65_shows_visual_item
class _object_objectid_number_ as "<object/(objectid)/number>"
_object_objectid_ -left-> _object_objectid_number_ : crm:P1_is_identified_by
class _object_objectid_production_ as "<object/(objectid)/production>"
_object_objectid_ -down-> _object_objectid_production_ : crm:P108i_was_produced_by
class _object_objectid_signature_ as "<object/(objectid)/signature>"
_object_objectid_ -up-> _object_objectid_signature_ : crm:P65_shows_visual_item
class _object_objectid_type_ as "<object/(objectid)/type>"
_object_objectid_ -up-> _object_objectid_type_ : crmx:P2_type
class _object_status_objectstatusid_ as "<object/status/(objectstatusid)>"
_object_objectid_ -down-> _object_status_objectstatusid_ : crmx:P2_status
class aat_classification_aatid_ as "aat:(classification.aatid)"
_object_objectid_ -up-> aat_classification_aatid_ : crmx:P2_classification
_object_objectid_ -down-> ulan_500115988_agent : crm:P52_has_current_owner
_object_objectid_ : {field}  <color:red>"\n<objects> := objects where \n  departmentid in (1,2,3,4,5,6,12)\n  and objectstatus in (1) -- Permanent Collection; not Deaccessioned \n  and publicaccess=1\n  and exists (select * from -- Tombstone cataloging='Completed'\n    userfieldxrefs where id=objectid and contextid=1 and userfieldid=36 and fieldvalue='Completed')\n  -- and curatorapproved=0  \n"</color>
_object_objectid_ : {field} crmx:sort_order "(sortnumber)"^^xsd:decimal
class _object_objectid_culture_objcontextid_ as "<object/(objectid)/culture/(objcontextid)>"
_object_objectid_culture_objcontextid_ : {field} a crm:E4_Period
_object_objectid_culture_objcontextid_ : {field}  <color:red>"\n<objects>, objcontext\n where objects.objectid=objcontext.objectid\n  and culture is not null\n"</color>
_object_objectid_culture_objcontextid_ : {field} crm:P3_has_note "(culture)"
_object_objectid_id_ : {field} a crm:E42_Identifier
_object_objectid_id_ : {field} crm:P2_has_type aat:300404012 # unique identifier
_object_objectid_id_ : {field} crm:P3_has_note "(objectid)"
_object_objectid_id_altnumid_ : {field} a crm:E42_Identifier
_object_objectid_id_altnumid_ -down-> _id_type_urlify_description_ : crm:P2_has_type
_object_objectid_id_altnumid_ : {field}  <color:red>"\n<objects>, altnums\n where altnums.tableid=108\n  and objects.objectid=altnums.id\n-- TODO MUSLOD-9: \n-- map description to AAT or urlify it?\n-- ignore remarks?\n"</color>
_object_objectid_id_altnumid_ : {field} crm:P3_has_note "(altnum)"
_object_objectid_inscription_ : {field} a crm:E34_Inscription
_object_objectid_inscription_ : {field} crm:P2_has_type aat:300028702 # inscription
_object_objectid_inscription_ : {field} crm:P3_has_note "(inscribed)"
_object_objectid_marking_ : {field} a crm:E37_Mark
_object_objectid_marking_ : {field} crm:P2_has_type aat:300028744 # mark
_object_objectid_marking_ : {field} crm:P3_has_note "(markings)"
_object_objectid_number_ : {field} a crm:E42_Identifier
_object_objectid_number_ : {field} crm:P2_has_type aat:300312355 # accession number
_object_objectid_number_ : {field} crm:P3_has_note "(objectnumber)"
_object_objectid_production_ : {field} a crm:E12_Production
_object_objectid_production_ -down-> _object_objectid_culture_objcontextid_ : crm:P10_falls_within
class _object_objectid_production_date_ as "<object/(objectid)/production/date>"
_object_objectid_production_ -down-> _object_objectid_production_date_ : crm:P4_has_time-span
_object_objectid_production_ : {field}  <color:red>"\n<objects>\n where dated is not null or datebegin is not null or dateend is not null\n"</color>
_object_objectid_production_date_ : {field} a crm:E52_Time-Span
_object_objectid_production_date_ : {field} crm:P3_has_note "(dated)"
_object_objectid_production_date_ : {field} crm:P82a_begin_of_the_begin "(datebegin)"^^xsd:gYear
_object_objectid_production_date_ : {field} crm:P82b_end_of_the_end "(dateend)"^^xsd:gYear
_object_objectid_signature_ : {field} a crm:E37_Mark
_object_objectid_signature_ : {field} crm:P2_has_type aat:300028705 # signature
_object_objectid_signature_ : {field} crm:P3_has_note "(signed)"
_object_objectid_type_ : {field} a skos:Concept
_object_objectid_type_ : {field} skos:prefLabel "(objectname)"
class _object_status_ as "<object/status/>"
_object_status_ : {field} a skos:ConceptScheme
_object_status_ : {field} rdfs:label "Object status"
_object_status_objectstatusid_ : {field} a crm:E55_Type
_object_status_objectstatusid_ -down-> _object_status_ : skos:inScheme
_object_status_objectstatusid_ : {field}  <color:red>"\nobjectstatus\n where objectstatusid in (1,3)\n"</color>
_object_status_objectstatusid_ : {field} skos:prefLabel "(objectstatus)"
aat_classification_aatid_ : {field}  <color:red>"\n<objects>, classification\n where object.classificationid=classification.classificationid\n"</color>
aat_classification_aatid_ : {field} skos:prefLabel "(classification)"
ulan_500115988_agent : {field} a crm:E40_Legal_Body
ulan_500115988_agent : {field}  <color:red>"\n<objects>\n where objectstatus=1 -- Permanent Collection\n"</color>
ulan_500115988_agent : {field} rdfs:label "JPGM"
@enduml
