Data Object JSON v1

From ECRIN-MDR Wiki
Jump to navigation Jump to search

Version 1 of the JSON schema for the Data Object file is shown below.
This version was created in January 2019 as an initial proposal.

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://ecrin.org/json_schemas/mdrdataobject/v2.json",
    "title": "XDC Data Object definition",
    "description": "ECRIN Metadata Repository for clinical research objects, Data Object JSON definition, version 1 January 2019",

    "type": "object",
    "required": ["Id", "ObjectTitle", "ClassId", "TypeId", "CreationYear", "AccessTypeId"],
    "additionalProperties": false,
    "properties": {
    
        "Id": {
            "type": "integer",
            "description": "Internal accession number of the data object within MDR database"
        },
        
        "DOI": {
            "type": "string",
            "description": "The doi (without prefixes, beginning with '10...') of the object, if it has one"
        },
        
        "ObjectTitle": {
            "type": "string",
            "description": "The title of the object - if a unique title is not part of the source data it may be a composite of the study title and the object type"
        },
        
        "Version": {
            "type": "string",
            "description": "Indication of version if there is one, in the format of the source data"
        },
        
        "ClassId": {
            "type": "integer",
             "description": "An integer referencing the relevant record in the object_classes enumeration / lookup table"
        },
                
        "TypeId": {
            "type": "integer",
            "description": "An integer referencing the relevant record in the object_types enumeration / lookup table"
        },
               
        "CreationYear": {
            "type": "integer",
            "description": "A four digit number indicating the year the object was created"
        },
        
        "LanguageCode": {
            "type": "string",
            "description": "A two letter ISO 369-1 code indicating the language of the data object"
        },
        
        "ManagingOrgId": {
            "type": "integer",
            "description": "The Id of the organisation responsible for the management of access to the data object"
        },
        
        "AccessTypeId": {
            "type": "integer",
             "description": "An integer referencing the relevant record in the object_access_types enumeration / lookup table"
         },
                        
        "AccessDetails": {
            "type": "string",
            "description": "A textual description of the access being offered, for example identifying the groups to which access is granted, the criteria on which a case-by-case decision would be based, any further restrictions on on-screen access, etc."
        },
        
        "AccessDetailsURL": {
            "type": "string",
            "format" : "uri",
            "description": "A url of a web page that provides details of the accesss available, possibly including the practical details required or a form to use to apply for access"
        },
        
        "RecordKeyTypeId": {
            "type": "integer",
            "description": "An integer referencing the relevant record in the dataset_recordkey_types enumeration / lookup table"
        },
                
        "RecordKeyDetails": {
            "type": "string",
            "description": "Provides further details of the record key types, perhaps referring to dataset preparation, if available"
        },

        "IdentifierTypeId": {
            "type": "integer",
                "description": "An integer referencing the relevant record in the dataset_identifier_types enumeration / lookup table"
            },
                
        "IdentifierDetails": {
            "type": "string",
            "description": "Provides further details of the identifiers in the dataset, perhaps referring to dataset preparation, if available"
        },
        
        "ConsentTypeId": {
            "type": "integer",
                "description": "An integer referencing the relevant record in the dataset_consent_types enumeration / lookup table"
            },
               
        "ConsentDetails": {
            "type": "string",
            "description": "Provides further details of the consent for secondary use associated with the dataset, if available"
        },
        
        "ObjectOtherIdentifiers": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the value and type of the identifier, and optionally its date and organisation of origin",
                "required": ["Id", "IdentifierValue", "IdentifierTypeId"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Data object identifier record primary key, generated automatically in database"
                    },
                    "IdentifierValue": {
                        "type": "string",
                        "description": "The identifier value, in a standardised format (for each identifier type)"
                    },
                    "IdentifierTypeId": {
                        "type": "integer",
                        "description": "An integer referencing the relevant record in the identifier_types enumeration / lookup table"
                    },
                    "DateApplied": {
                        "type": "string",
                        "format": "date",
                        "description": "The date the identifier was allocated, if known"
                    },
                    "OrgId": {
                       "type": "integer",
                        "description": "An integer referencing an organisation record in the ECRIN context database system"
                    }
                }
            }
        },
        
        "ObjectOtherTitles": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the type and value of the 'other title'",
                "required": ["Id", "TitleTypeId", "TitleText"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Object other title record primary key, generated automatically in database"
                    },
                    "TitleTypeId": {
                        "type": "integer",
                        "description": "An integer referencing the relevant record in the title_types enumeration / lookup table"
                    },
                    "TitleText": {
                        "type": "string"
                    }
                }
            }
        },
        
        "ObjectContributors": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the people and / or organisations that contributed to the data object, directly or indirectly",
                "required": ["Id", "ContributionTypeId"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Object contributor record primary key, generated automatically in database"
                    },
                    "ContributionTypeId": {
                        "type": "integer",
                        "description": "An integer referencing the relevant record in the contribution_types enumeration / lookup table"
                    },
                    "IsPerson": {
                        "type": "boolean",
                        "description": "Indicates whether the contributor is a person or an organisation or group"
                    },
                    "PersonId": {
                        "type": "integer",
                        "description": "An integer referencing a person record in the ECRIN context database system"
                    },
                    "OrgId": {
                        "type": "integer",
                        "description": "An integer referencing an organisation record in the ECRIN context database system"
                    }
                }
            }
        },
        
        "ObjectDates": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the date and its type",
                "required": ["Id", "DateTypeId", "IsDateRange", "StartDate"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Object date record primary key, generated automatically in database"
                    },
                    "DateTypeId": {
                        "type": "integer",
                        "description": "An integer referencing the relevant record in the date_types enumeration / lookup table"
                    },
                    "IsDateRange": {
                        "type": "boolean",
                        "default": false,
                        "description": "If true both start and end dates should be considered, otherwise just the start date"
                    },
                    "StartDate": {
                        "type": "string",
                        "format": "date",
                        "description": "The date being referenced, or if a range the start date"
                    },
                    "EndDate": {
                        "type": "string",
                        "format": "date",
                        "description": "The end date of a date range"
                    }
                }
            }
        },

        "ObjectDescriptions": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the description and its type",
                "required": ["Id", "Description"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Object description record primary key, generated automatically in database"
                    },
                    "Description": {
                        "type": "string",
                        "description": "The description text, as it appears in the source data"
                    },
                    "LanguageCode": {
                        "type": "string",
                        "default": "en",
                        "description": "A two letter ISO 369-1 code indicating the language of the data object"
                    }
                }
            }
        },

        "ObjectInstances": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the nature of a specific instance of a data object, e.g. a file or a web page",
                "required": ["Id", "RepositoryOrgId", "FileTypeId"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Object instance record primary key, generated automatically in database"
                    },
                    "RepositoryOrgId": {
                        "type": "integer",
                        "description": "The Id of the organisation running the repository containing the object (may be different from the organisation managing access)"
                    },
                    "URL":{
                        "type": "string",
                        "format": "uri",
                        "description": "The url where the object can be accessed, if one exists"
                    }, 
                    "URLDirectlyAccessible":{
                        "type": "boolean",
                        "description": "Whether or not the access via the url is public and freely available"
                    }, 
                    "URLLastChecked": {
                        "type": "string",
                        "format": "date",
                        "description": "If publicly available, the date the url was last checked"
                    },
                    "FileTypeId": {
                        "type": "integer",
                        "description": "An integer referencing the relevant record in the file_types enumeration / lookup table"
                    },
                    "ResourceSize":{
                        "type": "integer",
                        "description": "A number indicating the size of the resource"
                    }, 
                    "ResourceSizeUnitsId":{
                        "type": "string",
                        "description": "An integer referencing the relevant record in the size_units enumeration / look up table"
                    }
                }
            }
        },

        "ObjectRelationships": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates any related data object and the nature of the relationship",
                "required": ["Id", "RelationshipId", "DataObjectBId"],
                "properties": {
                    "Id": {
                        "type": "integer",
                        "description": "Object relationships record primary key, generated automatically in database"
                    },
                    "RelationshipId": {
                        "type": "integer",
                        "description": "An integer referencing the relevant record in the object_relationship_types enumeration / lookup table"
                    },
                    "DataObjectBId": {
                        "type": "integer",
                        "description": "The id, i.e. internal accession number, of the related object"
                    }
                }
            }
        },    
        
        "RelatedStudies": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "StudyId": {
                        "type": "integer",
                        "description": "The id, i.e. internal accession number, of the linked study"
                    }
                }
            }
        }
        
    }

}