DB Schema

About

This page contains description of different collection fields and their meanings.

"_id" field is ommited in all collections except objects because only there it has String type and in all other it is ObjectId.

binary_info 

{
 "binary_id" :{"type": "ObjectId", "description": "corresponding media id"},
 "name" : {"type": "String"},
 "description" : {"type": "String"}
}

dict_ru 

  "forms" : {
    "type": "array",
    "description": "wordforms array", 
    "items": {
      "type": "String"
    }
  }
  "tag" : {"type": "String", "description": "main form of tag"}
}

histories

  "objects" :{
    "type": "array",
    "description": "array of history related objects", 
    "items": {
      "type": "String",
      "description" : "_id of history related object"
    }
  }, 
  "name" :{
    "type": "String",
    "description": "history name on default language", 
  },
  "key" :{
    "type": "String",
    "description": "_id of key object", 
  },
  "description" :{
    "type": "String",
    "description": "history name on default language", 
}

lang_histories 

Language_code can have next values - "en", "fi".

{  

  "language_code" :
    "name" :{
      "type": "String",
      "description": "history name on language = language_code", 
     },
     "description" :{
       "type": "String",
       "description": "history name on language = language_code", 
  },
  "key" :{
    "type": "String",
    "description": "_id of key object", 
  },
}

lang_objects

{
  "ru" :{
    "type": "String",
    "description": "_id of Russian translation object", 
  },
  "en" :{
    "type": "String",
    "optional": true,
    "description": "_id of English translation object", 
  },
  "fi" :{
    "type": "String",
    "optional" : true,
    "description": "_id of Finish translation object", 
  }
}

museum_names

{
  "museum" :{
    "type": "String",
    "description": "Localized museum name", 
  },
  "language" :{
    "type": "Language code",
  }
}

museums_meta 

{
  "plan_id" : {
    "type": "ObjectId",
    "description": "id of corresponding plan"
  },
  "translations" : { 
    "type": "array",
    "items": {
      "type": "object",
      "properties":{
        "language_code": {
          "type": "array",
          "description": "museum name translated to language_code"
        }
      }
    }
}

museums_route

{
  "link" : {
  "type": "String",
    "description": "relative link to page with museum description"
  },
  "name" :{
  "type": "String",
    "description": "localized museum name"
  }
}

museums

TODO - describe entry in schema format.  KM-1512 - Getting issue details... STATUS

objects

TODO - describe fields.

Mandatory fields:

{

  "_id":{
    "type": "String",
    "description": "object id (guid)"
  },
  "name"
    "type": "array",
    "items": {"type": "String"}
  }
}

Optional fields:

{
  "ID" : {"type": "String", "description": "Inventor number"}, 
  "audio": { 
  "type": "array",
    "items": {"type": "ObjectId", "description": "ids of audio files related to object"}
  },
  "author"  : {"type": "String", "description": "Object author"},
  "bc"  : {"type": "String", "description": "If set to \"true\", then it means, that object was created before Christ"},
"brief":    {"type": "String", "description": "Brief description"},
"century": {"type": "integer"},
"century_end": {"type": "integer"},
"century_start":: {"type": "integer"},
"class": {
    "type": "String", 
    "values": ["Музейный предмет", "Статья", "Недвижимое наследие", "Документ", "Аудио/Видео", "Персоналия", "Изобразительный материал"]
  },
"comments": { 
  "type": "array",
    "items": {"type": "String"}
  },
  "description_author"  : {"type": "String"},
"full"  : {"type": "String", "description": "Full description"},
"images": { 
    "type": "array",
    "items": {"type": "ObjectId", "description": "ids of image files related to object"}
  },
  "latitude" : {"type": "double"},
"links": { 
  "type": "array",
    "items": {"type": "String"}
  },
  "literature": { 
  "type": "array",
    "items": {"type": "String"}
  },
  "location"  : {"type": "String", "description": "Name of the museum, where object is exhibited"},
"location_name"   : {"type": "String", "description": "Name of the museum, where object is exhibited"},
"location_on_plan"  : {"type": "String", "description": "Obsoleted"},
"longitude" : {"type": "double"},
"material": {"type": "String"},
"millennium" : {"type": "integer"},
"millennium_end" : {"type": "integer"},
"millennium_start" : {"type": "integer"},
"rightholder": {"type": "String"},
"rubrik" : {
    "type": "String",
    "values": ["Народная культура (этнография и фольклор)", "Камень и архитектура", "Война", "Транспортные пути", "Месторождение"]
  },
"showcase"   : {"type": "String", "description": "Number of the showcase"},
"site"  : {"type": "String", "description": "Name of the place, where object where found"},
"technol":   : {"type": "String", "description": "Technology"},
"type"  : {"type": "String"},
"video": { 
  "type": "array",
    "items": {"type": "ObjectId", "description": "ids of video files related to object"}
  },
  "virtual_sortavala" : {"type": "String", "description": "If set to \"true\", then it means, that object is related to VirtualSortavala"},
"year" : {"type": "integer"},
"year_end" : {"type": "integer"},
"year_start" : {"type": "integer"}
}

panorama and plan_panorama 

{
  "lat_" : {
    "type": "double",
    "description": "latitude of a marker"
  },
  "lon_" : {
    "type": "double",
    "description": "longitue of a marker"
  },
  "obj_id" : {
    "type": "String",
    "description": "_id of object related to marker", 
  }
}

plans

{
  "background" : { 
    "type": "String", 
    "description" : "url to background image (not svg), which is drawn behind image_url svg"
  },
  "bottom_lat" :  { "type": "double", "description" : "latitude of bottom left corner"},
  "bottom_lon" :  { "type": "double", "description" : "longitude of bottom left corner"},
  "image_url" : { "type": "String", "description" : "url to svg background of plan"},
  "name" :  { "type": "String", "description" : "name of the plan"},
  "plan_markers" :{
    "type": "Array", 
    "description": "displayed markers", 
    "items": {
      "type": "object", 
      "properties": {
        "element": {
          "type": "object", 
          "description" : "single marker, displayed on plan",
          "properties": {
            "y" :  { "type": "double", "description" : "marker position relatevely to top left corner by y axis"},  
            "x" : { "type": "double", "description" : "marker position relatevely to top left corner by x axis"},  
            "object_name" : { "type": "String", "description" : "object name for hint at plan editor"},  
            "guid" : { "type": "String", "description" : "object _id"} 
        }
      }
    }
  "top_lat" :  { "type": "double", "description": "latitude of top right corner"},
  "top_lon" :  { "type": "double", "description": "longitude of top right corner"},
}

tags 

  "tag" : { "type": "String", "description": "tag main form"},
  "forms" : {  
      "type": "Array", 
      "items": {
        "type": "String", 
        "description" : "tag wordform entered by user manualy"     
      } 
  },
  "language" :  {
    "type": "String", 
    "description": "language code of tag (not used)"
  }
}

word_form_dicts

  "type" : {
    "type": "String", 
    "description": "dictionary type, for the current moment have only one value - full, which mean dictionary with structure as in dict_ru"
  },
  "name" : {"type": "String", "description": "dictionary collection name"}, 
  "language" :  {"type": "String", "description": "language code of dictionary"}
}