diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 000000000..fe461b424 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,20 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v3 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v2 diff --git a/.htaccess b/.htaccess index eee07900b..6cb557cb8 100644 --- a/.htaccess +++ b/.htaccess @@ -1,2 +1,11 @@ Options -Indexes + + Header set X-Frame-Options "SAMEORIGIN" + Header set X-XSS-Protection "1; mode=block" + Header set X-Content-Type-Options "nosniff" + Header set Referrer-Policy "same-origin" + + #always connect via https + Header set Strict-Transport-Security "max-age=31536000; includeSubDomains" + diff --git a/README.md b/README.md index 663f59e5a..9a2ddf006 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,34 @@ NADA is an open source microdata cataloging system, compliant with the Data Docu * MySQL or Microsoft SQL Server database * Apache, IIS or NGINX +### Documentation + +User and admin guide - https://ihsn.github.io/nada-documentation/ + + ### Installation -- Please see the [NADA installation guide](https://ihsn.github.io/nada-documentation/installation-guide) +System requirements and steps for installation - [NADA installation guide](https://ihsn.github.io/nada-documentation/installation-guide/). ### Upgrading from older versions of NADA -- Please see the [NADA upgrade guide](https://nada.readthedocs.io/en/v5.0/upgrade-from-4.4-to-5.html). +Documentation for upgrading from various versions - [NADA upgrade guide](https://ihsn.github.io/nada-documentation/installation-guide/upgrade/). + +### Schema guide + +NADA supports multiple data types that include `Microdata` (DDI CodeBook 2.5), `Document`, `Table`, `Geospatial`, `Timeseries`, `Visualization` and `Image`. For all data types, documentation is available in the draft guide (https://mah0001.github.io/schema-guide/). See our demo catalog show casing all support data types - https://nada-demo.ihsn.org/index.php/catalog/ + +### API documentation + +The API documentation is available in OpenAPI/Swagger format here - https://ihsn.github.io/nada-api-redoc/catalog-admin/ + +For Getting started with the API, read the `Administrator Guide` section which covers both using the web interface and the API - https://ihsn.github.io/nada-documentation/getting-started/#publishing-a-document + +### API Client tools + +* R package - https://github.com/mah0001/nadar +* Python package - https://pypi.org/project/pynada/ ## Versioning diff --git a/api-documentation/catalog-admin/datafile-schema.json b/api-documentation/catalog-admin/datafile-schema.json index 6e1b7e1e4..a74e542ac 100644 --- a/api-documentation/catalog-admin/datafile-schema.json +++ b/api-documentation/catalog-admin/datafile-schema.json @@ -12,6 +12,11 @@ "type": "string", "title" : "File name" }, + "file_type": { + "type": "string", + "title" : "File type", + "description": "Types of data files include raw data (ASCII, EBCDIC, etc.) and software-dependent files such as SAS datasets, SPSS export files, etc." + }, "description": { "type": "string", "title": "File description" diff --git a/api-documentation/catalog-admin/ddi-schema.json b/api-documentation/catalog-admin/ddi-schema.json index d485bff95..5c5cd7b78 100644 --- a/api-documentation/catalog-admin/ddi-schema.json +++ b/api-documentation/catalog-admin/ddi-schema.json @@ -1,770 +1,781 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://ihsn.org/schemas/ddi2-codebook", - "version":"0.0", - "title":"Survey Microdata Schema Draft", - "description":"Schema for Survey data type based on DDI 2.5", - "definitions":{ - "doc_desc":{ - "type":"object", - "title":"Document Description", - "description":"Document Description", - "_ddi_xpath":"docDscr", - "properties":{ - "title":{ - "title":"Document title", - "description":"Document title", - "type":"string", - "_ddi_xpath":"docDscr/citation/titlStmt/titl" + "version": "0.0", + "title": "Survey Microdata Schema Draft", + "description": "Schema for Survey data type based on DDI 2.5", + "definitions": { + "doc_desc": { + "type": "object", + "title": "Document Description", + "description": "Document Description", + "_ddi_xpath": "docDscr", + "properties": { + "title": { + "title": "Document title", + "description": "Document title", + "type": "string", + "_ddi_xpath": "docDscr/citation/titlStmt/titl" }, - "idno":{ - "title":"Unique ID number for the document", - "type":"string", - "_ddi_xpath":"docDscr/citation/titlStmt/IDNo" + "idno": { + "title": "Unique ID number for the document", + "type": "string", + "_ddi_xpath": "docDscr/citation/titlStmt/IDNo" }, - "producers":{ - "type":"array", - "title":"Producers", - "description":"List of producers", - "_ddi_xpath":"docDscr/citation/prodStmt/producer", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "description":"Name (required)", - "type":"string" + "producers": { + "type": "array", + "title": "Producers", + "description": "List of producers", + "_ddi_xpath": "docDscr/citation/prodStmt/producer", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Name (required)", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" }, - "affiliation":{ - "type":"string", - "title":"Affiliation" + "affiliation": { + "type": "string", + "title": "Affiliation" }, - "role":{ - "title":"Role", - "type":"string" + "role": { + "title": "Role", + "type": "string" } } }, - "required":[ + "required": [ "name" ] }, - "prod_date":{ - "title":"Date of Production", - "description":"Document production date using format(YYYY-MM-DD)", - "type":"string", - "_ddi_xpath":"docDscr/citation/prodStmt/prodDate" + "prod_date": { + "title": "Date of Production", + "description": "Document production date using format(YYYY-MM-DD)", + "type": "string", + "_ddi_xpath": "docDscr/citation/prodStmt/prodDate" }, - "version_statement":{ - "type":"object", - "title":"Version Statement", - "description":"Version Statement", - "_ddi_xpath":"docDscr/citation/verStmt", - "properties":{ - "version":{ - "title":"Version", - "type":"string", - "_ddi_xpath":"docDscr/citation/verStmt/version" + "version_statement": { + "type": "object", + "title": "Version Statement", + "description": "Version Statement", + "_ddi_xpath": "docDscr/citation/verStmt", + "properties": { + "version": { + "title": "Version", + "type": "string", + "_ddi_xpath": "docDscr/citation/verStmt/version" }, - "version_date":{ - "title":"Version Date", - "type":"string", - "_ddi_xpath":"docDscr/citation/verStmt/version/@date" + "version_date": { + "title": "Version Date", + "type": "string", + "_ddi_xpath": "docDscr/citation/verStmt/version/@date" }, - "version_resp":{ - "title":"Version Responsibility Statement", - "description":"The organization or person responsible for the version of the work", - "type":"string", - "_ddi_xpath":"docDscr/citation/verStmt/verResp" + "version_resp": { + "title": "Version Responsibility Statement", + "description": "The organization or person responsible for the version of the work", + "type": "string", + "_ddi_xpath": "docDscr/citation/verStmt/verResp" }, - "version_notes":{ - "title":"Version Notes", - "type":"string", - "_ddi_xpath":"docDscr/citation/verStmt/notes" + "version_notes": { + "title": "Version Notes", + "type": "string", + "_ddi_xpath": "docDscr/citation/verStmt/notes" } } } }, - "additionalProperties":false + "additionalProperties": false }, - "study_desc":{ - "type":"object", - "description":"Study Description", - "_ddi_xpath":"stdyDscr", - "properties":{ - "title_statement":{ - "type":"object", - "description":"Study title", - "_ddi_xpath":"stdyDscr/citation/titlStmt", - "properties":{ - "idno":{ - "type":"string", - "title":"Unique user defined ID", - "description":"The ID number of a dataset is a unique number that is used to identify a particular survey. Define and use a consistent scheme to use. Such an ID could be constructed as follows: country-producer-survey-year-version where \n - country is the 3-letter ISO country abbreviation \n - producer is the abbreviation of the producing agency \n - survey is the survey abbreviation \n - year is the reference year (or the year the survey started) \n - version is the number dataset version number (see Version Description below)", - "_ddi_xpath":"stdyDscr/citation/titlStmt/IDNo" + "study_desc": { + "type": "object", + "description": "Study Description", + "_ddi_xpath": "stdyDscr", + "properties": { + "title_statement": { + "type": "object", + "description": "Study title", + "_ddi_xpath": "stdyDscr/citation/titlStmt", + "properties": { + "idno": { + "type": "string", + "title": "Unique user defined ID", + "description": "The ID number of a dataset is a unique number that is used to identify a particular survey. Define and use a consistent scheme to use. Such an ID could be constructed as follows: country-producer-survey-year-version where \n - country is the 3-letter ISO country abbreviation \n - producer is the abbreviation of the producing agency \n - survey is the survey abbreviation \n - year is the reference year (or the year the survey started) \n - version is the number dataset version number (see Version Description below)", + "_ddi_xpath": "stdyDscr/citation/titlStmt/IDNo" }, - "identifiers":{ - "type":"array", - "title":"Other identifiers", - "description":"Other identifiers", - "items":{ - "type":"object", - "properties":{ - "type":{ - "title":"Identifier type", - "description":"Type of identifier e.g. `doi`, `handle`, `other`", - "type":"string" + "identifiers": { + "type": "array", + "title": "Other identifiers", + "description": "Other identifiers", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Identifier type", + "description": "Type of identifier e.g. `doi`, `handle`, `other`", + "type": "string" }, - "identifier":{ - "title":"Identifier", - "type":"string" + "identifier": { + "title": "Identifier", + "type": "string" } }, - "required":[ + "required": [ "identifier" ] } }, - - "title":{ - "type":"string", - "title":"Survey title", - "description":"The title is the official name of the survey as it is stated on the questionnaire or as it appears in the design documents. The following items should be noted:\n - Include the reference year(s) of the survey in the title. \n - Do not include the abbreviation of the survey name in the title. \n - As the survey title is a proper noun, the first letter of each word should be capitalized (except for prepositions or other conjunctions).\n - Including the country name in the title is optional.", - "_ddi_xpath":"stdyDscr/citation/titlStmt/titl" + "title": { + "type": "string", + "title": "Survey title", + "description": "The title is the official name of the survey as it is stated on the questionnaire or as it appears in the design documents. The following items should be noted:\n - Include the reference year(s) of the survey in the title. \n - Do not include the abbreviation of the survey name in the title. \n - As the survey title is a proper noun, the first letter of each word should be capitalized (except for prepositions or other conjunctions).\n - Including the country name in the title is optional.", + "_ddi_xpath": "stdyDscr/citation/titlStmt/titl" }, - "sub_title":{ - "type":"string", - "title":"Survey subtitle", - "description":"A short subtitle for the survey", - "_ddi_xpath":"stdyDscr/citation/titlStmt/subTitl" + "sub_title": { + "type": "string", + "title": "Survey subtitle", + "description": "A short subtitle for the survey", + "_ddi_xpath": "stdyDscr/citation/titlStmt/subTitl" }, - "alternate_title":{ - "type":"string", - "title":"Abbreviation or Acronym", - "description":"The abbreviation of a survey is usually the first letter of each word of the titled survey. The survey reference year(s) may be included.", - "_ddi_xpath":"stdyDscr/citation/titlStmt/altTitl" + "alternate_title": { + "type": "string", + "title": "Abbreviation or Acronym", + "description": "The abbreviation of a survey is usually the first letter of each word of the titled survey. The survey reference year(s) may be included.", + "_ddi_xpath": "stdyDscr/citation/titlStmt/altTitl" }, - "translated_title":{ - "title":"Translated Title", - "description":"In countries with more than one official language, a translation of the title may be provided.", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/titlStmt/parTitl" + "translated_title": { + "title": "Translated Title", + "description": "In countries with more than one official language, a translation of the title may be provided.", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/titlStmt/parTitl" } }, - "required":[ + "required": [ "idno", "title" ] }, - "authoring_entity":{ - "type":"array", - "title":"Authoring entity/Primary investigators", - "description":"The person, corporate body, or agency responsible for the work's substantive and intellectual content. Repeat the element for each author, and use 'affiliation' attribute if available. Invert first and last name and use commas.", - "_ddi_xpath":"stdyDscr/citation/rspStmt/AuthEnty", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Agency Name", - "type":"string" + "authoring_entity": { + "type": "array", + "title": "Authoring entity/Primary investigators", + "description": "The person, corporate body, or agency responsible for the work's substantive and intellectual content. Repeat the element for each author, and use 'affiliation' attribute if available. Invert first and last name and use commas.", + "_ddi_xpath": "stdyDscr/citation/rspStmt/AuthEnty", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Agency Name", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "oth_id":{ - "type":"array", - "title":"Other Identifications/Acknowledgments", - "description":"Acknowledge any other people and institutions that have in some form contributed to the survey", - "_ddi_xpath":"stdyDscr/citation/rspStmt/othId", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "description":"Person or Agency name", - "type":"string" + "oth_id": { + "type": "array", + "title": "Other Identifications/Acknowledgments", + "description": "Acknowledge any other people and institutions that have in some form contributed to the survey", + "_ddi_xpath": "stdyDscr/citation/rspStmt/othId", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Person or Agency name", + "type": "string" }, - "role":{ - "title":"Role", - "type":"string" + "role": { + "title": "Role", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "production_statement":{ - "type":"object", - "title":"Production Statement", - "description":"Production Statement", - "_ddi_xpath":"stdyDscr/citation/prodStmt", - "properties":{ - "producers":{ - "type":"array", - "title":"Producers", - "description":"List of producers", - "_ddi_xpath":"stdyDscr/citation/prodStmt/producer", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "description":"Name (required)", - "type":"string" + "production_statement": { + "type": "object", + "title": "Production Statement", + "description": "Production Statement", + "_ddi_xpath": "stdyDscr/citation/prodStmt", + "properties": { + "producers": { + "type": "array", + "title": "Producers", + "description": "List of producers", + "_ddi_xpath": "stdyDscr/citation/prodStmt/producer", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Name (required)", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" }, - "affiliation":{ - "type":"string", - "title":"Affiliation" + "affiliation": { + "type": "string", + "title": "Affiliation" }, - "role":{ - "title":"Role", - "type":"string" + "role": { + "title": "Role", + "type": "string" } } }, - "required":[ + "required": [ "name" ] }, - "copyright":{ - "title":"Copyright", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/prodStmt/copyright" + "copyright": { + "title": "Copyright", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/prodStmt/copyright" }, - "prod_date":{ - "title":"Production Date", - "description":"Date when the marked-up document/marked-up document source/data collection/other material(s) were produced (not distributed or archived). The ISO standard for dates (YYYY-MM-DD) is recommended for use with the date attribute. Production date for data collection (2.1.3.3) maps to Dublin Core Date element.", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/prodStmt/prodDate" + "prod_date": { + "title": "Production Date", + "description": "Date when the marked-up document/marked-up document source/data collection/other material(s) were produced (not distributed or archived). The ISO standard for dates (YYYY-MM-DD) is recommended for use with the date attribute. Production date for data collection (2.1.3.3) maps to Dublin Core Date element.", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/prodStmt/prodDate" }, - "prod_place":{ - "title":"Production Place", - "description":"Address of the archive or organization that produced the work", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/prodStmt/prodPlac" + "prod_place": { + "title": "Production Place", + "description": "Address of the archive or organization that produced the work", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/prodStmt/prodPlac" }, - "funding_agencies":{ - "type":"array", - "title":"Funding Agency/Sponsor", - "description":"The source(s) of funds for production of the work. If different funding agencies sponsored different stages of the production process, use the 'role' attribute to distinguish them.", - "_ddi_xpath":"stdyDscr/citation/prodStmt/fundAg", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Funding Agency/Sponsor", - "type":"string" + "funding_agencies": { + "type": "array", + "title": "Funding Agency/Sponsor", + "description": "The source(s) of funds for production of the work. If different funding agencies sponsored different stages of the production process, use the 'role' attribute to distinguish them.", + "_ddi_xpath": "stdyDscr/citation/prodStmt/fundAg", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Funding Agency/Sponsor", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" }, - "grant":{ - "title":"Grant Number", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/prodStmt/grantNo" + "grant": { + "title": "Grant Number", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/prodStmt/grantNo" }, - "role":{ - "title":"Role", - "type":"string" + "role": { + "title": "Role", + "type": "string" } }, - "required":[ + "required": [ "name" ] } - } + } } }, - "distribution_statement":{ - "type":"object", - "title":"Distribution Statement", - "description":"Distribution Statement", - "_ddi_xpath":"stdyDscr/citation/distStmt", - "properties":{ - "distributors":{ - "type":"array", - "title":"Distributor", - "description":"The organization designated by the author or producer to generate copies of the particular work including any necessary editions or revisions. Names and addresses may be specified and other archives may be co-distributors. A URI attribute is included to provide an URN or URL to the ordering service or download facility on a Web site.", - "_ddi_xpath":"stdyDscr/citation/distStmt/distrbtr", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Organization name", - "description":"Organization name", - "type":"string" + "distribution_statement": { + "type": "object", + "title": "Distribution Statement", + "description": "Distribution Statement", + "_ddi_xpath": "stdyDscr/citation/distStmt", + "properties": { + "distributors": { + "type": "array", + "title": "Distributor", + "description": "The organization designated by the author or producer to generate copies of the particular work including any necessary editions or revisions. Names and addresses may be specified and other archives may be co-distributors. A URI attribute is included to provide an URN or URL to the ordering service or download facility on a Web site.", + "_ddi_xpath": "stdyDscr/citation/distStmt/distrbtr", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Organization name", + "description": "Organization name", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "uri": { + "title": "URI", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "contact":{ - "type":"array", - "title":"Contact", - "description":"Contact", - "_ddi_xpath":"stdyDscr/citation/distStmt/contact", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "contact": { + "type": "array", + "title": "Contact", + "description": "Contact", + "_ddi_xpath": "stdyDscr/citation/distStmt/contact", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "email": { + "title": "Email", + "type": "string" }, - "email":{ - "title":"Email", - "type":"string" + "uri": { + "title": "URI", + "type": "string" } } }, - "required":[ + "required": [ "name" ] }, - "depositor":{ - "type":"array", - "title":"Depositor", - "description":"Depositor", - "_ddi_xpath":"stdyDscr/citation/distStmt/depositr", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "depositor": { + "type": "array", + "title": "Depositor", + "description": "Depositor", + "_ddi_xpath": "stdyDscr/citation/distStmt/depositr", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" } } }, - "required":[ + "required": [ "name" ] }, - "deposit_date":{ - "title":"Date of Deposit", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/distStmt/depDate" + "deposit_date": { + "title": "Date of Deposit", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/distStmt/depDate" }, - "distribution_date":{ - "title":"Date of Distribution", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/distStmt/distDate" + "distribution_date": { + "title": "Date of Distribution", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/distStmt/distDate" } } }, - "series_statement":{ - "type":"object", - "title":"Series Statement", - "description":"Series Statement", - "_ddi_xpath":"stdyDscr/citation/serStmt", - "properties":{ - "series_name":{ - "title":"Series Name", - "description":"The name of the series to which the work belongs.", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/serStmt/serName" + "series_statement": { + "type": "object", + "title": "Series Statement", + "description": "Series Statement", + "_ddi_xpath": "stdyDscr/citation/serStmt", + "properties": { + "series_name": { + "title": "Series Name", + "description": "The name of the series to which the work belongs.", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/serStmt/serName" }, - "series_info":{ - "title":"Series Information", - "description":"A survey may be repeated at regular intervals (such as an annual labour force survey), or be part of an international survey program (such as the MICS, CWIQ, DHS, LSMS and others). The Series information is a description of this `collection` of surveys. A brief description of the characteristics of the survey, including when it started, how many rounds were already implemented, and who is in charge would be provided here.", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/serStmt/serInfo" + "series_info": { + "title": "Series Information", + "description": "A survey may be repeated at regular intervals (such as an annual labour force survey), or be part of an international survey program (such as the MICS, CWIQ, DHS, LSMS and others). The Series information is a description of this `collection` of surveys. A brief description of the characteristics of the survey, including when it started, how many rounds were already implemented, and who is in charge would be provided here.", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/serStmt/serInfo" } } }, - "version_statement":{ - "type":"object", - "title":"Version Statement", - "description":"Version Statement", - "_ddi_xpath":"stdyDscr/citation/verStmt", - "properties":{ - "version":{ - "title":"Version", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/verStmt/version" + "version_statement": { + "type": "object", + "title": "Version Statement", + "description": "Version Statement", + "_ddi_xpath": "stdyDscr/citation/verStmt", + "properties": { + "version": { + "title": "Version", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/verStmt/version" }, - "version_date":{ - "title":"Version Date", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/verStmt/version/@date" + "version_date": { + "title": "Version Date", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/verStmt/version/@date" }, - "version_resp":{ - "title":"Version Responsibility Statement", - "description":"The organization or person responsible for the version of the work", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/verStmt/verResp" + "version_resp": { + "title": "Version Responsibility Statement", + "description": "The organization or person responsible for the version of the work", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/verStmt/verResp" }, - "version_notes":{ - "title":"Version Notes", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/verStmt/notes" + "version_notes": { + "title": "Version Notes", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/verStmt/notes" } } }, - "bib_citation":{ - "type":"string", - "title":"Bibliographic Citation", - "description":"Complete bibliographic reference containing all of the standard elements of a citation that can be used to cite the work. The `'bib_citation_format'` field is provided to enable specification of the particular citation style used, e.g., APA, MLA, Chicago, etc.", - "_ddi_xpath":"stdyDscr/citation/biblCit" + "bib_citation": { + "type": "string", + "title": "Bibliographic Citation", + "description": "Complete bibliographic reference containing all of the standard elements of a citation that can be used to cite the work. The `'bib_citation_format'` field is provided to enable specification of the particular citation style used, e.g., APA, MLA, Chicago, etc.", + "_ddi_xpath": "stdyDscr/citation/biblCit" }, - "bib_citation_format":{ - "type":"string", - "title":"Bibliographic Citation Format", - "description":"Specification of the particular citation style used, e.g., `APA`, `MLA`, `Chicago`, etc.", - "_ddi_xpath":"stdyDscr/citation/biblCit/@format" + "bib_citation_format": { + "type": "string", + "title": "Bibliographic Citation Format", + "description": "Specification of the particular citation style used, e.g., `APA`, `MLA`, `Chicago`, etc.", + "_ddi_xpath": "stdyDscr/citation/biblCit/@format" }, - "holdings":{ - "type":"array", - "title":"Holdings Information", - "description":"Information concerning either the physical or electronic holdings of the cited work. Attributes include: location--The physical location where a copy is held; callno--The call number for a work at the location specified; and URI--A URN or URL for accessing the electronic copy of the cited work.", - "_ddi_xpath":"stdyDscr/citation/holdings", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "holdings": { + "type": "array", + "title": "Holdings Information", + "description": "Information concerning either the physical or electronic holdings of the cited work. Attributes include: location--The physical location where a copy is held; callno--The call number for a work at the location specified; and URI--A URN or URL for accessing the electronic copy of the cited work.", + "_ddi_xpath": "stdyDscr/citation/holdings", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" }, - "location":{ - "title":"Location", - "type":"string" + "location": { + "title": "Location", + "type": "string" }, - "callno":{ - "title":"Callno", - "type":"string" + "callno": { + "title": "Callno", + "type": "string" }, - "uri":{ - "title":"URI", - "type":"string" + "uri": { + "title": "URI", + "type": "string" } } }, - "required":[ + "required": [ "name" ] }, - "study_notes":{ - "title":"Study notes", - "type":"string", - "_ddi_xpath":"stdyDscr/citation/notes" + "study_notes": { + "title": "Study notes", + "type": "string", + "_ddi_xpath": "stdyDscr/citation/notes" }, - "study_authorization":{ - "type":"object", - "title":"Study Authorization", - "_ddi_xpath":"stdyDscr/studyAuthorization", - "description":"Provides structured information on the agency that authorized the study, the date of authorization, and an authorization statement", - "properties":{ - "date":{ - "title":"Authorization Date", - "type":"string", - "_ddi_xpath":"stdyDscr/studyAuthorization/@date" + "study_authorization": { + "type": "object", + "title": "Study Authorization", + "_ddi_xpath": "stdyDscr/studyAuthorization", + "description": "Provides structured information on the agency that authorized the study, the date of authorization, and an authorization statement", + "properties": { + "date": { + "title": "Authorization Date", + "type": "string", + "_ddi_xpath": "stdyDscr/studyAuthorization/@date" }, - "agency":{ - "type":"array", - "title":"Authorizing Agency", - "description":"The source(s) of funds for production of the work. If different funding agencies sponsored different stages of the production process, use the 'role' attribute to distinguish them.", - "_ddi_xpath":"stdyDscr/studyAuthorization/authorizingAgency", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Funding Agency/Sponsor", - "type":"string" + "agency": { + "type": "array", + "title": "Authorizing Agency", + "description": "The source(s) of funds for production of the work. If different funding agencies sponsored different stages of the production process, use the 'role' attribute to distinguish them.", + "_ddi_xpath": "stdyDscr/studyAuthorization/authorizingAgency", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Funding Agency/Sponsor", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "authorization_statement":{ - "title":"Authorization Statement", - "description":"Authorization Statement", - "_ddi_xpath":"stdyDscr/studyAuthorization/authorizationStatement", - "type":"string" + "authorization_statement": { + "title": "Authorization Statement", + "description": "Authorization Statement", + "_ddi_xpath": "stdyDscr/studyAuthorization/authorizationStatement", + "type": "string" } } }, - "study_info":{ - "type":"object", - "title":"Study Scope", - "description":"This section contains information about the data collection's scope across several dimensions, including substantive content, geography, and time.", - "_ddi_xpath":"stdyDscr/stdyInfo", - "properties":{ - "study_budget":{ - "title":"Study Budget", - "description":"Provide a clear summary of the pDescribe the budget of the project in as much detail as needed. Use XHTML structure elements to identify discrete pieces of information in a way that facilitates direct transfer of information on the study budget between DDI 2 and DDI 3 structures.urposes, objectives and content of the survey", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/studyBudget" + "study_info": { + "type": "object", + "title": "Study Scope", + "description": "This section contains information about the data collection's scope across several dimensions, including substantive content, geography, and time.", + "_ddi_xpath": "stdyDscr/stdyInfo", + "properties": { + "study_budget": { + "title": "Study Budget", + "description": "Provide a clear summary of the pDescribe the budget of the project in as much detail as needed. Use XHTML structure elements to identify discrete pieces of information in a way that facilitates direct transfer of information on the study budget between DDI 2 and DDI 3 structures.urposes, objectives and content of the survey", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/studyBudget" }, - "keywords":{ - "type":"array", - "description":"Keywords", - "_ddi_xpath":"stdyDscr/stdyInfo/subject/keywords", - "items":{ - "type":"object", - "properties":{ - "keyword":{ - "title":"Keyword", - "type":"string" + "keywords": { + "type": "array", + "description": "Keywords", + "_ddi_xpath": "stdyDscr/stdyInfo/subject/keywords", + "items": { + "type": "object", + "properties": { + "keyword": { + "title": "Keyword", + "type": "string" }, - "vocab":{ - "title":"Vocabulary", - "type":"string" + "vocab": { + "title": "Vocabulary", + "type": "string" }, - "uri":{ - "title":"uri", - "type":"string" - } + "uri": { + "title": "uri", + "type": "string" + } } } }, - "topics":{ - "type":"array", - "title":"Topic Classification", - "description":"Topic Classification", - "_ddi_xpath":"stdyDscr/stdyInfo/subject/topcClas", - "items":{ - "type":"object", - "properties":{ - "topic":{ - "title":"Topic", - "type":"string" + "topics": { + "type": "array", + "title": "Topic Classification", + "description": "Topic Classification", + "_ddi_xpath": "stdyDscr/stdyInfo/subject/topcClas", + "items": { + "type": "object", + "properties": { + "topic": { + "title": "Topic", + "type": "string" }, - "vocab":{ - "title":"Vocab", - "type":"string" + "vocab": { + "title": "Vocab", + "type": "string" }, - "uri":{ - "title":"URI", - "type":"string" + "uri": { + "title": "URI", + "type": "string" } }, - "required":[ + "required": [ "topic" ] } }, - "abstract":{ - "title":"Abstract", - "description":"Provide a clear summary of the purposes, objectives and content of the survey", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/abstract" + "abstract": { + "title": "Abstract", + "description": "Provide a clear summary of the purposes, objectives and content of the survey", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/abstract" }, - "time_periods":{ - "type":"array", - "title":"Time periods (YYYY/MM/DD)", - "description":"This field will usually be left empty. Time period differs from the dates of collection as they represent the period for which the data collected are applicable or relevant.", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/timePrd", - "items":{ - "type":"object", - "properties":{ - "start":{ - "title":"Start date", - "description":"Start date", - "type":"string" + "time_periods": { + "type": "array", + "title": "Time periods (YYYY/MM/DD)", + "description": "This field will usually be left empty. Time period differs from the dates of collection as they represent the period for which the data collected are applicable or relevant.", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/timePrd", + "items": { + "type": "object", + "properties": { + "start": { + "title": "Start date", + "description": "Start date", + "type": "string" }, - "end":{ - "title":"End date", - "description":"End date", - "type":"string" + "end": { + "title": "End date", + "description": "End date", + "type": "string" }, - "cycle":{ - "title":"Cycle", - "description":"Cycle", - "type":"string" + "cycle": { + "title": "Cycle", + "description": "Cycle", + "type": "string" } }, - "required":[ + "required": [ "start" ] } }, - "coll_dates":{ - "type":"array", - "title":"Dates of Data Collection (YYYY/MM/DD)", - "description":"Enter the dates (at least month and year) of the start and end of the data collection. In some cases, data collection for a same survey can be conducted in waves. In such case, you should enter the start and end date of each wave separately, and identify each wave in the 'cycle' field.", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/collDate", - "items":{ - "type":"object", - "properties":{ - "start":{ - "title":"Start date", - "description":"Start date", - "type":"string" + "coll_dates": { + "type": "array", + "title": "Dates of Data Collection (YYYY/MM/DD)", + "description": "Enter the dates (at least month and year) of the start and end of the data collection. In some cases, data collection for a same survey can be conducted in waves. In such case, you should enter the start and end date of each wave separately, and identify each wave in the 'cycle' field.", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/collDate", + "items": { + "type": "object", + "properties": { + "start": { + "title": "Start date", + "description": "Start date", + "type": "string" }, - "end":{ - "title":"End date", - "description":"End date", - "type":"string" + "end": { + "title": "End date", + "description": "End date", + "type": "string" }, - "cycle":{ - "title":"Cycle", - "description":"Cycle", - "type":"string" + "cycle": { + "title": "Cycle", + "description": "Cycle", + "type": "string" } }, - "required":[ + "required": [ "start" ] } }, - "nation":{ - "title":"Country", - "description":"Indicates the country or countries covered in the file. Field `abbreviation` may be used to list common abbreviations; use of ISO country codes is recommended. Maps to Dublin Core Coverage element. Inclusion of this element is recommended.", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/nation", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "description":"Country name", - "type":"string" + "nation": { + "title": "Country", + "description": "Indicates the country or countries covered in the file. Field `abbreviation` may be used to list common abbreviations; use of ISO country codes is recommended. Maps to Dublin Core Coverage element. Inclusion of this element is recommended.", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/nation", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Country name", + "type": "string" }, - "abbreviation":{ - "title":"Country code", - "description":"Country ISO code", - "type":"string" + "abbreviation": { + "title": "Country code", + "description": "Country ISO code", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "bbox":{ - "title":"Geographic bounding box", - "type":"array", - "_ddi_xpath":"stdyDscr/sumDscr/geoBndBox", - "items":{ - "type":"object", - "properties":{ - "west":{ - "title":"West", - "type":"string" + "bbox": { + "title": "Geographic bounding box", + "type": "array", + "_ddi_xpath": "stdyDscr/sumDscr/geoBndBox", + "items": { + "type": "object", + "properties": { + "west": { + "title": "West", + "type": "string" }, - "east":{ - "title":"East", - "type":"string" + "east": { + "title": "East", + "type": "string" }, - "south":{ - "title":"South", - "type":"string" + "south": { + "title": "South", + "type": "string" }, - "north":{ - "title":"North", - "type":"string" + "north": { + "title": "North", + "type": "string" } } } }, - "bound_poly":{ - "title":"Geographic Bounding Polygon", - "description":"This field allows the creation of multiple polygons to describe in a more detailed manner the geographic area covered by the dataset. It should only be used to define the outer boundaries of a covered area. For example, in the United States, such polygons can be created to define boundaries for Hawaii, Alaska, and the continental United States, but not interior boundaries for the contiguous states. This field is used to refine a coordinate-based search, not to actually map an area. \nIf the boundPoly element is used, then geoBndBox MUST be present, and all points enclosed by the boundPoly MUST be contained within the geoBndBox. Elements westBL, eastBL, southBL, and northBL of the geoBndBox should each be represented in at least one point of the boundPoly description.", - "type":"array", - "_ddi_xpath":"stdyDscr/sumDscr/boundPoly", - "items":{ - "type":"object", - "properties":{ - "lat":{ - "title":"Latitude", - "description":"Latitude (y coordinate) of a point. Valid range expressed in decimal degrees is as follows: -90,0 to 90,0 degrees (latitude)", - "type":"string" + "bound_poly": { + "title": "Geographic Bounding Polygon", + "description": "This field allows the creation of multiple polygons to describe in a more detailed manner the geographic area covered by the dataset. It should only be used to define the outer boundaries of a covered area. For example, in the United States, such polygons can be created to define boundaries for Hawaii, Alaska, and the continental United States, but not interior boundaries for the contiguous states. This field is used to refine a coordinate-based search, not to actually map an area. \nIf the boundPoly element is used, then geoBndBox MUST be present, and all points enclosed by the boundPoly MUST be contained within the geoBndBox. Elements westBL, eastBL, southBL, and northBL of the geoBndBox should each be represented in at least one point of the boundPoly description.", + "type": "array", + "_ddi_xpath": "stdyDscr/sumDscr/boundPoly", + "items": { + "type": "object", + "properties": { + "lat": { + "title": "Latitude", + "description": "Latitude (y coordinate) of a point. Valid range expressed in decimal degrees is as follows: -90,0 to 90,0 degrees (latitude)", + "type": "string" }, - "lon":{ - "title":"longitude", - "description":"Longitude (x coordinate) of a point. Valid range expressed in decimal degrees is as follows: -180,0 to 180,0 degrees (longitude)", - "type":"string" + "lon": { + "title": "longitude", + "description": "Longitude (x coordinate) of a point. Valid range expressed in decimal degrees is as follows: -180,0 to 180,0 degrees (longitude)", + "type": "string" } } } }, - "geog_coverage":{ - "description":" Information on the geographic coverage of the data. Includes the total geographic scope of the data, and any additional levels of geographic coding provided in the variables. Maps to Dublin Core Coverage element. Inclusion of this element in the codebook is recommended.", - "title":"Geographic Coverage", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/geogCover" + "geog_coverage": { + "description": " Information on the geographic coverage of the data. Includes the total geographic scope of the data, and any additional levels of geographic coding provided in the variables. Maps to Dublin Core Coverage element. Inclusion of this element in the codebook is recommended.", + "title": "Geographic Coverage", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/geogCover" }, - "geog_coverage_notes":{ - "description":"Geographic coverage notes", - "title":"Geographic Coverage notes", - "type":"string", - "_ddi_xpath":"stdyDscr/sumDscr/geogCover/txt" + "geog_coverage_notes": { + "description": "Geographic coverage notes", + "title": "Geographic Coverage notes", + "type": "string", + "_ddi_xpath": "stdyDscr/sumDscr/geogCover/txt" }, - "geog_unit":{ - "title":"Geographic Unit", - "description":"Lowest level of geographic aggregation covered by the data", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/geogUnit" + "geog_unit": { + "title": "Geographic Unit", + "description": "Lowest level of geographic aggregation covered by the data", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/geogUnit" }, - "analysis_unit":{ - "title":"Unit of Analysis", - "description":"Basic unit(s) of analysis or observation that the study describes: individuals, families/households, groups, facilities, institutions/organizations, administrative units, physical locations, etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/anlyUnit" + "analysis_unit": { + "title": "Unit of Analysis", + "description": "Basic unit(s) of analysis or observation that the study describes: individuals, families/households, groups, facilities, institutions/organizations, administrative units, physical locations, etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/anlyUnit" }, - "universe":{ - "title":"Universe", - "description":"We are interested here in the survey universe (not the universe of particular sections of the questionnaires or variables), i.e. in the identification of the population of interest in the survey. The universe will rarely be the entire population of the country. Sample household surveys, for example, usually do not cover homeless, nomads, diplomats, community households. Some surveys may cover only the population of a particular age group, or only male (or female), etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/universe" + "universe": { + "title": "Universe", + "description": "We are interested here in the survey universe (not the universe of particular sections of the questionnaires or variables), i.e. in the identification of the population of interest in the survey. The universe will rarely be the entire population of the country. Sample household surveys, for example, usually do not cover homeless, nomads, diplomats, community households. Some surveys may cover only the population of a particular age group, or only male (or female), etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/universe" }, - "data_kind":{ - "title":"Kind of Data", - "description":"Broad classification of the data", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/sumDscr/dataKind", - "enum_":[ + "data_kind": { + "title": "Kind of Data", + "description": "Broad classification of the data", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/sumDscr/dataKind", + "enum_": [ "Sample survey data[ssd]", "Census/enumeration data[cen]", "Administrative records data[adm]", @@ -773,383 +784,408 @@ "Observation data/ratings[obs]" ] }, - "notes":{ - "title":"Study notes", - "description":"Study notes", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/notes" + "notes": { + "title": "Study notes", + "description": "Study notes", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/notes" }, - "quality_statement":{ - "title":"Quality Statement", - "description":"This structure consists of two parts, standardsCompliance and otherQualityStatements. In standardsCompliance list all specific standards complied with during the execution of this study. Note the standard name and producer and how the study complied with the standard. Enter any additional quality statements in otherQualityStatements.", - "type":"object", - "_ddi_xpath":"stdyDscr/stdyInfo/qualityStatement", - "_comments":"TODO: not clear if this should be repeatable.", - "properties":{ - "standard_name":{ - "title":"Standard name", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/qualityStatement/standardsCompliance/standard/standardName" - }, - "standard_producer":{ - "title":"Standard producer", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/qualityStatement/standardsCompliance/standard/producer" + "quality_statement": { + "title": "Quality Statement", + "description": "The quality statement provides elements to describe compliance with quality standards in the form of a statement and an itemized list of standards complied with, and an element to provide other quality statement.", + "type": "object", + "_ddi_xpath": "stdyDscr/stdyInfo/qualityStatement", + "_comments": "TODO: not clear if this should be repeatable.", + "properties": { + "compliance_description": { + "title": "Standard compliance description", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/qualityStatement/standardsCompliance/complianceDescription" }, - "standard_compliance_desc":{ - "title":"Standard compliance description", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/qualityStatement/standardsCompliance/complianceDescription" + "standards": { + "type": "array", + "title": "Standards", + "description": "Standards", + "_ddi_xpath": "stdyDscr/stdyInfo/qualityStatement/standardsCompliance/standard", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "producer": { + "title": "Producer", + "type": "string" + } + } + }, + "required": [ + "name" + ] }, - "other_quality_statement":{ - "title":"Other quality statement", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/qualityStatement/otherQualityStatement" + "other_quality_statement": { + "title": "Other quality statement", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/qualityStatement/otherQualityStatement" } } - }, - "ex_post_evaluation":{ - "title":"Ex-Post Evaluation", - "description":"This structure consists of two parts, standardsCompliance and otherQualityStatements. In standardsCompliance list all specific standards complied with during the execution of this study. Note the standard name and producer and how the study complied with the standard. Enter any additional quality statements in otherQualityStatements.", - "type":"object", - "_ddi_xpath":"stdyDscr/stdyInfo/exPostEvaluation", - "_comments":"TODO: not clear if this should be repeatable.", - "properties":{ - "completion_date":{ - "title":"Evaluation completion date", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/exPostEvaluation/@completionDate" + }, + "ex_post_evaluation": { + "title": "Ex-Post Evaluation", + "description": "This structure consists of two parts, standardsCompliance and otherQualityStatements. In standardsCompliance list all specific standards complied with during the execution of this study. Note the standard name and producer and how the study complied with the standard. Enter any additional quality statements in otherQualityStatements.", + "type": "object", + "_ddi_xpath": "stdyDscr/stdyInfo/exPostEvaluation", + "_comments": "TODO: not clear if this should be repeatable.", + "properties": { + "completion_date": { + "title": "Evaluation completion date", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/exPostEvaluation/@completionDate" }, - "type":{ - "title":"Evaluation type", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/@type" + "type": { + "title": "Evaluation type", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/@type" }, - "evaluator":{ - "type":"array", - "title":"Evaluators", - "description":"Evaluators", - "_ddi_xpath":"stdyDscr/stdyInfo/exPostEvaluation/evaluator", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Funding Agency/Sponsor", - "type":"string" + "evaluator": { + "type": "array", + "title": "Evaluators", + "description": "Evaluators", + "_ddi_xpath": "stdyDscr/stdyInfo/exPostEvaluation/evaluator", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Funding Agency/Sponsor", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" - }, - "role":{ - "title":"Role", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "evaluation_process":{ - "title":"Evaluation process", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/exPostEvaluation/evaluationProcess" + "evaluation_process": { + "title": "Evaluation process", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/exPostEvaluation/evaluationProcess" }, - "outcomes":{ - "title":"Outcomes", - "type":"string", - "_ddi_xpath":"stdyDscr/stdyInfo/exPostEvaluation/outcomes" + "outcomes": { + "title": "Outcomes", + "type": "string", + "_ddi_xpath": "stdyDscr/stdyInfo/exPostEvaluation/outcomes" } } } }, - "required":[ + "required": [ "nation" ] }, - "study_development":{ - "title":"Study Development", - "description":"Describe the process of study development as a series of development activities. These activities can be typed using a controlled vocabulary. Describe the activity, listing participants with their role and affiliation, resources used (sources of information), and the outcome of the development activity.", - "type":"object", - "_ddi_xpath":"stdyDscr/studyDevelopment", - "properties":{ - "activity_type":{ - "title":"Development activity type", - "type":"string", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/@type" - }, - "activity_description":{ - "title":"Development activity description", - "type":"string", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/description" - }, - "participants":{ - "type":"array", - "title":"Participants", - "description":"Participants", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/participant", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Participant name", - "type":"string" + "study_development": { + "title": "Study Development", + "description": "Describe the process of study development as a series of development activities. These activities can be typed using a controlled vocabulary. Describe the activity, listing participants with their role and affiliation, resources used (sources of information), and the outcome of the development activity.", + "type": "object", + "_ddi_xpath": "stdyDscr/studyDevelopment", + "properties": { + "development_activity": { + "type": "array", + "title": "Development activity", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity", + "items": { + "type": "object", + "properties": { + "activity_type": { + "title": "Development activity type", + "type": "string", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/@type" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "activity_description": { + "title": "Development activity description", + "type": "string", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/description" }, - "role":{ - "title":"Role", - "type":"string" - } - }, - "required":[ - "name" - ] - } - }, - "resource":{ - "type":"object", - "title":"Development activity resource", - "description":"Development activity resource", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/resource", - "properties":{ - "data_source":{ - "title":"Data source", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/resource/dataSrc", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "source":{ - "title":"Source", - "type":"string" - } + "participants": { + "type": "array", + "title": "Participants", + "description": "Participants", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/participant", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Participant name", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "name" + ] } + }, + "resources": { + "type": "array", + "title": "Development activity resources", + "description": "Development activity resources", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/resource", + "items":{ + "type":"object", + "properties":{ + "name": { + "type": "string", + "title": "Resource name", + "description": "Name of the resource" + }, + "origin": { + "type": "string", + "title": "Origin of resource", + "description": "For historical materials, information about the origin(s) of the sources and the rules followed in establishing the sources should be specified. May not be relevant to survey data. ", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/resource/srcOrig" + }, + "characteristics": { + "type": "string", + "title": "Characteristics of resource", + "description": "Assessment of characteristics and quality of source material. May not be relevant to survey data.", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/resource/srcChar" + } + } + } + }, + "outcome": { + "title": "Development Activity Outcome", + "description": "Development Activity Outcome", + "type": "string", + "_ddi_xpath": "stdyDscr/studyDevelopment/developmentActivity/outcome" } - }, - "source_origin":{ - "type":"string", - "title":"Origin of Source", - "description":"For historical materials, information about the origin(s) of the sources and the rules followed in establishing the sources should be specified. May not be relevant to survey data. ", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/resource/srcOrig" - }, - "source_char":{ - "type":"string", - "title":"Characteristics of Source Noted", - "description":"Assessment of characteristics and quality of source material. May not be relevant to survey data.", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/resource/srcChar" } } - }, - "outcome":{ - "title":"Development Activity Outcome", - "description":"Development Activity Outcome", - "type":"string", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/outcome" } } }, - "method":{ - "type":"object", - "title":"Methodology and Processing", - "description":"Methodology and processing", - "_ddi_xpath":"stdyDscr/method", - "properties":{ - "data_collection":{ - "type":"object", - "title":"Data Collection", - "_ddi_xpath":"stdyDscr/method/dataColl", - "description":"Information about the methodology employed in a data collection", - "properties":{ - "time_method":{ - "title":"Time Method", - "description":"The time method or time dimension of the data collection. Examples: `panel survey`, `h>cross-section`, `trend study`, `time-series`", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/timeMeth" + "method": { + "type": "object", + "title": "Methodology and Processing", + "description": "Methodology and processing", + "_ddi_xpath": "stdyDscr/method", + "properties": { + "data_collection": { + "type": "object", + "title": "Data Collection", + "_ddi_xpath": "stdyDscr/method/dataColl", + "description": "Information about the methodology employed in a data collection", + "properties": { + "time_method": { + "title": "Time Method", + "description": "The time method or time dimension of the data collection. Examples: `panel survey`, `h>cross-section`, `trend study`, `time-series`", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/timeMeth" }, - "data_collectors":{ - "title":"Data Collectors", - "description":"The persons and/or agencies that took charge of the data collection. This element includes 3 fields: Name, Abbreviation and the Affiliation. In most cases, we will record here the name of the agency, not the name of interviewers. Only in the case of very small-scale surveys, with a very limited number of interviewers, the name of person will be included as well. The field Affiliation is optional and not relevant in all cases.", - "_ddi_xpath":"stdyDscr/method/dataColl/dataCollector", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "data_collectors": { + "title": "Data Collectors", + "description": "The persons and/or agencies that took charge of the data collection. This element includes 3 fields: Name, Abbreviation and the Affiliation. In most cases, we will record here the name of the agency, not the name of interviewers. Only in the case of very small-scale surveys, with a very limited number of interviewers, the name of person will be included as well. The field Affiliation is optional and not relevant in all cases.", + "_ddi_xpath": "stdyDscr/method/dataColl/dataCollector", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "abbr": { + "title": "Abbreviation", + "type": "string" }, - "abbr":{ - "title":"Abbreviation", - "type":"string" - }, - "role":{ - "title":"Role", - "type":"string" + "role": { + "title": "Role", + "type": "string" } } } }, - "collector_training":{ - "title":"Collector training", - "description":"Describes the training provided to data collectors including interviewer training, process testing, compliance with standards etc. This is repeatable for language and to capture different aspects of the training process. The type attribute allows specification of the type of training being described.", - "type":"object", - "properties":{ - "type":{ - "title":"Training type", - "description":"The percentage of sample members who provided information", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/collectorTraining/@type" - }, - "training":{ - "title":"Training", - "description":"Training provided to data collectors", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/collectorTraining" + "collector_training": { + "title": "Collector training", + "description": "Describes the training provided to data collectors including interviewer training, process testing, compliance with standards etc. This is repeatable for language and to capture different aspects of the training process. The type attribute allows specification of the type of training being described.", + "type": "array", + "items":{ + "type":"object", + "properties": { + "type": { + "title": "Training type", + "description": "The percentage of sample members who provided information", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/collectorTraining/@type" + }, + "training": { + "title": "Training", + "description": "Training provided to data collectors", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/collectorTraining" + } } } }, - "frequency":{ - "title":"Frequency of Data Collection", - "description":"For data collected at more than one point in time, the frequency with which the data were collected. Examples `monthly`, `quarterly`, `yearly`", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/frequenc" + "frequency": { + "title": "Frequency of Data Collection", + "description": "For data collected at more than one point in time, the frequency with which the data were collected. Examples `monthly`, `quarterly`, `yearly`", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/frequenc" }, - "sampling_procedure":{ - "title":"Sampling Procedure", - "description":"The type of sample and sample design used to select the survey respondents to represent the population. \nThis field only applies to sample surveys. Information on sampling procedure is crucial (although not applicable for censuses and administrative datasets). Examples `National multistage area probability sample`, `Simple random sample`, `Quota sample`", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampProc" + "sampling_procedure": { + "title": "Sampling Procedure", + "description": "The type of sample and sample design used to select the survey respondents to represent the population. \nThis field only applies to sample surveys. Information on sampling procedure is crucial (although not applicable for censuses and administrative datasets). Examples `National multistage area probability sample`, `Simple random sample`, `Quota sample`", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampProc" }, - "sample_frame":{ - "title":"Sample Frame", - "description":"Sample frame describes the sampling frame used for identifying the population from which the sample was taken. For example, a telephone book may be a sample frame for a phone survey. In addition to the name, label and text describing the sample frame, this structure lists who maintains the sample frame, the period for which it is valid, a use statement, the universe covered, the type of unit contained in the frame as well as the number of units available, the reference period of the frame and procedures used to update the frame.", - "type":"object", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame", - "properties":{ - "name":{ - "title":"Sample frame name", - "description":"Sample frame name", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/sampleFrameName" + "sample_frame": { + "title": "Sample Frame", + "description": "Sample frame describes the sampling frame used for identifying the population from which the sample was taken. For example, a telephone book may be a sample frame for a phone survey. In addition to the name, label and text describing the sample frame, this structure lists who maintains the sample frame, the period for which it is valid, a use statement, the universe covered, the type of unit contained in the frame as well as the number of units available, the reference period of the frame and procedures used to update the frame.", + "type": "object", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame", + "properties": { + "name": { + "title": "Sample frame name", + "description": "Sample frame name", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/sampleFrameName" }, - "valid_period":{ - "type":"array", - "title":"Valid periods (YYYY/MM/DD)", - "description":"Defines a time period for the validity of the sampling frame. Enter dates in YYYY-MM-DD format.", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/validPeriod", - "items":{ - "type":"object", - "properties":{ - "event":{ - "title":"Event", - "description":"Event e.g. start, end", - "type":"string" + "valid_period": { + "type": "array", + "title": "Valid periods (YYYY/MM/DD)", + "description": "Defines a time period for the validity of the sampling frame. Enter dates in YYYY-MM-DD format.", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/validPeriod", + "items": { + "type": "object", + "properties": { + "event": { + "title": "Event", + "description": "Event e.g. start, end", + "type": "string" }, - "date":{ - "title":"Date", - "description":"Date", - "type":"string" + "date": { + "title": "Date", + "description": "Date", + "type": "string" } }, - "required":[ + "required": [ "date" ] } }, - "custodian":{ - "title":"Custodian", - "description":"Custodian identifies the agency or individual who is responsible for creating or maintaining the sample frame.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/custodian" + "custodian": { + "title": "Custodian", + "description": "Custodian identifies the agency or individual who is responsible for creating or maintaining the sample frame.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/custodian" }, - "universe":{ - "title":"Universe", - "description":"The group of persons or other elements that are the object of research and to which any analytic results refer.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/universe" + "universe": { + "title": "Universe", + "description": "The group of persons or other elements that are the object of research and to which any analytic results refer.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/universe" }, - "frame_unit":{ - "type":"object", - "title":"Frame unit", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/frameUnit", - "description":"Provides information about the sampling frame unit. The attribute `isPrimary` is boolean, indicating whether the unit is primary or not.", - "properties":{ - "is_primary":{ - "title":"Is Primary", - "description":"Is a primary unit?", - "type":["boolean","string"], - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/frameUnit/@isPrimary" + "frame_unit": { + "type": "object", + "title": "Frame unit", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/frameUnit", + "description": "Provides information about the sampling frame unit. The attribute `isPrimary` is boolean, indicating whether the unit is primary or not.", + "properties": { + "is_primary": { + "title": "Is Primary", + "description": "Is a primary unit?", + "type": [ + "boolean", + "string" + ], + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/frameUnit/@isPrimary" }, - "unit_type":{ - "title":"Unit Type", - "description":"Describes the type of sampling frame unit. The field `num_of_units` provides the number of units in the sampling frame.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/frameUnit/unitType" + "unit_type": { + "title": "Unit Type", + "description": "Describes the type of sampling frame unit. The field `num_of_units` provides the number of units in the sampling frame.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/frameUnit/unitType" }, - "num_of_units":{ - "title":"Number of units", - "description":"Number of units in the sampling frame", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/frameUnit/@numberOfUnits" + "num_of_units": { + "title": "Number of units", + "description": "Number of units in the sampling frame", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/frameUnit/@numberOfUnits" } } }, - "reference_period":{ - "type":"array", - "title":"Reference periods (YYYY/MM/DD)", - "description":"Indicates the period of time in which the sampling frame was actually used for the study in question. Use ISO 8601 date/time formats to enter the relevant date(s).", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/referencePeriod", - "items":{ - "type":"object", - "properties":{ - "event":{ - "title":"Event", - "description":"Event e.g. start, end", - "type":"string" + "reference_period": { + "type": "array", + "title": "Reference periods (YYYY/MM/DD)", + "description": "Indicates the period of time in which the sampling frame was actually used for the study in question. Use ISO 8601 date/time formats to enter the relevant date(s).", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/referencePeriod", + "items": { + "type": "object", + "properties": { + "event": { + "title": "Event", + "description": "Event e.g. start, end", + "type": "string" }, - "date":{ - "title":"Date", - "description":"Date", - "type":"string" + "date": { + "title": "Date", + "description": "Date", + "type": "string" } }, - "required":[ + "required": [ "date" ] } }, - "update_procedure":{ - "title":"Update procedure", - "description":"Description of how and with what frequency the sample frame is updated.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/sampleFrame/updateProcedure" + "update_procedure": { + "title": "Update procedure", + "description": "Description of how and with what frequency the sample frame is updated.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/sampleFrame/updateProcedure" } } }, - "sampling_deviation":{ - "title":"Deviations from the Sample Design", - "description":"This field only applies to sample surveys.\nSometimes the reality of the field requires a deviation from the sampling design (for example due to difficulty to access to zones due to weather problems, political instability, etc). If for any reason, the sample design has deviated, this should be reported here. ", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/deviat" + "sampling_deviation": { + "title": "Deviations from the Sample Design", + "description": "This field only applies to sample surveys.\nSometimes the reality of the field requires a deviation from the sampling design (for example due to difficulty to access to zones due to weather problems, political instability, etc). If for any reason, the sample design has deviated, this should be reported here. ", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/deviat" }, - "coll_mode":{ - "title":"Mode of data collection", - "type":["string","array"], - "description":"The mode of data collection is the manner in which the interview was conducted or information was gathered. In most cases, the response will be 'face to face interview'. But for some specific kinds of datasets, such as for example data on rain fall, the response will be different.", - "_ddi_xpath":"stdyDscr/method/dataColl/collMode", - "enum_":[ + "coll_mode": { + "title": "Mode of data collection", + "type": [ + "string", + "array" + ], + "description": "The mode of data collection is the manner in which the interview was conducted or information was gathered. In most cases, the response will be 'face to face interview'. But for some specific kinds of datasets, such as for example data on rain fall, the response will be different.", + "_ddi_xpath": "stdyDscr/method/dataColl/collMode", + "enum_": [ "Computer Assisted Personal Interview[capi]", "Computer Assisted Telephone Interview[cati]", "Face-to-Face[f2f]", @@ -1161,492 +1197,427 @@ "type": "string" } }, - "research_instrument":{ - "title":"Type of Research Instrument", - "description":"The type of data collection instrument used. \n`Structured` indicates an instrument in which all respondents are asked the same questions/tests, possibly with precoded answers. If a small portion of such a questionnaire includes open-ended questions, provide appropriate comments. \n`Semi-structured` indicates that the research instrument contains mainly open-ended questions. \n`Unstructured` indicates that in-depth interviews were conducted.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/resInstru" + "research_instrument": { + "title": "Type of Research Instrument", + "description": "The type of data collection instrument used. \n`Structured` indicates an instrument in which all respondents are asked the same questions/tests, possibly with precoded answers. If a small portion of such a questionnaire includes open-ended questions, provide appropriate comments. \n`Semi-structured` indicates that the research instrument contains mainly open-ended questions. \n`Unstructured` indicates that in-depth interviews were conducted.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/resInstru" }, - "instru_development":{ - "title":"Instrument development", - "description":"Describe any development work on the data collection instrument. Type attribute allows for the optional use of a defined development type with or without use of a controlled vocabulary.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/instrumentDevelopment" + "instru_development": { + "title": "Instrument development", + "description": "Describe any development work on the data collection instrument. Type attribute allows for the optional use of a defined development type with or without use of a controlled vocabulary.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/instrumentDevelopment" }, - "instru_development_type":{ - "title":"Instrument development type", - "description":"Instrument development type", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/instrumentDevelopment/@type" + "instru_development_type": { + "title": "Instrument development type", + "description": "Instrument development type", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/instrumentDevelopment/@type" }, - "sources":{ - "type":"object", - "title":"Sources", - "description":"Description of sources used for the data collection. The element is nestable so that the sources statement might encompass a series of discrete source statements, each of which could contain the facts about an individual source. This element maps to Dublin Core Source element.", - "_ddi_xpath":"stdyDscr/method/dataColl/sources", - "properties":{ - "data_source":{ - "title":"Data source", - "_ddi_xpath":"stdyDscr/studyDevelopment/developmentActivity/resource/dataSrc", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "source":{ - "title":"Source", - "type":"string" - } - } - } - }, - "source_origin":{ - "type":"string", - "title":"Origin of Source", - "description":"For historical materials, information about the origin(s) of the sources and the rules followed in establishing the sources should be specified. May not be relevant to survey data. ", - "_ddi_xpath":"stdyDscr/method/dataColl/sources/srcOrig" + "sources": { + "type": "array", + "title": "Sources", + "description": "Description of sources used for the data collection. The element is nestable so that the sources statement might encompass a series of discrete source statements, each of which could contain the facts about an individual source. This element maps to Dublin Core Source element.", + "_ddi_xpath": "stdyDscr/method/dataColl/sources", + "items":{ + "type":"object", + "properties": { + "name": { + "type": "string", + "title": "Source name", + "description": "Name of the source" }, - "source_char":{ - "type":"string", - "title":"Characteristics of Source Noted", - "description":"Assessment of characteristics and quality of source material. May not be relevant to survey data.", - "_ddi_xpath":"stdyDscr/method/dataColl/sources/srcChar" + "origin": { + "type": "string", + "title": "Origin of Source", + "description": "For historical materials, information about the origin(s) of the sources and the rules followed in establishing the sources should be specified. May not be relevant to survey data. ", + "_ddi_xpath": "stdyDscr/method/dataColl/sources/srcOrig" }, - "source_doc":{ - "type":"string", - "title":"Source documentation", - "description":"Documentation and Access to Sources", - "_ddi_xpath":"stdyDscr/method/dataColl/sources/srcDocu" - } + "characteristics": { + "type": "string", + "title": "Characteristics of Source Noted", + "description": "Assessment of characteristics and quality of source material. May not be relevant to survey data.", + "_ddi_xpath": "stdyDscr/method/dataColl/sources/srcChar" + } } + } }, - "coll_situation":{ - "title":"Characteristics of Data Collection Situation - Notes on data collection", - "__comment":"used for notes on data collection", - "description":"Description of noteworthy aspects of the data collection situation. Includes information on factors such as cooperativeness of respondents, duration of interviews, number of call-backs, etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/collSitu" + "coll_situation": { + "title": "Characteristics of Data Collection Situation - Notes on data collection", + "__comment": "used for notes on data collection", + "description": "Description of noteworthy aspects of the data collection situation. Includes information on factors such as cooperativeness of respondents, duration of interviews, number of call-backs, etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/collSitu" }, - "act_min":{ - "title":"Supervision", - "description":"Summary of actions taken to minimize data loss. Includes information on actions such as follow-up visits, supervisory checks, historical matching, estimation, etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/actMin" + "act_min": { + "title": "Supervision", + "description": "Summary of actions taken to minimize data loss. Includes information on actions such as follow-up visits, supervisory checks, historical matching, estimation, etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/actMin" }, - "control_operations":{ - "title":"Control Operations", - "description":" Methods to facilitate data control performed by the primary investigator or by the data archive. Specify any special programs used for such operations.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/ConOps" + "control_operations": { + "title": "Control Operations", + "description": " Methods to facilitate data control performed by the primary investigator or by the data archive. Specify any special programs used for such operations.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/ConOps" }, - "weight":{ - "title":"Weighting", - "description":"The use of sampling procedures may make it necessary to apply weights to produce accurate statistical results. Describe here the criteria for using weights in analysis of a collection. If a weighting formula or coefficient was developed, provide this formula, define its elements, and indicate how the formula is applied to data.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/weight" + "weight": { + "title": "Weighting", + "description": "The use of sampling procedures may make it necessary to apply weights to produce accurate statistical results. Describe here the criteria for using weights in analysis of a collection. If a weighting formula or coefficient was developed, provide this formula, define its elements, and indicate how the formula is applied to data.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/weight" }, - "cleaning_operations":{ - "title":"Cleaning Operations", - "description":"Methods used to `clean` the data collection, e.g., consistency checking, wildcode checking, etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/dataColl/cleanOps" + "cleaning_operations": { + "title": "Cleaning Operations", + "description": "Methods used to `clean` the data collection, e.g., consistency checking, wildcode checking, etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/dataColl/cleanOps" } } }, - "method_notes":{ - "title":"Methodology notes", - "description":"Methodology notes", - "type":"string", - "_ddi_xpath":"stdyDscr/method/notes" + "method_notes": { + "title": "Methodology notes", + "description": "Methodology notes", + "type": "string", + "_ddi_xpath": "stdyDscr/method/notes" }, - "analysis_info":{ - "type":"object", - "title":"Data Appraisal", - "_ddi_xpath":"stdyDscr/method/anlyInfo", - "description":"Information about Data Appraisal", - "properties":{ - "response_rate":{ - "title":"Response Rate", - "description":"The percentage of sample members who provided information", - "type":"string", - "_ddi_xpath":"stdyDscr/method/anlyInfo/respRate" + "analysis_info": { + "type": "object", + "title": "Data Appraisal", + "_ddi_xpath": "stdyDscr/method/anlyInfo", + "description": "Information about Data Appraisal", + "properties": { + "response_rate": { + "title": "Response Rate", + "description": "The percentage of sample members who provided information", + "type": "string", + "_ddi_xpath": "stdyDscr/method/anlyInfo/respRate" }, - "sampling_error_estimates":{ - "title":"Estimates of Sampling Error", - "description":"Measure of how precisely one can estimate a population value from a given sample", - "type":"string", - "_ddi_xpath":"stdyDscr/method/anlyInfo/EstSmpErr" + "sampling_error_estimates": { + "title": "Estimates of Sampling Error", + "description": "Measure of how precisely one can estimate a population value from a given sample", + "type": "string", + "_ddi_xpath": "stdyDscr/method/anlyInfo/EstSmpErr" }, - "data_appraisal":{ - "title":"Data Appraisal", - "description":"Other issues pertaining to data appraisal. Describe here issues such as response variance, nonresponse rate and testing for bias, interviewer and response bias, confidence levels, question bias, etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/anlyInfo/dataAppr" + "data_appraisal": { + "title": "Data Appraisal", + "description": "Other issues pertaining to data appraisal. Describe here issues such as response variance, nonresponse rate and testing for bias, interviewer and response bias, confidence levels, question bias, etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/anlyInfo/dataAppr" } } }, - "study_class":{ - "title":"Class of the Study", - "description":"Generally used to give the data archive's class or study status number, which indicates the processing status of the study. May also be used as a text field to describe processing status. Example: `DDA Class C`, `Study is available from http://example.com` ", - "type":"string", - "_ddi_xpath":"stdyDscr/method/stdyClas" + "study_class": { + "title": "Class of the Study", + "description": "Generally used to give the data archive's class or study status number, which indicates the processing status of the study. May also be used as a text field to describe processing status. Example: `DDA Class C`, `Study is available from http://example.com` ", + "type": [ + "string", + "array" + ], + "_ddi_xpath": "stdyDscr/method/stdyClas" }, - "data_processing":{ - "type":"string", - "title":"Data Processing", - "description":"Describes various data processing procedures not captured elsewhere in the documentation, such as topcoding, recoding, suppression, tabulation, etc. The `type` attribute supports better classification of this activity, including the optional use of a controlled vocabulary", - "_ddi_xpath":"stdyDscr/method/dataProcessing" - }, - "data_processing_type":{ - "type":"string", - "title":"Data Processing type", - "description":"Data procssing type", - "_ddi_xpath":"stdyDscr/method/dataProcessing/@type" - }, - "coding_instructions":{ - "type":"object", - "title":"Coding Instructions", - "_ddi_xpath":"stdyDscr/method/codingInstructions", - "description":"Describe specific coding instructions used in data processing, cleaning, assession, or tabulation.", - "properties":{ - "related_processes":{ - "title":"Related processes", - "type":"string", - "_ddi_xpath":"stdyDscr/method/codingInstructions/@relatedProcesses" - }, - "type":{ - "title":"Coding instructions type", - "type":"string", - "_ddi_xpath":"stdyDscr/method/codingInstructions/@type" - }, - "txt":{ - "title":"Coding instructions text", - "type":"string", - "_ddi_xpath":"stdyDscr/method/codingInstructions/txt" - }, - "command":{ - "title":"Command", - "description":"Provide command code for the coding instruction. The formalLanguage attribute identifies the language of the command code.", - "type":"string", - "_ddi_xpath":"stdyDscr/method/codingInstructions/command" + "data_processing": { + "type": "array", + "title": "Data Processing", + "description": "Describes various data processing procedures not captured elsewhere in the documentation, such as topcoding, recoding, suppression, tabulation, etc. The `type` attribute supports better classification of this activity, including the optional use of a controlled vocabulary", + "_ddi_xpath": "stdyDscr/method/dataProcessing", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Data processing type", + "type": "string" + }, + "description": { + "title": "Data processing description", + "type": "string" + } }, - "command_language":{ - "title":"Language of the command code", - "description":"Identifies the language of the command code. e.g. `SPSS`, `R`, `STATA` ", - "type":"string", - "_ddi_xpath":"stdyDscr/method/codingInstructions/command/@formalLanguage" + "required": [ + "description" + ] + } + }, + "coding_instructions": { + "type": "array", + "title": "Coding Instructions", + "_ddi_xpath": "stdyDscr/method/codingInstructions", + "description": "Describe specific coding instructions used in data processing, cleaning, assession, or tabulation.", + "items": { + "type": "object", + "properties": { + "related_processes": { + "title": "Related processes", + "type": "string", + "_ddi_xpath": "stdyDscr/method/codingInstructions/@relatedProcesses" + }, + "type": { + "title": "Coding instructions type", + "type": "string", + "_ddi_xpath": "stdyDscr/method/codingInstructions/@type" + }, + "txt": { + "title": "Coding instructions text", + "type": "string", + "_ddi_xpath": "stdyDscr/method/codingInstructions/txt" + }, + "command": { + "title": "Command", + "description": "Provide command code for the coding instruction. The formalLanguage attribute identifies the language of the command code.", + "type": "string", + "_ddi_xpath": "stdyDscr/method/codingInstructions/command" + }, + "formal_language": { + "title": "Identify the language of the command code", + "description": "Identifies the language of the command code. e.g. `SPSS`, `R`, `STATA` ", + "type": "string", + "_ddi_xpath": "stdyDscr/method/codingInstructions/command/@formalLanguage" + } } } } } }, - "data_access":{ - "type":"object", - "description":"Data Access", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/dataAccs", - "properties":{ - "dataset_availability":{ - "type":"object", - "title":"Data Set Availability", - "description":"Information on availability and storage of the collection", - "properties":{ - "access_place":{ - "title":"Location of Data Collection", - "description":"Location where the data collection is currently stored. Use the URL field `access_place_url` to provide a URN or URL for the storage site or the actual address from which the data may be downloaded", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/accsPlac" + "data_access": { + "type": "object", + "description": "Data Access", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/dataAccs", + "properties": { + "dataset_availability": { + "type": "object", + "title": "Data Set Availability", + "description": "Information on availability and storage of the collection", + "properties": { + "access_place": { + "title": "Location of Data Collection", + "description": "Location where the data collection is currently stored. Use the URL field `access_place_url` to provide a URN or URL for the storage site or the actual address from which the data may be downloaded", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/accsPlac" }, - "access_place_url":{ - "title":"URL for Location of Data Collection", - "description":"Location where the data collection is currently stored. Provide a URN or URL for the storage site or the actual address from which the data may be downloaded", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/accsPlac/@URI" + "access_place_url": { + "title": "URL for Location of Data Collection", + "description": "Location where the data collection is currently stored. Provide a URN or URL for the storage site or the actual address from which the data may be downloaded", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/accsPlac/@URI" }, - "original_archive":{ - "title":"Archive where study is originally stored", - "description":"Archive from which the data collection was obtained; the originating archive", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/origArch" + "original_archive": { + "title": "Archive where study is originally stored", + "description": "Archive from which the data collection was obtained; the originating archive", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/origArch" }, - "status":{ - "title":"Availability Status", - "description":"Statement of collection availability. An archive may need to indicate that a collection is unavailable because it is embargoed for a period of time, because it has been superseded, because a new edition is imminent, etc.", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/avlStatus" + "status": { + "title": "Availability Status", + "description": "Statement of collection availability. An archive may need to indicate that a collection is unavailable because it is embargoed for a period of time, because it has been superseded, because a new edition is imminent, etc.", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/avlStatus" }, - "coll_size":{ - "title":"Extent of Collection", - "description":"Summarizes the number of physical files that exist in a collection, recording the number of files that contain data and noting whether the collection contains machine-readable documentation and/or other supplementary files and information such as data dictionaries, data definition statements, or data collection instruments.", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/collSize" + "coll_size": { + "title": "Extent of Collection", + "description": "Summarizes the number of physical files that exist in a collection, recording the number of files that contain data and noting whether the collection contains machine-readable documentation and/or other supplementary files and information such as data dictionaries, data definition statements, or data collection instruments.", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/collSize" }, - "complete":{ - "title":"Completeness of Study Stored", - "description":"This item indicates the relationship of the data collected to the amount of data coded and stored in the data collection. Information as to why certain items of collected information were not included in the data file stored by the archive should be provided", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/complete" + "complete": { + "title": "Completeness of Study Stored", + "description": "This item indicates the relationship of the data collected to the amount of data coded and stored in the data collection. Information as to why certain items of collected information were not included in the data file stored by the archive should be provided", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/complete" }, - "file_quantity":{ - "title":"Number of Files", - "description":"Total number of physical files associated with a collection", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/fileQnty" + "file_quantity": { + "title": "Number of Files", + "description": "Total number of physical files associated with a collection", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/fileQnty" }, - "notes":{ - "title":"Notes", - "description":"Notes and comments", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/notes" + "notes": { + "title": "Notes", + "description": "Notes and comments", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/notes" } } }, - "dataset_use":{ - "type":"object", - "title":"Data Set Availability", - "description":" Information on terms of use for the data collection", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt", - "properties":{ - "conf_dec":{ - "type":"array", - "title":"Confidentiality Declaration", - "description":" This element is used to determine if signing of a confidentiality declaration is needed to access a resource.", - "items":{ + "dataset_use": { + "type": "object", + "title": "Data Set Availability", + "description": " Information on terms of use for the data collection", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt", + "properties": { + "conf_dec": { + "type": "array", + "title": "Confidentiality Declaration", + "description": " This element is used to determine if signing of a confidentiality declaration is needed to access a resource.", + "items": { "type": "object", - "properties":{ - "txt":{ - "type":"string", - "title":"Confidentiality declaration text", - "description":"Confidentiality declaration text", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/confDec" + "properties": { + "txt": { + "type": "string", + "title": "Confidentiality declaration text", + "description": "Confidentiality declaration text", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/confDec" }, - "required":{ - "type":"string", - "title":"Is signing of a confidentiality declaration required?", - "description":"Is signing of a confidentiality declaration required", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/confDec/@required" + "required": { + "type": "string", + "title": "Is signing of a confidentiality declaration required?", + "description": "Is signing of a confidentiality declaration required", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/confDec/@required" }, - "form_url":{ - "type":"string", - "title":"Confidentiality declaration form URL", - "description":"Provide a URN or URL for online access to a confidentiality declaration form.", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/confDec/@URI" + "form_url": { + "type": "string", + "title": "Confidentiality declaration form URL", + "description": "Provide a URN or URL for online access to a confidentiality declaration form.", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/confDec/@URI" }, - "form_id":{ - "type":"string", - "title":"Form ID", - "description":"Indicates the number or ID of the form that the user must fill out", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/confDec/@formNo" + "form_id": { + "type": "string", + "title": "Form ID", + "description": "Indicates the number or ID of the form that the user must fill out", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/confDec/@formNo" } } } }, - "spec_perm":{ - "type":"array", - "title":"Special Permissions", - "description":"Determine if any special permissions are required to access a resource", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/specPerm", - "items":{ + "spec_perm": { + "type": "array", + "title": "Special Permissions", + "description": "Determine if any special permissions are required to access a resource", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/specPerm", + "items": { "type": "object", - "properties":{ - "txt":{ - "type":"string", - "title":"Special permissions description", - "description":"Confidentiality declaration text" + "properties": { + "txt": { + "type": "string", + "title": "Special permissions description", + "description": "Confidentiality declaration text" }, - "required":{ - "type":"string", - "title":"Indicate if special permissions are required to access a resource", - "description":"Indicate if special permissions are required to access a resource" + "required": { + "type": "string", + "title": "Indicate if special permissions are required to access a resource", + "description": "Indicate if special permissions are required to access a resource" }, - "form_url":{ - "type":"string", - "title":"Form URL", - "description":"Link to the form URL" + "form_url": { + "type": "string", + "title": "Form URL", + "description": "Link to the form URL" }, - "form_id":{ - "type":"string", - "title":"Form ID", - "description":"Indicates the number or ID of the form that the user must fill out" + "form_id": { + "type": "string", + "title": "Form ID", + "description": "Indicates the number or ID of the form that the user must fill out" } } } }, - "restrictions":{ - "title":"Restrictions", - "description":"Any restrictions on access to or use of the collection such as privacy certification or distribution restrictions should be indicated here. These can be restrictions applied by the author, producer, or disseminator of the data collection. If the data are restricted to only a certain class of user, specify which type.", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/restrctn" + "restrictions": { + "title": "Restrictions", + "description": "Any restrictions on access to or use of the collection such as privacy certification or distribution restrictions should be indicated here. These can be restrictions applied by the author, producer, or disseminator of the data collection. If the data are restricted to only a certain class of user, specify which type.", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/restrctn" }, - "contact":{ - "type":"array", - "title":"Contact", - "description":"Contact", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/contact", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "contact": { + "type": "array", + "title": "Contact", + "description": "Contact", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/contact", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "uri":{ - "title":"URI", - "type":"string" + "uri": { + "title": "URI", + "type": "string" }, - "email":{ - "title":"Email", - "type":"string" + "email": { + "title": "Email", + "type": "string" } } }, - "required":[ + "required": [ "name" ] }, - "cit_req":{ - "title":"Citation requirement", - "description":"Text of requirement that a data collection should be cited properly in articles or other publications that are based on analysis of the data.", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/citReq" + "cit_req": { + "title": "Citation requirement", + "description": "Text of requirement that a data collection should be cited properly in articles or other publications that are based on analysis of the data.", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/citReq" }, - "deposit_req":{ - "title":"Deposit requirement", - "description":"Information regarding user responsibility for informing archives of their use of data through providing citations to the published work or providing copies of the manuscripts.", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/deposReq" + "deposit_req": { + "title": "Deposit requirement", + "description": "Information regarding user responsibility for informing archives of their use of data through providing citations to the published work or providing copies of the manuscripts.", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/deposReq" }, - "conditions":{ - "title":"Conditions", - "description":"Indicates any additional information that will assist the user in understanding the access and use conditions of the data collection.", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/conditions" + "conditions": { + "title": "Conditions", + "description": "Indicates any additional information that will assist the user in understanding the access and use conditions of the data collection.", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/conditions" }, - "disclaimer":{ - "title":"Disclaimer", - "description":"Information regarding responsibility for uses of the data collection", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/useStmt/disclaimer" + "disclaimer": { + "title": "Disclaimer", + "description": "Information regarding responsibility for uses of the data collection", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/useStmt/disclaimer" } } }, - "notes":{ - "title":"Notes", - "description":"Notes and comments", - "type":"string", - "_ddi_xpath":"stdyDscr/dataAccs/setAvail/notes" + "notes": { + "title": "Notes", + "description": "Notes and comments", + "type": "string", + "_ddi_xpath": "stdyDscr/dataAccs/setAvail/notes" } } } }, - "required":[ + "required": [ "title_statement", "study_info" ], - "additionalProperties":false + "additionalProperties": false } }, - "type":"object", - "properties":{ - "doc_desc":{ - "$ref":"#/definitions/doc_desc" + "type": "object", + "properties": { + "doc_desc": { + "$ref": "#/definitions/doc_desc" }, - "study_desc":{ - "$ref":"#/definitions/study_desc" + "study_desc": { + "$ref": "#/definitions/study_desc" }, - "data_files":{ - "type":"array", - "description":"Data files", - "items":{ - "$ref":"datafile-schema.json" + "data_files": { + "type": "array", + "description": "Data files", + "items": { + "$ref": "datafile-schema.json" } }, - "variables":{ - "type":"array", - "description":"Variables", - "items":{ - "$ref":"variable-schema.json" + "variables": { + "type": "array", + "description": "Variables", + "items": { + "$ref": "variable-schema.json" } }, - "variable_groups":{ - "type":"array", - "description":"Variable group", - "title":"Variable groups", - "items":{ - "type":"object", - "properties":{ - "vgid":{ - "title":"Variable Group ID", - "description":"Unique ID for the variable group e.g. VG1", - "type":"string", - "maxLength": 45 - }, - "variables":{ - "title":"Variables", - "description":"List of variables for the group seperated by space e.g. V1 V2 V3", - "type":"string", - "maxLength": 5000 - }, - "variable_groups":{ - "title":"Variable groups", - "description":"List of sub-groups e.g. VG2 VG3 VG4", - "type":"string", - "maxLength": 1000 - }, - "group_type":{ - "title":"Type", - "type":"string", - "enum":[ - "subject", - "section", - "multiResp", - "grid", - "display", - "repetition", - "version", - "iteration", - "analysis", - "pragmatic", - "record", - "file", - "randomized", - "other" - ], - "maxLength": 45 - }, - "label":{ - "title":"Label", - "type":"string", - "maxLength": 255 - }, - "universe":{ - "title":"Universe", - "type":"string", - "maxLength": 255 - }, - "notes":{ - "title":"Notes", - "type":"string", - "maxLength": 500 - }, - "txt":{ - "title":"Text", - "type":"string", - "maxLength": 500 - }, - "definition":{ - "title":"Definition", - "type":"string", - "maxLength": 500 - } - }, - "required":[ - "vgid" - ] + "variable_groups": { + "type": "array", + "description": "Variable group", + "title": "Variable groups", + "items": { + "$ref": "variable-group-schema.json" }, - "additionalProperties":false - } + "additionalProperties": false + } } } \ No newline at end of file diff --git a/api-documentation/catalog-admin/document-schema.json b/api-documentation/catalog-admin/document-schema.json index 7688f13f0..8f37dc225 100644 --- a/api-documentation/catalog-admin/document-schema.json +++ b/api-documentation/catalog-admin/document-schema.json @@ -118,26 +118,22 @@ "idno": { "type": "string", "title": "Unique user defined ID", - "description": "The ID number of a dataset is a unique number that is used to identify a particular survey. Define and use a consistent scheme to use. Such an ID could be constructed as follows: country-producer-survey-year-version where \n - country is the 3-letter ISO country abbreviation \n - producer is the abbreviation of the producing agency \n - survey is the survey abbreviation \n - year is the reference year (or the year the survey started) \n - version is the number dataset version number (see Version Description below)" + "description": "The ID number of a dataset is a unique number that is used to identify a document." }, "title": { "type": "string", - "title": "Survey title", - "description": "The title is the official name of the survey as it is stated on the questionnaire or as it appears in the design documents. The following items should be noted:\n - Include the reference year(s) of the survey in the title. \n - Do not include the abbreviation of the survey name in the title. \n - As the survey title is a proper noun, the first letter of each word should be capitalized (except for prepositions or other conjunctions).\n - Including the country name in the title is optional." + "title": "Title" }, "sub_title": { "type": "string", - "title": "Survey subtitle", - "description": "A short subtitle for the survey" + "title": "Subtitle" }, "alternate_title": { "type": "string", - "title": "Abbreviation or Acronym", - "description": "Any form of the title used as a substitute or alternative to the formal title of the resource." + "title": "Abbreviation or Acronym" }, - "abbreviated_title": { - "title": "Abbreviated Title", - "description": "Title as abbreviated for indexing or identification.", + "translated_title": { + "title": "Translated Title", "type": "string" } }, @@ -187,6 +183,11 @@ } } } + }, + "full_name": { + "title": "Full name", + "type": "string", + "description": "Full name of the author. This element to be used only when first or last name cannot be distinguished." } } }, @@ -246,27 +247,28 @@ "description": "Date on which document was published." }, - "id_numbers": { + "identifiers": { "type": "array", - "title": "Identifier numbers", - "description": "Numbers e.g. ISSN, ISBN, DOI, etc.", + "title": "Other identifiers", + "description": "Other identifiers", "items": { "type": "object", "properties": { "type": { - "title": "Type", - "description":"ID number type such as ISSN, ISBN, DOI" + "title": "Identifier type", + "description": "Type of identifier e.g. `doi`, `handle`, `other`", + "type": "string" }, - "value": { - "title": "ID number", - "type": "string" + "identifier": { + "title": "Identifier", + "type": "string" } }, "required": [ - "type","value" + "identifier" ] } - }, + }, "type": { "type": "string", @@ -518,12 +520,13 @@ "volume": { "type": "string", "title": "Volume number", - "description":"Volume number" - }, - "issue": { + "description":"Volume number" + }, + + "number": { "type": "string", - "title": "Issue number", - "description":"Issue number" + "title": "Number", + "description":"The number of a journal, magazine, technical report, or of a work in a series. An issue of a journal or magazine is usually identified by its volume and number; the organization that issues a technical report usually gives it a number; and sometimes books are given numbers in a named series." }, "pages": { @@ -536,6 +539,60 @@ "title": "Series name", "description":"The name given to a series or set of books. When citing an entire book, the title field gives its title and the optional series field gives the name of a series in which the book was published." }, + + "publisher": { + "type": "string", + "title": "Publisher", + "description":"Entity responsible for making the resource available" + }, + + "publisher_address": { + "type": "string", + "title":"Publisher's address", + "description": "For major publishing houses, just the city is given. For small publishers, you can help the reader by giving the complete address." + }, + + "annote": { + "type": "string", + "title": "Annotation", + "description":"For annotation, element will not be used by standard bibliography styles like the MLA, APA or Chicago, but may be used by others that produce an annotated bibliography." + }, + + "booktitle": { + "type": "string", + "title": "Book title", + "description":"Title of a book, part of which is being cited" + }, + + "crossref": { + "type": "string", + "title": "Book title", + "description":"The database key of the entry being cross referenced" + }, + + "howpublished": { + "type": "string", + "title": "Store the notice for unusual publications", + "description":"The element is used to store the notice for unusual publications. The first word should be capitalized. For example, `WebPage`, or `Distributed at the local tourist office`" + }, + + "key": { + "type": "string", + "title": "Key", + "description":"A key is a field used for alphabetizing, cross referencing, and creating a label when the `author' information is missing" + }, + + "organization": { + "type": "string", + "title": "Organization", + "description":"The organization that sponsors a conference or that publishes a manual" + }, + + "url": { + "type": ["string", "array"], + "title": "URL", + "description":"URL of the document, preferably a permanent URL" + }, "translators": { "type": "array", @@ -642,18 +699,6 @@ ] }, - "publisher": { - "type": "string", - "title": "Publisher", - "description":"Entity responsible for making the resource available" - }, - - "publisher_address": { - "type": "string", - "title":"Publisher's address", - "description": "For major publishing houses, just the city is given. For small publishers, you can help the reader by giving the complete address." - }, - "rights": { "type": "string", "title": "Rights", @@ -691,30 +736,29 @@ }, "sources": { - "type": "object", + "type":"array", "title": "Sources", - "description": "Description of sources used. The element is nestable so that the sources statement might encompass a series of discrete source statements, each of which could contain the facts about an individual source. ", - "_ddi_xpath":"stdyDscr/method/dataColl/sources", + "description": "Description of sources used. The element is nestable so that the sources statement might encompass a series of discrete source statements, each of which could contain the facts about an individual source. ", + "items":{ + "type": "object", "properties": { "source_origin":{ "type":"string", "title":"Origin of Source", - "description":"For historical materials, information about the origin(s) of the sources and the rules followed in establishing the sources should be specified. May not be relevant to survey data. ", - "_ddi_xpath":"stdyDscr/method/dataColl/sources/srcOrig" + "description":"For historical materials, information about the origin(s) of the sources and the rules followed in establishing the sources should be specified. May not be relevant to survey data. " }, "source_char":{ "type":"string", "title":"Characteristics of Source Noted", - "description":"Assessment of characteristics and quality of source material. May not be relevant to survey data.", - "_ddi_xpath":"stdyDscr/method/dataColl/sources/srcChar" + "description":"Assessment of characteristics and quality of source material. May not be relevant to survey data." }, "source_doc":{ "type":"string", "title":"Source documentation", - "description":"Documentation and Access to Sources", - "_ddi_xpath":"stdyDscr/method/dataColl/sources/srcDocu" + "description":"Documentation and Access to Sources" } } + } }, "data_sources":{ @@ -940,138 +984,7 @@ } } } - }, - - "lda_topics": { - "type": "array", - "title": "LDA topics", - "description": "LDA topics", - "items": { - "type": "object", - "properties": { - "model_info": { - "type": "array", - "title": "Model information", - "items": { - "type": "object", - "properties": { - "source": { - "title": "Source", - "type": "string" - }, - "author": { - "title": "Author", - "type": "string" - }, - "version": { - "title": "Version", - "type": "string" - }, - "model_id": { - "title": "Model Identifier", - "type": "string" - }, - "nb_topics": { - "title": "Number of topics", - "type": "number" - }, - "description": { - "title": "Description", - "type": "string" - }, - "corpus": { - "title": "Corpus name", - "type": "string" - }, - "uri": { - "title": "URI", - "type": "string" - } - } - }, - "required": [ - "model_id" - ] - }, - "topic_description": { - "type": "array", - "title": "Topic information", - "items": { - "type": "object", - "properties": { - "topic_id": { - "title": "Topic identifier", - "type": ["integer", "string"] - }, - "topic_score": { - "title": "Topic score", - "type": ["number", "string"] - }, - "topic_label": { - "title": "Topic label", - "type": "string" - }, - "topic_words": { - "type": "array", - "title": "Topic words", - "description": "Words", - "items": { - "type": "object", - "properties": { - "word": { - "title": "Word", - "type": "string" - }, - "word_weight": { - "title": "Word weight", - "type": "number" - } - } - }, - "required": [ - "word" - ] - } - } - }, - "required": [ - "topic_id" - ] - } - - }, - "additionalProperties": false - } - }, - "embeddings":{ - "type": "array", - "title": "Word embeddings", - "description": "Word embeddings", - "items": { - "type": "object", - "properties": { - "id": { - "title": "Vector Model ID", - "type": "string" - }, - "description": { - "title": "Vector Model Description", - "type": "string" - }, - "date": { - "title": "Date (YYYY-MM-DD)", - "type": "string" - }, - "vector": { - "title": "Vector", - "type": "object" - } - }, - "required": [ - "id","vector" - ] - } - } + } }, "required":["title_statement"], "additionalProperties": false @@ -1104,6 +1017,136 @@ "tag" ] }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": ["integer", "string"] + }, + "topic_score": { + "title": "Topic score", + "type": ["number", "string"] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + + }, + "additionalProperties": false + } + }, + "embeddings":{ + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": ["object","array"] + } + }, + "required": [ + "id","vector" + ] + } + }, "additional": { "type": "object", "description": "Additional metadata", diff --git a/api-documentation/catalog-admin/geospatial-schema.json b/api-documentation/catalog-admin/geospatial-schema.json index 0a045dbe6..55edd3388 100644 --- a/api-documentation/catalog-admin/geospatial-schema.json +++ b/api-documentation/catalog-admin/geospatial-schema.json @@ -1263,14 +1263,18 @@ "spatialResolution": { "title": "Spatial Resolution", "description": "Spatial resolution of the resource", - "type": "number", + "type": "object", "_xpath": "gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gco:Distance", "properties": { "uom": { "title": "Unit Of Measure", "description": "Unit considered for the resolution measure", - "type": "string", - "propertyType": "attribute" + "type": "string" + }, + "value": { + "title": "Value", + "description": "Value", + "type": "number" } } }, @@ -2027,10 +2031,141 @@ "required": [ "tag" ] - }, + }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": ["integer", "string"] + }, + "topic_score": { + "title": "Topic score", + "type": ["number", "string"] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + + }, + "additionalProperties": false + } + }, + "embeddings":{ + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } + }, + "required": [ + "id","vector" + ] + } + }, "additional": { "title": "Additional metadata", - "description": "Any additional metadata" + "description": "Any additional metadata", + "type":"object" } }, "required": [ diff --git a/api-documentation/catalog-admin/image-schema.json b/api-documentation/catalog-admin/image-schema.json index 2433a3d91..01be446d4 100644 --- a/api-documentation/catalog-admin/image-schema.json +++ b/api-documentation/catalog-admin/image-schema.json @@ -165,41 +165,171 @@ } } } - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags", - "items": { - "type": "object", - "properties": { - "tag": { - "title": "Tag", - "type": "string" + } + } + }, + "provenance":{ + "type":"array", + "description":"Provenance", + "items":{ + "$ref":"provenance-schema.json" + } + }, + "tags": { + "type": "array", + "title": "Tags", + "description": "Tags", + "items": { + "type": "object", + "properties": { + "tag": { + "title": "Tag", + "type": "string" + }, + "tag_group": { + "title": "Tag group", + "type": "string" + } + } + }, + "required": [ + "tag" + ] + }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": ["integer", "string"] + }, + "topic_score": { + "title": "Topic score", + "type": ["number", "string"] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" }, - "tag_group": { - "title": "Tag group", - "type": "string" + "word_weight": { + "title": "Word weight", + "type": "number" } - } - }, - "required": [ - "tag" - ] + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] } + + }, + "additionalProperties": false } + }, + "embeddings":{ + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } + }, + "required": [ + "id","vector" + ] + } + }, + "additional": { + "type": "object", + "description": "Additional metadata", + "properties": {} } - }, - "provenance":{ - "type":"array", - "description":"Provenance", - "items":{ - "$ref":"provenance-schema.json" - } - }, - "additional": { - "type": "object", - "description": "Additional metadata", - "properties": {} - } + } } \ No newline at end of file diff --git a/api-documentation/catalog-admin/script-schema.json b/api-documentation/catalog-admin/script-schema.json index 0a87296ee..d2dbfc4c1 100644 --- a/api-documentation/catalog-admin/script-schema.json +++ b/api-documentation/catalog-admin/script-schema.json @@ -96,6 +96,28 @@ "title": "Unique user defined ID", "description": "The ID number of a research project is a unique number that is used to identify a particular project. Define and use a consistent scheme to use." }, + "identifiers": { + "type": "array", + "title": "Other identifiers", + "description": "Other identifiers", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Identifier type", + "description": "Type of identifier e.g. `doi`, `handle`, `other`", + "type": "string" + }, + "identifier": { + "title": "Identifier", + "type": "string" + } + }, + "required": [ + "identifier" + ] + } + }, "title": { "type": "string", "title": "Project title", @@ -275,19 +297,22 @@ } }, "errata": { - "type": "object", + "type": "array", "title": "Errata", "description": "List of corrected errors in data, scripts or output", - "properties": { - "erratum_date": { - "title": "Date of erratum", - "description": "Date when the erratum was reported or published", - "type": "string" - }, - "erratum_description": { - "title": "Description of the erratum", - "description": "A description of the erratum, with information on which data, scripts, or output were impacted", - "type": "string" + "items": { + "type": "object", + "properties": { + "date": { + "title": "Date of erratum", + "description": "Date when the erratum was reported or published", + "type": "string" + }, + "description": { + "title": "Description of the erratum", + "description": "A description of the erratum, with information on which data, scripts, or output were impacted", + "type": "string" + } } } }, @@ -344,10 +369,12 @@ }, "abbreviation": { "title": "Abbreviation", - "description": "Abbreviation" + "description": "Abbreviation", + "type": "string" }, "email": { "title": "Email", + "type": "string", "description": "Email" }, "author_id": { @@ -359,10 +386,12 @@ "properties": { "type": { "title": "Type", + "type": "string", "description": "Source of identifier, e.g. ORCID" }, "id": { "title": "Identifier", + "type": "string", "description": "Author's unique identifier for the corresponding source" } } @@ -382,7 +411,7 @@ "type": "object", "properties": { "name": { - "title": "N`ame", + "title": "Name", "type": "string", "description": "Name of the person, corporate body, or agency responsible for the work's substantive and intellectual content. If a person, invert first and last name and use commas." }, @@ -397,14 +426,17 @@ }, "abbreviation": { "title": "Abbreviation", + "type": "string", "description": "Abbreviation" }, "email": { "title": "Email", + "type": "string", "description": "Email" }, "url": { "title": "URL", + "type": "string", "description": "URL" } }, @@ -465,14 +497,17 @@ }, "abbreviation": { "title": "Abbreviation", + "type": "string", "description": "Abbreviation" }, "email": { "title": "Email", + "type": "string", "description": "Email" }, "url": { "title": "URL", + "type": "string", "description": "URL" } }, @@ -482,29 +517,32 @@ } }, "reviews_comments": { - "type": "object", - "title": "Reviews and comments", - "description": "List and description of reviews and comments received on the project", - "properties": { - "comment_date": { - "title": "Date of the comment", - "description": "Date when the comment was provided", - "type": "string" - }, - "comment_by": { - "title": "Provider of the comment", - "description": "Name and title of the comment provider (individual or organization)", - "type": "string" - }, - "comment_description": { - "title": "Description of the comment", - "description": "A description of the comment", - "type": "string" - }, - "comment_response": { - "title": "Response on the comment", - "description": "Response by the primary investigator or research team on the comment", - "type": "string" + "type": "array", + "items": { + "type": "object", + "title": "Reviews and comments", + "description": "List and description of reviews and comments received on the project", + "properties": { + "comment_date": { + "title": "Date of the comment", + "description": "Date when the comment was provided", + "type": "string" + }, + "comment_by": { + "title": "Provider of the comment", + "description": "Name and title of the comment provider (individual or organization)", + "type": "string" + }, + "comment_description": { + "title": "Description of the comment", + "description": "A description of the comment", + "type": "string" + }, + "comment_response": { + "title": "Response on the comment", + "description": "Response by the primary investigator or research team on the comment", + "type": "string" + } } } }, @@ -538,6 +576,18 @@ "description": "Acknowledgement statement", "type": "string" }, + "disclaimer": { + "title": "Disclaimer", + "type": "string" + }, + "confidentiality": { + "title": "Confidentiality", + "type": "string" + }, + "citation_requirement": { + "type": "string", + "description": "Citation requirement (can include a specific recommended citation)" + }, "related_projects": { "type": "array", "title": "Related research projects", @@ -615,27 +665,37 @@ } }, "themes": { - "title": "Themes", "type": "array", - "description": "Themes covered by the project (ideally, a controlled vocabulary should be used)", + "description": "Themes", "items": { "type": "object", "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, "name": { "title": "Name", - "description": "Theme label, typically extracted from a pre-defined taxonomy", + "type": "string" + }, + "parent_id": { + "title": "Parent Identifier", "type": "string" }, "vocabulary": { - "title": "Vocabulary name", - "description": "Vocabulary name (for themes extracted from controlled vocabularies)", + "title": "Vocabulary", + "description": "Name of the controlled vocabulary", "type": "string" }, "uri": { "title": "Vocabulary URI", + "description": "Link to the controlled vocabulary web page, if the theme is from a taxonomy.", "type": "string" } - } + }, + "required": [ + "name" + ] } }, "topics": { @@ -678,22 +738,31 @@ "disciplines": { "type": "array", "title": "Disciplines", - "description": "Disciplines e.g. `Social sciences, economics`, `Natural sciences, biology` (ideally, a controlled vocabulary should be used)", + "description": "Disciplines e.g. `Social sciences, economics`, `Natural sciences, biology`", "items": { "type": "object", "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, "name": { "title": "Discipline title or name", "type": "string" }, + "parent_id": { + "title": "Parent discipline Identifier", + "description": "Parent discipline ID", + "type": "string" + }, "vocabulary": { - "title": "Vocabulary name", - "description": "Vocabulary name (for disciplines extracted from controlled vocabularies)", + "title": "Vocabulary", + "description": "Vocabulary", "type": "string" }, "uri": { - "title": "Vocabulary URI", - "description": "Vocabulary uri", + "title": "URI", + "description": "Website link", "type": "string" } }, @@ -747,6 +816,10 @@ } } }, + "copyright": { + "title": "Copyright", + "type": "string" + }, "technology_environment": { "title": "Technology environment", "description": "Notes about the technology environment used by the authors to implement the project", @@ -808,7 +881,7 @@ }, "additionalProperties": false }, - "required": [ + "required": [ "name" ] }, @@ -975,20 +1048,24 @@ "title": "Name", "type": "string" }, + "role": { + "title": "Role", + "type": "string" + }, "affiliation": { "title": "Affiliation", "type": "string" }, - "role": { - "title": "Role", + "email": { + "title": "Email", "type": "string" }, - "uri": { - "title": "URI", + "telephone": { + "title": "Telephone", "type": "string" }, - "phone": { - "title": "Phone number", + "uri": { + "title": "URI", "type": "string" } } @@ -996,52 +1073,171 @@ "required": [ "name" ] - }, - "provenance":{ - "type":"array", - "description":"Provenance", - "items":{ - "$ref":"provenance-schema.json" - } + } + } + }, + "provenance": { + "type": "array", + "description": "Provenance", + "items": { + "$ref": "provenance-schema.json" + } + }, + "tags": { + "type": "array", + "title": "Tags (user-defined)", + "description": "Tags", + "items": { + "type": "object", + "properties": { + "tag": { + "title": "Tag", + "type": "string" }, - "tags": { - "type": "array", - "title": "Tags (user-defined)", - "description": "Tags", - "items": { - "type": "object", - "properties": { - "tag": { - "title": "Tag", - "type": "string" - }, - "tag_group": { - "title": "Tag group", - "type": "string" + "tag_group": { + "title": "Tag group", + "type": "string" + } + } + }, + "required": [ + "tag" + ] + }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } } - } - }, - "required": [ - "tag" - ] - }, - "copyright": { - "title": "Copyright", - "type": "string" - }, - "disclaimer": { - "title": "Disclaimer", - "type": "string" + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": ["integer", "string"] + }, + "topic_score": { + "title": "Topic score", + "type": ["number", "string"] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + }, - "confidentiality": { - "title": "Confidentiality", - "type": "string" + "additionalProperties": false + } + }, + "embeddings":{ + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } }, - "citation_requirement": { - "type": "string", - "description": "Citation requirement (can include a specific recommended citation)" - } + "required": [ + "id","vector" + ] } + }, + "additional": { + "type": "object", + "description": "Additional metadata", + "properties": {} } } } \ No newline at end of file diff --git a/api-documentation/catalog-admin/survey-schema.json b/api-documentation/catalog-admin/survey-schema.json index 97b2c6183..1b484cddc 100644 --- a/api-documentation/catalog-admin/survey-schema.json +++ b/api-documentation/catalog-admin/survey-schema.json @@ -3,61 +3,61 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Survey Microdata Schema", "id": "survey-schema.json", - "version" :"0.0", - "description": "Schema for Survey data type based on DDI 2.5", - "allOf": [ + "version": "0.0", + "description": "Schema for Survey data type based on DDI 2.5", + "allOf": [ { - "type": "object", - "properties": { - "repositoryid": { - "type": "string", - "title": "Collection ID that owns the survey", - "description": "Abbreviation for the collection that owns this survey." - }, - "access_policy": { - "type": "string", - "title": "Data access policy", - "description": "Data access policy for attached microdata resources", - "enum": [ - "direct", - "open", - "public", - "licensed", - "remote", - "data_na" - ], - "default": "data_na" - }, - "data_remote_url": { - "type": "string", - "title": "Link to the external website", - "description": "For `access_policy` = `remote`, provide a link to the external website" - }, - "published": { - "type": "integer", - "description": "Status of the survey - 0=draft, 1=published", - "default": 0 - }, - "overwrite": { - "type": "string", - "description": "Overwrite survey if already exists?", - "enum":["yes","no"], - "default": "no" - } + "type": "object", + "properties": { + "repositoryid": { + "type": "string", + "title": "Collection ID that owns the survey", + "description": "Abbreviation for the collection that owns this survey." + }, + "access_policy": { + "type": "string", + "title": "Data access policy", + "description": "Data access policy for attached microdata resources", + "enum": [ + "direct", + "open", + "public", + "licensed", + "remote", + "data_na" + ], + "default": "data_na" + }, + "published": { + "type": "integer", + "description": "Status of the survey - 0=draft, 1=published", + "default": 0 + }, + "overwrite": { + "type": "string", + "description": "Overwrite survey if already exists?", + "enum": [ + "yes", + "no" + ], + "default": "no" } + } + }, + { + "$ref": "ddi-schema.json" }, - { "$ref": "ddi-schema.json" }, { "type": "object", - "properties": { - "provenance":{ - "type":"array", - "description":"Provenance", - "items":{ - "$ref":"provenance-schema.json" + "properties": { + "provenance": { + "type": "array", + "description": "Provenance", + "items": { + "$ref": "provenance-schema.json" } }, - "tags": { + "tags": { "type": "array", "title": "Tags (user-defined)", "description": "Tags", @@ -78,12 +78,148 @@ "tag" ] }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": [ + "integer", + "string" + ] + }, + "topic_score": { + "title": "Topic score", + "type": [ + "number", + "string" + ] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + }, + "additionalProperties": false + } + }, + "embeddings": { + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } + }, + "required": [ + "id", + "vector" + ] + } + }, "additional": { "type": "object", "description": "Additional metadata not covered by DDI elements", "properties": {} } + } } - } -] + ] } \ No newline at end of file diff --git a/api-documentation/catalog-admin/swagger.yaml b/api-documentation/catalog-admin/swagger.yaml index ec2ee1398..d420dbadb 100644 --- a/api-documentation/catalog-admin/swagger.yaml +++ b/api-documentation/catalog-admin/swagger.yaml @@ -37,8 +37,8 @@ x-tagGroups: - Collections - Datasets - External resources - - Survey - Scripts + - Survey - Timeseries - Geospatial - Images @@ -1158,11 +1158,12 @@ paths: $ref: '#/definitions/VariableList' security: - ApiKeyAuth: [] + /datasets/variables/{IDNo}/{partialUpdate}: post: tags: - Survey summary: Create variable - description: Create a new variable for a data file. To create multiple variables at once, pass them as a list of variables. + description: Create or update a variable. To create multiple variables at once, pass them as a list of variables. operationId: createDatasetVariable consumes: - application/json @@ -1175,12 +1176,11 @@ paths: required: true type: string format: string - - name: fileId + - name: partialUpdate in: path - description: File ID - user defined unique file identifier - required: true - type: string - format: string + description: To update partial metadata, set value to `true`. Default is `false` to replace all metadata fields. + type: boolean + format: boolean - in: "body" name: "body" required: true @@ -1416,7 +1416,7 @@ paths: - ApiKeyAuth: [] /datasets/generate_pdf/{datasetIDNo}: - put: + post: tags: - Survey summary: Generate PDF diff --git a/api-documentation/catalog-admin/table-schema.json b/api-documentation/catalog-admin/table-schema.json index 983a7517a..530f9ca90 100644 --- a/api-documentation/catalog-admin/table-schema.json +++ b/api-documentation/catalog-admin/table-schema.json @@ -3,29 +3,29 @@ "$schema": "http://json-schema.org/draft-07/schema#", "description": "Draft Schema for Table data type", "type": "object", - "definitions":{ - "authoring_entity":{ - "type":"array", - "title":"Authoring entity/Primary investigators", - "description":"The person, corporate body, or agency responsible for the work's substantive and intellectual content. Repeat the element for each author, and use 'affiliation' attribute if available. Invert first and last name and use commas.", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Agency Name", - "type":"string" + "definitions": { + "authoring_entity": { + "type": "array", + "title": "Authoring entity/Primary investigators", + "description": "The person, corporate body, or agency responsible for the work's substantive and intellectual content. Repeat the element for each author, and use 'affiliation' attribute if available. Invert first and last name and use commas.", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Agency Name", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "abbreviation":{ - "title":"Abbreviation", - "type":"string" + "abbreviation": { + "title": "Abbreviation", + "type": "string" }, - "uri":{ - "title":"URI", - "type":"string" + "uri": { + "title": "URI", + "type": "string" }, "author_id": { "type": "array", @@ -46,94 +46,97 @@ } } }, - "required":[ + "required": [ "name" ] } }, - "contributor":{ - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "contributor": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" }, - "affiliation":{ - "title":"Affiliation", - "type":"string" + "affiliation": { + "title": "Affiliation", + "type": "string" }, - "abbreviation":{ - "title":"Abbreviation", - "type":"string" + "abbreviation": { + "title": "Abbreviation", + "type": "string" }, - "role":{ - "title":"Role", - "type":"string" + "role": { + "title": "Role", + "type": "string" }, - "uri":{ - "title":"URI", - "type":"string" + "uri": { + "title": "URI", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, - "keyword":{ - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" + "keyword": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" }, - "vocabulary":{ - "title":"Vocabulary name", - "type":"string" + "vocabulary": { + "title": "Vocabulary name", + "type": "string" }, - "uri":{ - "title":"Vocabulary URI", - "type":"string" + "uri": { + "title": "Vocabulary URI", + "type": "string" } } } } }, - "properties": { - + "properties": { "repositoryid": { "type": "string", "title": "Collection ID that owns the document", "description": "Abbreviation for the collection that owns the document" }, - "published": { "type": "integer", "title": "Status", "description": "Status - 0=draft, 1=published", "default": 0 }, - "overwrite": { "type": "string", - "description": "Overwrite document if already exists?", - "enum":["yes","no"], + "description": "Overwrite document if already exists?", + "enum": [ + "yes", + "no" + ], "default": "no" }, - - "metadata_information": { + "metadata_information": { "type": "object", "title": "Document metadata information", "description": "Document description", - "properties": { + "properties": { "idno": { "title": "Unique ID number for the document", "type": "string" }, + "title": { + "title": "Document title", + "type": "string" + }, "producers": { "type": "array", "title": "Producers", @@ -181,8 +184,7 @@ "type": "object", "title": "Table Description", "description": "Table Description", - "properties": { - + "properties": { "title_statement": { "type": "object", "description": "Title statement", @@ -212,10 +214,9 @@ "title": "Abbreviation or Acronym", "description": "Any form of the title used as a substitute or alternative to the formal title of the resource." }, - "abbreviated_title": { - "title": "Abbreviated Title", - "description": "Title as abbreviated for indexing or identification.", - "type": "string" + "translated_title": { + "title": "Translated title", + "type": "string" } }, "required": [ @@ -223,99 +224,98 @@ "title" ] }, - - "id_numbers": { - "type": "object", - "title": "Identifier numbers", - "description": "Numbers e.g. ISSN, ISBN, DOI, etc.", - "properties": { - "type": { - "title": "Type", - "description":"ID number type such as ISSN, ISBN, DOI", - "type": "string" + "identifiers": { + "type": "array", + "title": "Other identifiers", + "description": "Other identifiers", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Identifier type", + "description": "Type of identifier e.g. `doi`, `handle`, `other`", + "type": "string" + }, + "identifier": { + "title": "Identifier", + "type": "string" + } }, - "value": { - "title": "ID number", - "type": "string" - } - }, - "required": [ - "type","value" - ] - }, - + "required": [ + "identifier" + ] + } + }, "authoring_entity": { "title": "Authoring entity", - "$ref":"#/definitions/authoring_entity", + "$ref": "#/definitions/authoring_entity", "description": "Authoring entity" }, "contributors": { "title": "Contributors", - "$ref":"#/definitions/contributor", + "$ref": "#/definitions/contributor", "description": "Contributors" }, - "publisher":{ - "type":"array", - "title":"Publisher", - "description":"Publisher", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" - }, - "affiliation":{ - "title":"Affiliation", - "type":"string" - }, - "abbreviation":{ - "title":"Abbreviation", - "type":"string" - }, - "role":{ - "title":"Role", - "type":"string" - }, - "uri":{ - "title":"URI", - "type":"string" + "publisher": { + "type": "array", + "title": "Publisher", + "description": "Publisher", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "abbreviation": { + "title": "Abbreviation", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" } }, - "required":[ + "required": [ "name" ] } }, "date_created": { "type": "string", - "title":"Date created", + "title": "Date created", "description": "Date created" }, "date_published": { "type": "string", - "title":"Date published" + "title": "Date published" }, "date_modified": { "type": "string", - "title":"Date last modified", - "description": "Date on which the resource was changed." + "title": "Date last modified", + "description": "Date on which the resource was changed." }, - "version": { "title": "Version", - "type": "string" + "type": "string" }, "description": { "title": "Description", "type": "string", - "description":"Description" + "description": "Description" }, - "table_columns": { "type": "array", "title": "Table column names", - "description": "List of table column names", + "description": "List of table column names", "items": { "type": "object", "properties": { @@ -327,7 +327,7 @@ "title": "Variable name", "description": "Variable name", "type": "string" - }, + }, "dataset": { "title": "Dataset", "type": "string", @@ -339,11 +339,10 @@ ] } }, - "table_rows": { "type": "array", "title": "Table row level data", - "description": "Table row level data", + "description": "Table row level data", "items": { "type": "object", "properties": { @@ -355,7 +354,7 @@ "title": "Variable name", "description": "Variable name", "type": "string" - }, + }, "dataset": { "title": "Dataset", "type": "string", @@ -367,7 +366,6 @@ ] } }, - "table_footnotes": { "type": "array", "title": "Chart footnotes", @@ -377,7 +375,7 @@ "properties": { "number": { "title": "Footnote number", - "description":"Footnote number", + "description": "Footnote number", "type": "string" }, "text": { @@ -388,13 +386,12 @@ "required": [ "text" ] - } + } }, - "table_series": { "type": "array", "title": "Table series", - "description": "Table series", + "description": "Table series", "items": { "type": "object", "properties": { @@ -421,10 +418,9 @@ ] } }, - "statistics": { "type": "array", - "title": "Statistics", + "title": "Statistics", "items": { "type": "object", "properties": { @@ -437,7 +433,7 @@ }, "unit_observation": { "type": "array", - "title": "Unit observation", + "title": "Unit observation", "items": { "type": "object", "properties": { @@ -450,19 +446,38 @@ }, "data_sources": { "type": "array", - "title": "Data sources", + "title": "Data sources", "items": { "type": "object", "properties": { - "source": { - "title": "Source", + "name": { + "title": "Name", + "type": "string", + "description": "The name (title) of the data source. For example, a table data may be extracted from the `Population Census 2020`." + }, + "abbreviation": { + "title": "Abbreviation", + "description": "The abbreviation (acronym) of the data source.", "type": "string" + }, + "source_id": { + "title": "Source ID", + "description": "A unique identifier for the source, such as a Digital Object Identifier (DOI).", + "type": "string" + }, + "note": { + "title": "Note", + "type": "string", + "description": "A note that describes how the source was used, possibly mentioning issues in the use of the source." + }, + "uri": { + "title": "URI", + "type": "string", + "description": "A link (URL) to the source dataset." } } } }, - - "time_periods": { "type": "array", "title": "Time periods", @@ -485,11 +500,10 @@ "from" ] } - }, - + }, "universe": { "type": "array", - "title": "Universe", + "title": "Universe", "items": { "type": "object", "properties": { @@ -500,10 +514,9 @@ } } }, - "ref_country": { "type": "array", - "title": "Reference country", + "title": "Reference country", "items": { "type": "object", "properties": { @@ -518,7 +531,6 @@ } } }, - "geographic_units": { "title": "Geographic locations", "description": "List of geographic units (regions, countries, states, provinces, etc.) for which data are available in the database.", @@ -540,19 +552,43 @@ "title": "Type", "description": "Type of geographic unit e.g. country, state, region, province etc", "type": "string" - } + } }, "required": [ "name" ] } - }, + }, "geographic_granularity": { "description": "Granularity of geographic coverage. examples `national`, `regional`, `provincial`", "type": "string", - "title":"Geographic granularity" + "title": "Geographic granularity" + }, + "bbox": { + "title": "Geographic bounding box", + "type": "array", + "items": { + "type": "object", + "properties": { + "west": { + "title": "West", + "type": "string" + }, + "east": { + "title": "East", + "type": "string" + }, + "south": { + "title": "South", + "type": "string" + }, + "north": { + "title": "North", + "type": "string" + } + } + } }, - "languages": { "type": "array", "description": "languages", @@ -575,10 +611,9 @@ "name" ] }, - "links": { "type": "array", - "title": "Links", + "title": "Links", "items": { "type": "object", "properties": { @@ -593,10 +628,26 @@ } } }, - + "api_documentation": { + "type": "array", + "description": "API Documentation", + "items": { + "type": "object", + "properties": { + "description": { + "title": "Description", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + } + }, "publications": { "type": "array", - "title": "Publications", + "title": "Publications", "items": { "type": "object", "properties": { @@ -611,19 +662,48 @@ } } }, - "keywords":{ - "allOf": [ - {"$ref":"#/definitions/keyword"} + "keywords": { + "allOf": [ + { + "$ref": "#/definitions/keyword" + } ], - "title":"Keywords", - "description":"Keywords" - }, - "themes":{ - "type":"array", - "description":"Themes", - "allOf": [ - {"$ref":"#/definitions/keyword"} - ] + "title": "Keywords", + "description": "Keywords" + }, + "themes": { + "type": "array", + "description": "Themes", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "parent_id": { + "title": "Parent Identifier", + "type": "string" + }, + "vocabulary": { + "title": "Vocabulary", + "description": "Name of the controlled vocabulary", + "type": "string" + }, + "uri": { + "title": "Vocabulary URI", + "description": "Link to the controlled vocabulary web page, if the theme is from a taxonomy.", + "type": "string" + } + }, + "required": [ + "name" + ] + } }, "topics": { "type": "array", @@ -642,7 +722,7 @@ }, "parent_id": { "title": "Parent topic Identifier", - "description":"For subtopics, provide the ID of the parent topic", + "description": "For subtopics, provide the ID of the parent topic", "type": "string" }, "vocabulary": { @@ -657,11 +737,11 @@ } }, "required": [ - "id","name" + "id", + "name" ] } }, - "disciplines": { "type": "array", "title": "Disciplines", @@ -669,10 +749,19 @@ "items": { "type": "object", "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, "name": { "title": "Discipline title or name", "type": "string" }, + "parent_id": { + "title": "Parent discipline Identifier", + "description": "Parent discipline ID", + "type": "string" + }, "vocabulary": { "title": "Vocabulary", "description": "Vocabulary", @@ -689,7 +778,6 @@ ] } }, - "definitions": { "type": "array", "title": "Definitions", @@ -717,7 +805,6 @@ ] } }, - "classifications": { "type": "array", "title": "Classifications", @@ -750,16 +837,13 @@ ] } }, - - "rights": { "type": "string", "title": "Rights" }, - "license": { "type": "array", - "title": "License", + "title": "License", "items": { "type": "object", "properties": { @@ -774,18 +858,20 @@ } } }, - "citation": { "type": "string", - "title":"Citation", - "description": "A bibliographic reference for the resource." + "title": "Citation", + "description": "A bibliographic reference for the resource." }, - "confidentiality": { "type": "string", - "title":"Confidentiality" + "title": "Confidentiality" + }, + "sdc": { + "type": "string", + "title": "Statistical disclosure control", + "description": "Information on statistical disclosure control measures applied to the table. This can include cell suppression, or other techniques. Specialized packages have been developed for this purpose, like [*sdcTable: Methods for Statistical Disclosure Control in Tabular Data*](https://cran.r-project.org/web/packages/sdcTable/index.html) and https://cran.r-project.org/web/packages/sdcTable/sdcTable.pdf \nThe information provided here should be such that it does not provide intruders with useful information for reverse-engineering the protection measures applied to the table." }, - "contacts": { "type": "array", "title": "Contacts", @@ -823,10 +909,9 @@ "name" ] }, - "notes": { "type": "array", - "title": "Notes", + "title": "Notes", "items": { "type": "object", "properties": { @@ -837,7 +922,6 @@ } } }, - "relations": { "type": "array", "title": "Relations", @@ -852,7 +936,7 @@ "type": { "title": "Type", "type": "string", - "enum":[ + "enum": [ "isPartOf", "hasPart", "isVersionOf", @@ -871,19 +955,17 @@ "required": [ "name" ] - } - + } }, "additionalProperties": false }, - - "provenance":{ - "type":"array", - "description":"Provenance", - "items":{ - "$ref":"provenance-schema.json" + "provenance": { + "type": "array", + "description": "Provenance", + "items": { + "$ref": "provenance-schema.json" } - }, + }, "tags": { "type": "array", "title": "Tags", @@ -905,11 +987,146 @@ "tag" ] }, - + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": [ + "integer", + "string" + ] + }, + "topic_score": { + "title": "Topic score", + "type": [ + "number", + "string" + ] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + }, + "additionalProperties": false + } + }, + "embeddings": { + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } + }, + "required": [ + "id", + "vector" + ] + } + }, "additional": { "type": "object", "description": "Additional metadata", "properties": {} } } -} +} \ No newline at end of file diff --git a/api-documentation/catalog-admin/timeseries-db-schema.json b/api-documentation/catalog-admin/timeseries-db-schema.json index e7ac76a92..be19fb3a4 100644 --- a/api-documentation/catalog-admin/timeseries-db-schema.json +++ b/api-documentation/catalog-admin/timeseries-db-schema.json @@ -5,21 +5,21 @@ "description": "Schema for timeseries database", "type": "object", "properties": { - "published": { "type": "integer", "title": "Status", "description": "0=draft, 1=published", "default": 0 }, - "overwrite": { "type": "string", "description": "Overwrite database if already exists?", - "enum": ["yes", "no"], + "enum": [ + "yes", + "no" + ], "default": "no" }, - "metadata_information": { "type": "object", "title": "Document metadata information", @@ -62,7 +62,7 @@ } } }, - "production_date": { + "prod_date": { "type": "string", "title": "Date of Production", "description": "Document production date using format(YYYY-MM-DD)" @@ -79,16 +79,36 @@ "title": "Database Description", "description": "Database Description", "properties": { - "title_statement": { "type": "object", "description": "Study title", - "properties": { "idno": { "type": "string", "title": "Unique user defined ID", - "description": "The ID number of a dataset is a unique number that is used to identify a particular survey. Define and use a consistent scheme to use. Such an ID could be constructed as follows: country-producer-survey-year-version where \n - country is the 3-letter ISO country abbreviation \n - producer is the abbreviation of the producing agency \n - survey is the survey abbreviation \n - year is the reference year (or the year the survey started) \n - version is the number dataset version number (see Version Description below)" + "description": "The ID number of a database is a unique number that is used to identify a particular database." + }, + "identifiers": { + "type": "array", + "title": "Other identifiers", + "description": "Other identifiers", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Identifier type", + "description": "Type of identifier e.g. `doi`, `handle`, `other`", + "type": "string" + }, + "identifier": { + "title": "Identifier", + "type": "string" + } + }, + "required": [ + "identifier" + ] + } }, "title": { "type": "string", @@ -99,13 +119,11 @@ "type": "string", "title": "Survey subtitle", "description": "A short subtitle for the survey" - }, "alternate_title": { "type": "string", "title": "Abbreviation or Acronym", "description": "The abbreviation of a survey is usually the first letter of each word of the titled survey. The survey reference year(s) may be included." - }, "translated_title": { "title": "Translated Title", @@ -118,7 +136,6 @@ "title" ] }, - "authoring_entity": { "type": "array", "title": "Authoring entity", @@ -130,23 +147,24 @@ "title": "Agency Name", "type": "string", "description": "Name of the person, corporate body, or agency responsible for the work's substantive and intellectual content. If a person, invert first and last name and use commas." - }, - "role": { - "title": "Role", - "type": "string", - "description": "Title of the person (if any) responsible for the work's substantive and intellectual content." - }, + }, "affiliation": { "title": "Affiliation", "type": "string" }, "abbreviation": { "title": "Abbreviation", - "description": "Abbreviation" + "description": "Abbreviation", + "type": "string" }, "email": { "title": "Email", - "description": "Email" + "description": "Email", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" } }, "required": [ @@ -210,7 +228,8 @@ } }, "required": [ - "version", "date" + "version", + "date" ] } }, @@ -272,33 +291,40 @@ } } }, - "themes": { - "type": "array", - "title": "Themes", - "description": "Themes", + "themes":{ + "type":"array", + "description":"Themes", "items": { - "type": "object", - "properties": { - "name": { - "title": "Topic", - "type": "string" - }, - "vocabulary": { - "title": "Vocabulary", - "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.", - "type": "string" - }, - "uri": { - "title": "Vocabulary URI", - "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.", - "type": "string" - } + "type": "object", + "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" }, - "required": [ - "name" - ] + "name": { + "title": "Name", + "type": "string" + }, + "parent_id": { + "title": "Parent Identifier", + "type": "string" + }, + "vocabulary": { + "title": "Vocabulary", + "description": "Name of the controlled vocabulary", + "type": "string" + }, + "uri": { + "title": "Vocabulary URI", + "description": "Link to the controlled vocabulary web page, if the theme is from a taxonomy.", + "type": "string" + } + }, + "required": [ + "name" + ] } - }, + }, "topics": { "type": "array", "title": "Topics", @@ -331,7 +357,8 @@ } }, "required": [ - "id", "name" + "id", + "name" ] } }, @@ -359,6 +386,24 @@ ] } }, + "ref_country": { + "type": "array", + "title": "Reference country", + "description": "List of countries for which data are available", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Country name", + "type": "string" + }, + "code": { + "title": "Country code", + "type": "string" + } + } + } + }, "geographic_units": { "title": "Geographic locations", "description": "List of geographic units (regions, countries, states, provinces, etc.) for which data are available in the database.", @@ -418,18 +463,15 @@ } } }, - "geographic_granularity": { "title": "Geographic granularity", "description": "Granularity of geographic coverage e.g. `national`, `regional`, `provincial`", "type": "string" }, - "geographic_area_count": { "description": "Number of geographic areas", "type": "string" }, - "sponsors": { "type": "array", "title": "Sponsor/Funding Agency", @@ -467,7 +509,6 @@ "name" ] }, - "acknowledgments": { "type": "array", "title": "Other Acknowledgments", @@ -497,7 +538,10 @@ "name" ] }, - + "acknowledgment_statement": { + "title": "An overall statement of acknowledgment, which can be used as an alternative (or supplement) to the itemized list provided in `acknowledgments`.", + "type": "string" + }, "contacts": { "type": "array", "title": "Contacts", @@ -535,7 +579,6 @@ "name" ] }, - "links": { "type": "array", "title": "Related links", @@ -557,7 +600,6 @@ "uri" ] }, - "languages": { "type": "array", "description": "Supported languages", @@ -614,8 +656,8 @@ "items": { "type": "object", "properties": { - "type": { - "title": "Type", + "name": { + "title": "Name", "type": "string" }, "uri": { @@ -629,7 +671,7 @@ } }, "required": [ - "type" + "name" ] }, "citation": { @@ -650,7 +692,6 @@ } } }, - "disclaimer": { "title": "Disclaimer", "type": "string" @@ -665,7 +706,13 @@ ], "additionalProperties": false }, - + "provenance": { + "type": "array", + "description": "Provenance", + "items": { + "$ref": "provenance-schema.json" + } + }, "additional": { "type": "object", "title": "Additional custom metadata", diff --git a/api-documentation/catalog-admin/timeseries-schema.json b/api-documentation/catalog-admin/timeseries-schema.json index f620472c3..61c06772f 100644 --- a/api-documentation/catalog-admin/timeseries-schema.json +++ b/api-documentation/catalog-admin/timeseries-schema.json @@ -1,109 +1,121 @@ { - "$id": "http://ihsn.org/schemas/timeseries", - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Timeseries Schema", - "description": "Schema for timeseries data type", - "type": "object", - "properties": { - - "repositoryid": { - "type": "string", - "title": "Collection ID that owns the series", - "description": "Collection that owns the series" - }, - - "access_policy": { - "type": "string", - "title": "Data access policy", - "description": "Data access policy for attached microdata resources", - "enum": [ - "direct", - "open", - "public", - "licensed", - "remote", - "na" - ], - "default": "na" - }, - - "data_remote_url": { - "type": "string", - "title": "Data website URL", - "description": "Link to the website where the data is available, this is only needed if `access_policy` is set to `remote`." - }, - "published": { - "type": "integer", - "title": "Status", - "description": "Status of the study - 0=draft, 1=published", - "default": 0 - }, - "overwrite": { - "type": "string", - "description": "Overwrite database if already exists?", - "enum":["yes","no"], - "default": "no" - }, - - "metadata_creation": { - "type": "object", - "title": "Metadata creation", - "description": "Information on who generated the documentation", - "properties": { - - "producers": { - "type": "array", - "title": "Producers", - "description": "List of producers", - "items": { - "type": "object", - "properties": { - "name": { - "title": "Name", - "description": "Name (required)", - "type": "string" - }, - "abbr": { - "title": "Abbreviation", - "type": "string" - }, - "affiliation": { - "type": "string", - "title": "Affiliation" - }, - "role": { - "title": "Role", - "type": "string" - } - } - }, - "required": [ - "name" - ] - }, - "prod_date": { - "title": "Date of Production", - "description": "Document production date using format(YYYY-MM-DD)", - "type": "string" - }, - "version": { - "title": "Document version", - "description": "Identify and describe the current version of the document", - "type": "string" - } - }, - "additionalProperties": false - }, - - "series_description":{ - "description" :"Series information", - "type": "object", - "properties": { + "$id": "http://ihsn.org/schemas/timeseries", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Timeseries Schema", + "description": "Schema for timeseries data type", + "type": "object", + "properties": { + "repositoryid": { + "type": "string", + "title": "Collection ID that owns the series", + "description": "Collection that owns the series" + }, + "access_policy": { + "type": "string", + "title": "Data access policy", + "description": "Data access policy for attached microdata resources", + "enum": [ + "direct", + "open", + "public", + "licensed", + "remote", + "na" + ], + "default": "na" + }, + "data_remote_url": { + "type": "string", + "title": "Data website URL", + "description": "Link to the website where the data is available, this is only needed if `access_policy` is set to `remote`." + }, + "published": { + "type": "integer", + "title": "Status", + "description": "Status of the study - 0=draft, 1=published", + "default": 0 + }, + "overwrite": { + "type": "string", + "description": "Overwrite database if already exists?", + "enum": [ + "yes", + "no" + ], + "default": "no" + }, + "metadata_information": { + "type": "object", + "title": "Metadata creation", + "description": "Information on who generated the documentation", + "properties": { + "title": { + "title": "Document title", + "description": "Document title", + "type": "string", + "_ddi_xpath": "docDscr/citation/titlStmt/titl" + }, + "idno": { + "title": "Unique ID number for the document", + "type": "string", + "_ddi_xpath": "docDscr/citation/titlStmt/IDNo" + }, + "producers": { + "type": "array", + "title": "Producers", + "description": "List of producers", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Name (required)", + "type": "string" + }, + "abbr": { + "title": "Abbreviation", + "type": "string" + }, + "affiliation": { + "type": "string", + "title": "Affiliation" + }, + "role": { + "title": "Role", + "type": "string" + } + } + }, + "required": [ + "name" + ] + }, + "prod_date": { + "title": "Date of Production", + "description": "Document production date using format(YYYY-MM-DD)", + "type": "string" + }, + "version": { + "title": "Document version", + "description": "Identify and describe the current version of the document", + "type": "string" + } + }, + "additionalProperties": false + }, + "series_description": { + "description": "Series information", + "type": "object", + "properties": { "idno": { "type": "string", "title": "Series unique ID", "description": "Unique series ID" }, + "doi": { + "type": "string", + "title": "DOI handle" + }, "name": { "type": "string", "title": "Series Name" @@ -158,10 +170,52 @@ ] } }, + "languages": { + "type": "array", + "description": "Supported languages", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Language title", + "type": "string" + }, + "code": { + "title": "code", + "Descripton": "Language code", + "type": "string" + } + } + }, + "required": [ + "name" + ] + }, "measurement_unit": { "type": "string", "title": "Series unit of measure" }, + "dimensions": { + "type": "array", + "title": "Dimensions", + "items": { + "type": "object", + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string" + } + }, + "required": [ + "label" + ] + } + }, "periodicity": { "type": "string", "title": "Periodicity of data" @@ -205,12 +259,10 @@ ] } }, - "statistical_concept": { "type": "string", "title": "Statistical concept" }, - "concepts": { "type": "array", "title": "Related concepts", @@ -228,10 +280,10 @@ "type": "string" }, "uri": { - "title": "URI", - "description": "Website link", - "type": "string" - } + "title": "URI", + "description": "Website link", + "type": "string" + } }, "required": [ "name" @@ -266,99 +318,107 @@ "type": "string", "title": "Breaks in series" }, - "limitation": { "type": "string", "title": "Limitations and exceptions" - }, - - "themes":{ - "type":"array", - "title":"Themes", - "items":{ - "type":"object", - "properties":{ - "name":{ - "title":"Name", - "type":"string" - }, - "vocabulary":{ - "title":"Vocabulary name", - "type":"string" - }, - "uri":{ - "title":"Vocabulary URI", - "type":"string" + }, + "themes": { + "type": "array", + "description": "Themes", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "parent_id": { + "title": "Parent Identifier", + "type": "string" + }, + "vocabulary": { + "title": "Vocabulary", + "description": "Name of the controlled vocabulary", + "type": "string" + }, + "uri": { + "title": "Vocabulary URI", + "description": "Link to the controlled vocabulary web page, if the theme is from a taxonomy.", + "type": "string" } - } + }, + "required": [ + "name" + ] + } + }, + "topics": { + "type": "array", + "title": "Topics", + "description": "Topics covered by the table (ideally, the list of topics will be a controlled vocabulary)", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, + "name": { + "title": "Topic", + "type": "string" + }, + "parent_id": { + "title": "Parent topic Identifier", + "description": "For subtopics, provide the ID of the parent topic", + "type": "string" + }, + "vocabulary": { + "title": "Vocabulary", + "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.", + "type": "string" + }, + "uri": { + "title": "Vocabulary URI", + "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.", + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "disciplines": { + "type": "array", + "title": "Disciplines", + "description": "Disciplines e.g. `Social sciences, economics`, `Natural sciences, biology`", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Discipline title or name", + "type": "string" + }, + "vocabulary": { + "title": "Vocabulary", + "description": "Vocabulary", + "type": "string" + }, + "uri": { + "title": "URI", + "description": "Website link", + "type": "string" + } + }, + "required": [ + "name" + ] } }, - "topics": { - "type": "array", - "title": "Topics", - "description": "Topics covered by the table (ideally, the list of topics will be a controlled vocabulary)", - "items": { - "type": "object", - "properties": { - "id": { - "title": "Unique Identifier", - "type": "string" - }, - "name": { - "title": "Topic", - "type": "string" - }, - "parent_id": { - "title": "Parent topic Identifier", - "description":"For subtopics, provide the ID of the parent topic", - "type": "string" - }, - "vocabulary": { - "title": "Vocabulary", - "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.", - "type": "string" - }, - "uri": { - "title": "Vocabulary URI", - "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.", - "type": "string" - } - }, - "required": [ - "name" - ] - } - }, - - "disciplines": { - "type": "array", - "title": "Disciplines", - "description": "Disciplines e.g. `Social sciences, economics`, `Natural sciences, biology`", - "items": { - "type": "object", - "properties": { - "name": { - "title": "Discipline title or name", - "type": "string" - }, - "vocabulary": { - "title": "Vocabulary", - "description": "Vocabulary", - "type": "string" - }, - "uri": { - "title": "URI", - "description": "Website link", - "type": "string" - } - }, - "required": [ - "name" - ] - } - }, - - "relevance": { "type": "string", "title": "Relavance" @@ -380,6 +440,24 @@ } } }, + "ref_country": { + "type": "array", + "title": "Reference country", + "description": "List of countries for which data are available", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Country name", + "type": "string" + }, + "code": { + "title": "Country code", + "type": "string" + } + } + } + }, "geographic_units": { "title": "Geographic locations", "description": "List of geographic units (regions, countries, states, provinces, etc.) for which data are available in the database.", @@ -408,6 +486,31 @@ ] } }, + "bbox": { + "title": "Geographic bounding box", + "type": "array", + "items": { + "type": "object", + "properties": { + "west": { + "title": "West", + "type": "string" + }, + "east": { + "title": "East", + "type": "string" + }, + "south": { + "title": "South", + "type": "string" + }, + "north": { + "title": "North", + "type": "string" + } + } + } + }, "aggregation_method": { "type": "string", "title": "Aggregation method" @@ -417,18 +520,29 @@ "title": "Dissaggregation" }, "license": { - "type": "object", - "title": "Access licence", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "uri": { - "type": "string", - "title": "URI" + "type": "array", + "title": "License", + "description": "License information", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + }, + "note": { + "title": "Note", + "type": "string" + } } - } + }, + "required": [ + "name" + ] }, "confidentiality": { "type": "string", @@ -467,61 +581,97 @@ } }, "api_documentation": { - "type": "object", + "type": "array", "description": "API Documentation", - "properties": { - "description": { - "title": "Description", - "type": "string" - }, - "uri": { - "title": "URI", - "type": "string" + "items": { + "type": "object", + "properties": { + "description": { + "title": "Description", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } } } }, - "sources":{ - "type":"array", - "title":"Sources", - "description":"Sources", + "authoring_entity": { + "type": "array", + "title": "Authoring entity", + "description": "The person, corporate body, or agency responsible for the work's substantive and intellectual content. Repeat the element for each author, and use 'affiliation' attribute if available. Invert first and last name and use commas.", "items": { - "type": "object", - "properties": { - "id": { - "title": "Source ID", - "type": "string" - }, - "name": { - "title": "Name", - "description": "Source name", - "type": "string" - }, - "organization": { - "title": "Organization", - "type": "string" + "type": "object", + "properties": { + "name": { + "title": "Agency Name", + "type": "string", + "description": "Name of the person, corporate body, or agency responsible for the work's substantive and intellectual content. If a person, invert first and last name and use commas." + }, + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "abbreviation": { + "title": "Abbreviation", + "description": "Abbreviation" + }, + "email": { + "title": "Email", + "description": "Email" + }, + "uri": { + "title": "URI", + "type": "string" + } }, - "type": { - "title": "Source type", - "type": "string" + "required": [ + "name" + ] + } + }, + "sources": { + "type": "array", + "title": "Sources", + "description": "Sources", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Source ID", + "type": "string" + }, + "name": { + "title": "Name", + "description": "Source name", + "type": "string" + }, + "organization": { + "title": "Organization", + "type": "string" + }, + "type": { + "title": "Source type", + "type": "string" + }, + "note": { + "title": "Note", + "type": "string" + } }, - "note": { - "title": "Note", - "type": "string" - } - }, - "required": [ - "name" - ] + "required": [ + "name" + ] } - }, - + }, "sources_note": { "type": "string", "title": "Notes form original sources" }, "keywords": { "type": "array", - "description": "Keywords", + "description": "Keywords", "items": { "type": "object", "properties": { @@ -545,7 +695,7 @@ }, "acronyms": { "type": "array", - "description": "Acronyms", + "description": "Acronyms", "items": { "type": "object", "properties": { @@ -563,7 +713,8 @@ } }, "required": [ - "acronym", "expansion" + "acronym", + "expansion" ] } }, @@ -616,9 +767,13 @@ "type": "string", "title": "Standard name" }, - "organization": { + "abbreviation": { "type": "string", - "title": "Organization name" + "title": "Abbreviation" + }, + "custodian": { + "type": "string", + "title": "Name of the custodian organization" }, "uri": { "type": "string", @@ -640,6 +795,14 @@ "type": "string", "title": "Name" }, + "abbreviation": { + "type": "string", + "title": "Abbreviation" + }, + "custodian": { + "type": "string", + "title": "Custodian" + }, "description": { "type": "string", "title": "Description" @@ -694,135 +857,6 @@ ] } }, - "lda_topics": { - "type": "array", - "title": "LDA topics", - "description": "LDA topics", - "items": { - "type": "object", - "properties": { - "model_info": { - "type": "array", - "title": "Model information", - "items": { - "type": "object", - "properties": { - "source": { - "title": "Source", - "type": "string" - }, - "author": { - "title": "Author", - "type": "string" - }, - "version": { - "title": "Version", - "type": "string" - }, - "model_id": { - "title": "Model Identifier", - "type": "string" - }, - "nb_topics": { - "title": "Number of topics", - "type": "number" - }, - "description": { - "title": "Description", - "type": "string" - }, - "corpus": { - "title": "Corpus name", - "type": "string" - }, - "uri": { - "title": "URI", - "type": "string" - } - } - }, - "required": [ - "model_id" - ] - }, - "topic_description": { - "type": "array", - "title": "Topic information", - "items": { - "type": "object", - "properties": { - "topic_id": { - "title": "Topic identifier", - "type": ["integer", "string"] - }, - "topic_score": { - "title": "Topic score", - "type": ["number", "string"] - }, - "topic_label": { - "title": "Topic label", - "type": "string" - }, - "topic_words": { - "type": "array", - "title": "Topic words", - "description": "Words", - "items": { - "type": "object", - "properties": { - "word": { - "title": "Word", - "type": "string" - }, - "word_weight": { - "title": "Word weight", - "type": "number" - } - } - }, - "required": [ - "word" - ] - } - } - }, - "required": [ - "topic_id" - ] - } - }, - "additionalProperties": false - } - }, - "word_vectors":{ - "type": "array", - "title": "Word vectors", - "description": "Word vectors", - "items": { - "type": "object", - "properties": { - "id": { - "title": "Vector Model ID", - "type": "string" - }, - "description": { - "title": "Vector Model Description", - "type": "string" - }, - "date": { - "title": "Date (YYYY-MM-DD)", - "type": "string" - }, - "vector": { - "title": "Vector", - "type": "object" - } - } - }, - "required": [ - "id","vector" - ] - }, "series_groups": { "type": "array", "title": "Series groups", @@ -834,6 +868,11 @@ "type": "string", "title": "Name" }, + "description": { + "type": "string", + "title": "Description", + "description": "A brief description of the series group." + }, "version": { "type": "string", "title": "Version" @@ -853,44 +892,182 @@ "idno", "name" ] - - }, - "provenance":{ - "type":"array", - "description":"Provenance", - "items":{ - "$ref":"provenance-schema.json" - } - }, - "tags": { - "type": "array", - "title": "Tags (user-defined)", - "description": "Tags", - "items": { - "type": "object", - "properties": { - "tag": { - "title": "Tag", - "type": "string" + }, + "provenance": { + "type": "array", + "description": "Provenance", + "items": { + "$ref": "provenance-schema.json" + } + }, + "tags": { + "type": "array", + "title": "Tags (user-defined)", + "description": "Tags", + "items": { + "type": "object", + "properties": { + "tag": { + "title": "Tag", + "type": "string" + }, + "tag_group": { + "title": "Tag group", + "type": "string" + } + } }, - "tag_group": { - "title": "Tag group", - "type": "string" + "required": [ + "tag" + ] + }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": [ + "integer", + "string" + ] + }, + "topic_score": { + "title": "Topic score", + "type": [ + "number", + "string" + ] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + }, + "additionalProperties": false + } + }, + "embeddings": { + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": [ + "object", + "array" + ] + } + }, + "required": [ + "id", + "vector" + ] } - } }, - "required": [ - "tag" - ] - }, - "additional": { - "type": "object", - "title":"Additional custom metadata", - "description": "Any other custom metadata not covered by the schema", - "properties": {} - } - }, - "required": [ - "series_description" - ] - } \ No newline at end of file + "additional": { + "type": "object", + "title": "Additional custom metadata", + "description": "Any other custom metadata not covered by the schema", + "properties": {} + } + }, + "required": [ + "series_description" + ] +} \ No newline at end of file diff --git a/api-documentation/catalog-admin/variable-group-schema.json b/api-documentation/catalog-admin/variable-group-schema.json new file mode 100644 index 000000000..d0911475c --- /dev/null +++ b/api-documentation/catalog-admin/variable-group-schema.json @@ -0,0 +1,75 @@ +{ + "$id": "http://ihsn.org/schemas/variable-group", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "definitions": {}, + "properties": { + "vgid": { + "title": "Variable Group ID", + "description": "Unique ID for the variable group e.g. VG1", + "type": "string", + "maxLength": 45 + }, + "variables": { + "title": "Variables", + "description": "List of variables for the group seperated by space e.g. V1 V2 V3", + "type": "string", + "maxLength": 5000 + }, + "variable_groups": { + "title": "Variable groups", + "description": "List of sub-groups e.g. VG2 VG3 VG4", + "type": "string", + "maxLength": 1000 + }, + "group_type": { + "title": "Type", + "type": "string", + "enum": [ + "subject", + "section", + "multiResp", + "grid", + "display", + "repetition", + "version", + "iteration", + "analysis", + "pragmatic", + "record", + "file", + "randomized", + "other" + ], + "maxLength": 45 + }, + "label": { + "title": "Label", + "type": "string", + "maxLength": 255 + }, + "universe": { + "title": "Universe", + "type": "string", + "maxLength": 255 + }, + "notes": { + "title": "Notes", + "type": "string", + "maxLength": 500 + }, + "txt": { + "title": "Text", + "type": "string", + "maxLength": 500 + }, + "definition": { + "title": "Definition", + "type": "string", + "maxLength": 500 + } + }, + "required": [ + "vgid" + ] +} \ No newline at end of file diff --git a/api-documentation/catalog-admin/variable-schema.json b/api-documentation/catalog-admin/variable-schema.json index 7ef70cedc..c29c7df68 100644 --- a/api-documentation/catalog-admin/variable-schema.json +++ b/api-documentation/catalog-admin/variable-schema.json @@ -1,6 +1,6 @@ { "$id": "http://ihsn.org/schemas/variable", - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "definitions": {}, "properties": { @@ -24,9 +24,12 @@ }, "var_intrvl": { "type": "string", - "title" : "Interval type", + "title": "Interval type", "description": "indicates the interval type; options are discrete or continuous.", - "enum": [ "discrete", "contin"] + "enum": [ + "discrete", + "contin" + ] }, "var_dcml": { "type": "string", @@ -35,25 +38,35 @@ }, "var_wgt": { "type": "integer", - "title":"Weight", + "title": "Weight", "description": "indicates whether the variable is a weight", "default": 0 - }, - "var_start_pos": { + }, + "loc_start_pos": { "type": "integer", "title": "Variable start position" }, - "var_end_pos": { + "loc_end_pos": { "type": "integer", "title": "Variable end position" }, - "var_width": { + "loc_width": { + "type": "integer", + "title": "Variable width" + }, + "loc_rec_seg_no": { "type": "integer", - "title": "Variable width" - }, + "title": "Record segment number, deck or card number the variable is located on" + }, "var_imputation": { "type": "string", - "title": "Imputation" + "title": "Imputation", + "description": "According to the Statistical Terminology glossary maintained by the National Science Foundation, this is `the process by which one estimates missing values for items that a survey respondent failed to provide,` and if applicable in this context, it refers to the type of procedure used. " + }, + "var_derivation": { + "type": "string", + "title": "Derivation", + "description": "Used only in the case of a derived variable, this element provides both a description of how the derivation was performed and the command used to generate the derived variable, as well as a specification of the other variables in the study used to generate the derivation. The `var` attribute provides the ID values of the other variables in the study used to generate this derived variable." }, "var_security": { "type": "string", @@ -76,6 +89,16 @@ "type": "string", "title": "Post-question text" }, + "var_forward": { + "type": "string", + "title": "Forward skip", + "description": "Contains a reference to IDs of possible following questions. This can be used to document forward skip instructions." + }, + "var_backward": { + "type": "string", + "title": "Backward skip", + "description": "Contains a reference to IDs of possible preceding questions. This can be used to document backward skip instructions." + }, "var_qstn_ivulnstr": { "type": "string", "title": "Interviewer instructions" @@ -85,8 +108,8 @@ "title": "Universe" }, "var_sumstat": { - "type": "array", - "description": "One or more statistical measures that describe the responses to a particular variable and may include one or more standard summaries, e.g., minimum and maximum values, median, mode, etc. \n\n The attribute 'type' denotes the type of statistics being shown: mean, median, mode, valid cases, invalid cases, minimum, maximum, or standard deviation.", + "type": "array", + "description": "One or more statistical measures that describe the responses to a particular variable and may include one or more standard summaries, e.g., minimum and maximum values, median, mode, etc. \n\n The attribute 'type' denotes the type of statistics being shown: mean, median, mode, valid cases, invalid cases, minimum, maximum, or standard deviation.", "items": { "type": "object", "properties": { @@ -95,7 +118,10 @@ "title": "Type" }, "value": { - "type": ["integer", "string"], + "type": [ + "integer", + "string" + ], "title": "Value" }, "wgtd": { @@ -111,8 +137,8 @@ "title": "Variable description" }, "var_catgry": { - "type": "array", - "title": "Categories", + "type": "array", + "title": "Categories", "items": { "type": "object", "properties": { @@ -137,20 +163,46 @@ "description": "Type such as frequency, percent, etc" }, "value": { - "type": ["integer", "string"], + "type": [ + "integer", + "string" + ], "title": "Value" }, "wgtd": { "type": "string", "title": "Weighted", "description": "For weighted values, enter `weighted`" - } + } } } } } } }, + "var_std_catgry": { + "type": "object", + "title": "Standard categories", + "description": "Standard category codes used in the variable, like industry codes, employment codes, or social class codes. The attribute `date` is provided to indicate the version of the code in place at the time of the study. The attribute `URI` is provided to indicate a URN or URL that can be used to obtain an electronic list of the category codes.", + "properties": { + "name": { + "title": "Standard classification name", + "type": "string" + }, + "source": { + "title": "Source", + "type": "string" + }, + "date": { + "title": "Date", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, "var_codinstr": { "type": "string", "title": "Recoding and derivation" @@ -159,49 +211,54 @@ "type": "array", "title": "Concepts", "items": { - "type": "object", - "properties": { - "title": { - "title": "Concept", - "type": "string" + "type": "object", + "properties": { + "title": { + "title": "Concept", + "type": "string" + }, + "vocab": { + "title": "Vocabulary", + "type": "string" + }, + "uri": { + "title": "Vocabulary URI", + "type": "string" + } }, - "vocab": { - "title": "Vocabulary", - "type": "string" + "required": [ + "title" + ] + } + }, + "var_format": { + "type": "object", + "title": "Variable format", + "description": "The technical format of the variable in question. Attributes for this element include: 'type', which indicates if the variable is character or numeric; 'formatname,' which in some cases may provide the name of the particular, proprietary format actually used; 'schema,' which identifies the vendor or standards body that defined the format (acceptable choices are SAS, SPSS, IBM, ANSI, ISO, XML-data or other); 'category,' which describes what kind of data the format represents, and includes date, time, currency, or 'other' conceptual possibilities.", + "properties": { + "type": { + "type": "string", + "title": "Type" }, - "uri": { - "title": "Vocabulary URI", - "type": "string" + "name": { + "type": "string", + "title": "Name" + }, + "note": { + "type": "string", + "title": "Note" } - }, - "required": [ - "title" - ] } - }, - "var_format": { - "type": "object", - "title": "Variable format", - "description": "The technical format of the variable in question. Attributes for this element include: 'type', which indicates if the variable is character or numeric; 'formatname,' which in some cases may provide the name of the particular, proprietary format actually used; 'schema,' which identifies the vendor or standards body that defined the format (acceptable choices are SAS, SPSS, IBM, ANSI, ISO, XML-data or other); 'category,' which describes what kind of data the format represents, and includes date, time, currency, or 'other' conceptual possibilities.", - "properties": { - "type": { - "type": "string", - "title": "Type" - }, - "name": { - "type": "string", - "title": "Name" - }, - "value": { - "type": "string", - "title": "Value" - } - } - }, + }, "var_notes": { "type": "string", "title": "Variable notes" } - }, - "required": [ "vid", "file_id", "name","labl" ] + }, + "required": [ + "vid", + "file_id", + "name", + "labl" + ] } \ No newline at end of file diff --git a/api-documentation/catalog-admin/video-schema.json b/api-documentation/catalog-admin/video-schema.json index 6690084f7..42243302c 100644 --- a/api-documentation/catalog-admin/video-schema.json +++ b/api-documentation/catalog-admin/video-schema.json @@ -87,7 +87,29 @@ "idno": { "type": "string", "title": "Unique video identifier" - }, + }, + "identifiers": { + "type": "array", + "title": "Other identifiers", + "description": "Other identifiers", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Identifier type", + "description": "Type of identifier e.g. `doi`, `handle`, `other`", + "type": "string" + }, + "identifier": { + "title": "Identifier", + "type": "string" + } + }, + "required": [ + "identifier" + ] + } + }, "title": { "type": "string", "description": "Title" @@ -104,33 +126,60 @@ "type": "string", "description": "Genre" }, - "keywords": { - "type": "string", - "description": "Keywords" - }, - - "topics":{ + "keywords":{ "type":"array", - "title":"Topic Classification", - "description":"Topic Classification", "items":{ "type":"object", "properties":{ - "topic":{ - "title":"Topic", + "name":{ + "title":"Name", "type":"string" }, - "vocab":{ - "title":"Vocab", + "vocabulary":{ + "title":"Vocabulary name", "type":"string" }, "uri":{ - "title":"URI", + "title":"Vocabulary URI", "type":"string" } + } + } + }, + + "topics": { + "type": "array", + "title": "Topics", + "description": "Topics covered by the table (ideally, the list of topics will be a controlled vocabulary)", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Unique Identifier", + "type": "string" + }, + "name": { + "title": "Topic", + "type": "string" + }, + "parent_id": { + "title": "Parent topic Identifier", + "description":"For subtopics, provide the ID of the parent topic", + "type": "string" + }, + "vocabulary": { + "title": "Vocabulary", + "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.", + "type": "string" + }, + "uri": { + "title": "Vocabulary URI", + "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.", + "type": "string" + } }, - "required":[ - "topic" + "required": [ + "name" ] } }, @@ -160,34 +209,40 @@ "description": "Primary entity described in the video" }, - "video_provider": { - "type": "string", - "description": "Video provider e.g. youtube, vimeo, facebook" - }, - - "video_url": { + "date_created": { "type": "string", - "description": "Video URL" + "description": "Date of creation (YYYY-MM-DD)" }, - - "embed_url": { + "date_published": { "type": "string", - "description": "Video embed URL" + "description": "Date published (YYYY-MM-DD)" }, - "encoding_format": { + "version": { "type": "string", - "title":"Encoding format", - "description": "Media type using a MIME format" + "description": "Version" }, - "duration": { + "status": { "type": "string", - "title":"Duration", - "description": "The duration of the video in ISO 8601 date time format - `hh:mm:ss`" + "title":"Creative work status", + "description": "Status of a creative work in terms of its stage in lifecycle. e.g. `incomplete`, `draft`, `published`, `obsolete`" }, - "content_location": { - "type": "string", - "description": "Location depicted or described in the video" + "country": { + "type": "array", + "title": "Countries", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Country name", + "type": "string" + }, + "code": { + "title": "Country code", + "type": "string" + } + } + } }, "spatial_coverage": { @@ -205,39 +260,250 @@ "description": "Period that the content applies to using ISO 8601 date time format" }, + "recorded_at": { + "type": "string", + "description": "Location where video was recorded" + }, + "audience": { "type": "string", "description": "Intended audience" }, - - "country": { - "type": "string", - "description": "Country" + + "bbox": { + "title": "Geographic bounding box", + "type": "array", + "items": { + "type": "object", + "properties": { + "west": { + "title": "West", + "type": "string" + }, + "east": { + "title": "East", + "type": "string" + }, + "south": { + "title": "South", + "type": "string" + }, + "north": { + "title": "North", + "type": "string" + } + } + } }, + "language": { + "type": "array", + "description": "languages", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Language name", + "type": "string" + }, + "code": { + "title": "code", + "Descripton": "Language code", + "type": "string" + } + } + }, + "required": [ + "name" + ] + }, + + "creator": { "type": "string", - "description": "Language" + "description": "Creator" }, - "author": { + + "production_company": { "type": "string", - "description": "Author" + "description": "Production company" }, + "publisher": { "type": "string", "description": "Publisher" }, - "contributor": { + + "repository": { + "type": "string", + "title": "Repository" + }, + "contacts": { + "type": "array", + "title": "Contacts", + "description": "Contacts", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "email": { + "title": "Email", + "type": "string" + }, + "telephone": { + "title": "Telephone", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "name" + ] + }, + + "contributors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" + }, + "abbreviation": { + "title": "Abbreviation", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "sponsors": { + "type": "array", + "title": "Funding Agency/Sponsor", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Funding Agency/Sponsor", + "type": "string" + }, + "abbr": { + "title": "Abbreviation", + "type": "string" + }, + "grant": { + "title": "Grant Number", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + + "translators": { + "type": "array", + "title": "Translators", + "description": "Translators", + "items": { + "type": "object", + "properties": { + "first_name": { + "title": "First name", + "type": "string" + }, + "initial": { + "title": "Initial", + "type": "string" + }, + "last_name": { + "title": "Last name", + "type": "string" + }, + "affiliation": { + "title": "Affiliation", + "type": "string" + } + } + }, + "required": [ + "first_name" + ] + }, + + "is_based_on": { + "type": "string", + "title":"A resource from which this work is derived", + "description": "A resource from which this work is derived or from which it is a modification or adaption" + }, + "is_part_of": { + "type": "string", + "title":"Indicate an item that this item is part of" + }, + + "relations": { + "type": "array", + "title":"Defines, as a free text field, the relation between the video being documented and other resources. This is a Dublin Core element." + }, + + "video_provider": { + "type": "string", + "description": "Video provider e.g. youtube, vimeo, facebook" + }, + + "video_url": { + "type": "string", + "description": "Video URL" + }, + + "embed_url": { "type": "string", - "description": "Contributor" + "description": "Video embed URL" }, - "funder": { + "encoding_format": { "type": "string", - "description": "Funder" + "title":"Encoding format", + "description": "Media type using a MIME format" }, - "translator": { + "duration": { "type": "string", - "title": "Translator", - "description": "Organization or person who adapts a creative work to different languages" + "title":"Duration", + "description": "The duration of the video in ISO 8601 date time format - `hh:mm:ss`" }, "rights": { "type": "string", @@ -261,34 +527,73 @@ "description": "Year during which claimed copyright for the video was first asserted" }, - - - "date_created": { - "type": "string", - "description": "Date of creation (YYYY-MM-DD)" - }, - "date_published": { + "credit_text": { "type": "string", - "description": "Date published (YYYY-MM-DD)" + "title": "Credits", + "description": "This element that can be used to credit the person(s) and/or organization(s) associated with a published video. It corresponds to the `creditText` element of VideoObject." }, - "version": { + + "citation": { "type": "string", - "description": "Version" + "title": "Citation", + "description": "This element provides a required or recommended citation of the audio file." }, - "status": { - "type": "string", - "title":"Creative work status", - "description": "Status of a creative work in terms of its stage in lifecycle. e.g. `incomplete`, `draft`, `published`, `obsolete`" + + "transcript": { + "type": "array", + "title": "Transcript", + "items": { + "type": "object", + "properties": { + "language": { + "title": "Language", + "type": "string" + }, + "text": { + "title": "Text", + "type": "string" + } + } + }, + "required": [ + "text" + ] }, - "is_based_on": { - "type": "string", - "title":"A resource from which this work is derived", - "description": "A resource from which this work is derived or from which it is a modification or adaption" + + "media": { + "type": "array", + "title": "Media", + "items": { + "type": "string" + } }, - "is_part_of": { - "type": "string", - "title":"Indicate an item that this item is part of" - } + + "album": { + "type": "array", + "title": "Album", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name of album", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string" + }, + "owner": { + "title": "Owner", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + } + } + }, "required": [ @@ -324,6 +629,136 @@ "tag" ] }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": ["integer", "string"] + }, + "topic_score": { + "title": "Topic score", + "type": ["number", "string"] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + + }, + "additionalProperties": false + } + }, + "embeddings":{ + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } + }, + "required": [ + "id","vector" + ] + } + }, "additional": { "type": "object", diff --git a/api-documentation/catalog-admin/visualization-schema.json b/api-documentation/catalog-admin/visualization-schema.json index 538f102d6..14aac2b7d 100644 --- a/api-documentation/catalog-admin/visualization-schema.json +++ b/api-documentation/catalog-admin/visualization-schema.json @@ -935,35 +935,7 @@ "required": [ "name" ] - }, - "provenance":{ - "type":"array", - "description":"Provenance", - "items":{ - "$ref":"provenance-schema.json" - } - }, - "tags": { - "type": "array", - "title": "Tags", - "description": "Tags", - "items": { - "type": "object", - "properties": { - "tag": { - "title": "Tag", - "type": "string" - }, - "tag_group": { - "title": "Tag group", - "type": "string" - } - } - }, - "required": [ - "tag" - ] - } + } }, "additionalProperties": false @@ -999,6 +971,164 @@ ] } }, + "provenance":{ + "type":"array", + "description":"Provenance", + "items":{ + "$ref":"provenance-schema.json" + } + }, + "tags": { + "type": "array", + "title": "Tags", + "description": "Tags", + "items": { + "type": "object", + "properties": { + "tag": { + "title": "Tag", + "type": "string" + }, + "tag_group": { + "title": "Tag group", + "type": "string" + } + } + }, + "required": [ + "tag" + ] + }, + "lda_topics": { + "type": "array", + "title": "LDA topics", + "description": "LDA topics", + "items": { + "type": "object", + "properties": { + "model_info": { + "type": "array", + "title": "Model information", + "items": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "author": { + "title": "Author", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "model_id": { + "title": "Model Identifier", + "type": "string" + }, + "nb_topics": { + "title": "Number of topics", + "type": "number" + }, + "description": { + "title": "Description", + "type": "string" + }, + "corpus": { + "title": "Corpus name", + "type": "string" + }, + "uri": { + "title": "URI", + "type": "string" + } + } + }, + "required": [ + "model_id" + ] + }, + "topic_description": { + "type": "array", + "title": "Topic information", + "items": { + "type": "object", + "properties": { + "topic_id": { + "title": "Topic identifier", + "type": ["integer", "string"] + }, + "topic_score": { + "title": "Topic score", + "type": ["number", "string"] + }, + "topic_label": { + "title": "Topic label", + "type": "string" + }, + "topic_words": { + "type": "array", + "title": "Topic words", + "description": "Words", + "items": { + "type": "object", + "properties": { + "word": { + "title": "Word", + "type": "string" + }, + "word_weight": { + "title": "Word weight", + "type": "number" + } + } + }, + "required": [ + "word" + ] + } + } + }, + "required": [ + "topic_id" + ] + } + + }, + "additionalProperties": false + } + }, + "embeddings":{ + "type": "array", + "title": "Word embeddings", + "description": "Word embeddings", + "items": { + "type": "object", + "properties": { + "id": { + "title": "Vector Model ID", + "type": "string" + }, + "description": { + "title": "Vector Model Description", + "type": "string" + }, + "date": { + "title": "Date (YYYY-MM-DD)", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "object" + } + }, + "required": [ + "id","vector" + ] + } + }, "additional": { "type": "object", "description": "Additional metadata", diff --git a/api-documentation/schemas/iptc-phovidmdshared-schema.json b/api-documentation/schemas/iptc-phovidmdshared-schema.json index 065fd2733..52014c8a1 100644 --- a/api-documentation/schemas/iptc-phovidmdshared-schema.json +++ b/api-documentation/schemas/iptc-phovidmdshared-schema.json @@ -49,25 +49,28 @@ "ArtworkOrObject": { "type": "object", "properties": { - "circaDateCreated": { - "title": "Circa Date Created {Artwork or Object detail}", - "description": "Approximate date or range of dates associated with the creation and production of an artwork or object or its components.", - "type": "string" + "title": { + "$ref": "#/definitions/AltLang", + "description": "A reference for the artwork or object in the image.", + "title": "Title {Artwork or Object detail}" }, "contentDescription": { "$ref": "#/definitions/AltLang", "description": "A textual description of the content depicted in the artwork or object.", "title": "Content Description {Artwork or Object detail}" }, - "contributionDescription": { + "physicalDescription": { "$ref": "#/definitions/AltLang", - "description": "A textual description about a contribution made to an artwork or an object.", - "title": "Contribution Description {Artwork or Object detail}" + "description": "A textual description of the physical characteristics of the artwork or object, without reference to the content depicted.", + "title": "Physical Description {Artwork or Object detail}" }, - "copyrightNotice": { - "$ref": "#/definitions/AltLang", - "description": "Contains any necessary copyright notice for claiming the intellectual property for artwork or an object in the image and should identify the current owner of the copyright of this work with associated intellectual property rights.", - "title": "Copyright Notice {Artwork or Object detail}" + "creatorNames": { + "title": "Creator {Artwork or Object detail}", + "description": "Contains the name of the artist who has created artwork or an object in the image. In cases where the artist could or should not be identified the name of a company or organisation may be appropriate.", + "type": "array", + "items": { + "type": "string" + } }, "creatorIdentifiers": { "title": "Creator ID {Artwork or Object detail}", @@ -77,46 +80,29 @@ "type": "string" } }, - "creatorNames": { - "title": "Creator {Artwork or Object detail}", - "description": "Contains the name of the artist who has created artwork or an object in the image. In cases where the artist could or should not be identified the name of a company or organisation may be appropriate.", + "contributionDescription": { + "$ref": "#/definitions/AltLang", + "description": "A textual description about a contribution made to an artwork or an object.", + "title": "Contribution Description {Artwork or Object detail}" + }, + "stylePeriod": { + "title": "Style Period {Artwork or Object detail}", + "description": "The style, historical or artistic period, movement, group, or school whose characteristics are represented in the artwork or object.", "type": "array", "items": { "type": "string" } }, - "currentCopyrightOwnerIdentifier": { - "title": "Current Copyright Owner ID {Artwork or Object detail}", - "description": "Globally unique identifier for the current owner of the copyright of the artwork or object.", - "type": "string", - "format": "uri" - }, - "currentCopyrightOwnerName": { - "title": "Current Copyright Owner Name {Artwork or Object detail}", - "description": "Name of the current owner of the copyright of the artwork or object.", - "type": "string" - }, - "currentLicensorIdentifier": { - "title": "Current Licensor ID {Artwork or Object detail}", - "description": "Globally unique identifier for the current licensor of the artwork or object.", - "type": "string", - "format": "uri" - }, - "currentLicensorName": { - "title": "Current Licensor Name {Artwork or Object detail}", - "description": "Name of the current licensor of the artwork or object.", - "type": "string" - }, "dateCreated": { "title": "Date Created {Artwork or Object detail}", "description": "Designates the date and optionally the time the artwork or object in the image was created. This relates to artwork or objects with associated intellectual property rights.", "type": "string", "format": "date-time" }, - "physicalDescription": { - "$ref": "#/definitions/AltLang", - "description": "A textual description of the physical characteristics of the artwork or object, without reference to the content depicted.", - "title": "Physical Description {Artwork or Object detail}" + "circaDateCreated": { + "title": "Circa Date Created {Artwork or Object detail}", + "description": "Approximate date or range of dates associated with the creation and production of an artwork or object or its components.", + "type": "string" }, "source": { "title": "Source {Artwork or Object detail}", @@ -134,19 +120,38 @@ "type": "string", "format": "uri" }, - "stylePeriod": { - "title": "Style Period {Artwork or Object detail}", - "description": "The style, historical or artistic period, movement, group, or school whose characteristics are represented in the artwork or object.", - "type": "array", - "items": { - "type": "string" - } + "currentCopyrightOwnerName": { + "title": "Current Copyright Owner Name {Artwork or Object detail}", + "description": "Name of the current owner of the copyright of the artwork or object.", + "type": "string" + }, + "currentCopyrightOwnerIdentifier": { + "title": "Current Copyright Owner ID {Artwork or Object detail}", + "description": "Globally unique identifier for the current owner of the copyright of the artwork or object.", + "type": "string", + "format": "uri" }, - "title": { + + "copyrightNotice": { "$ref": "#/definitions/AltLang", - "description": "A reference for the artwork or object in the image.", - "title": "Title {Artwork or Object detail}" + "description": "Contains any necessary copyright notice for claiming the intellectual property for artwork or an object in the image and should identify the current owner of the copyright of this work with associated intellectual property rights.", + "title": "Copyright Notice {Artwork or Object detail}" + }, + + + "currentLicensorName": { + "title": "Current Licensor Name {Artwork or Object detail}", + "description": "Name of the current licensor of the artwork or object.", + "type": "string" + }, + + "currentLicensorIdentifier": { + "title": "Current Licensor ID {Artwork or Object detail}", + "description": "Globally unique identifier for the current licensor of the artwork or object.", + "type": "string", + "format": "uri" } + }, "additionalProperties": false }, diff --git a/api-documentation/schemas/iptc-pmd-schema.json b/api-documentation/schemas/iptc-pmd-schema.json index 698869241..279badf4c 100644 --- a/api-documentation/schemas/iptc-pmd-schema.json +++ b/api-documentation/schemas/iptc-pmd-schema.json @@ -74,6 +74,33 @@ "type": "string" } }, + + "sceneCodesLabelled": { + "title": "Scene Codes", + "description": "Describes the scene of a photo content. Specifies one ore more terms from the IPTC \"Scene-NewsCodes\". Each Scene is represented as a string of 6 digits in an unordered list.", + "type": "array", + "items": { + "type": "object", + "properties":{ + "code": { + "title": "Scene Code", + "description": "Scene code as a string of 6 digits", + "type": "string" + }, + "label": { + "title": "Scene Label", + "description": "Label", + "type": "string" + }, + "description": { + "title": "Scene Description", + "description": "Description of the scene", + "type": "string" + } + } + } + }, + "subjectCodes": { "title": "Subject Code", "description": "Specifies one or more Subjects from the IPTC Subject-NewsCodes taxonomy to categorise the image. Each Subject is represented as a string of 8 digits in an unordered list.", @@ -82,6 +109,34 @@ "type": "string" } }, + + + "subjectCodesLabelled": { + "title": "Subject Codes", + "description": "Specifies one or more Subjects from the IPTC Subject-NewsCodes taxonomy to categorise the image. Each Subject is represented as a string of 8 digits in an unordered list.", + "type": "array", + "items": { + "type": "object", + "properties":{ + "code": { + "title": "Subject Code", + "description": "Subject code as a string of 8 digits", + "type": "string" + }, + "label": { + "title": "Subject Label", + "description": "Label", + "type": "string" + }, + "description": { + "title": "Subject Description", + "description": "Description of the scene", + "type": "string" + } + } + } + }, + "creatorNames": { "title": "Creator", "description": "Contains the name of the photographer, but in cases where the photographer should not be identified the name of a company or organisation may be appropriate.", diff --git a/application/config/data_access.php b/application/config/data_access.php index 9f1671335..b55c7d9ea 100644 --- a/application/config/data_access.php +++ b/application/config/data_access.php @@ -42,7 +42,7 @@ */ $config['data_access_options'] = array( 'public'=> array( - 'cc40', 'open', 'direct','public','licensed','remote', 'data_na' + 'cc40', 'open', 'direct','public','licensed','remote', 'data_na','data_enclave' ), 'official'=> array( 'research_license','data_na' diff --git a/application/config/form_validation.php b/application/config/form_validation.php new file mode 100644 index 000000000..1adbb27e3 --- /dev/null +++ b/application/config/form_validation.php @@ -0,0 +1,11 @@ +'; +$config['error_suffix'] = ''; diff --git a/application/config/metadata_parser.php b/application/config/metadata_parser.php index 2eaefa76a..16c7b68d9 100644 --- a/application/config/metadata_parser.php +++ b/application/config/metadata_parser.php @@ -173,8 +173,13 @@ 'transform_callback'=>'transform_ddi_datacollector','type'=>'array' ), #method > data collection > collector training - 'study_desc/method/data_collection/collector_training/type'=>array('xpath'=>'codeBook/stdyDscr/method/dataColl/collectorTraining/@type', 'transform_callback'=>'none'), - 'study_desc/method/data_collection/collector_training/training'=>array('xpath'=>'codeBook/stdyDscr/method/dataColl/collectorTraining', 'transform_callback'=>'none'), + //'study_desc/method/data_collection/collector_training/type'=>array('xpath'=>'codeBook/stdyDscr/method/dataColl/collectorTraining/@type', 'transform_callback'=>'none'), + //'study_desc/method/data_collection/collector_training/training'=>array('xpath'=>'codeBook/stdyDscr/method/dataColl/collectorTraining', 'transform_callback'=>'none'), + 'study_desc/method/data_collection/collector_training'=>array( + 'xpath'=>'codeBook/stdyDscr/method/dataColl/collectorTraining', + 'transform_callback'=>'none', + 'type'=>'array' + ), 'study_desc/method/data_collection/frequency'=>array('xpath'=>'codeBook/stdyDscr/method/dataColl/frequenc', 'transform_callback'=>'none'), 'study_desc/method/data_collection/sampling_procedure'=>array('xpath'=>'codeBook/stdyDscr/method/dataColl/sampProc', 'transform_callback'=>'none'), diff --git a/application/config/routes.php b/application/config/routes.php index 8aec05bf3..45e862faa 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -82,6 +82,7 @@ //dataset resources $route['api/datasets/(:any)/resources'] = "api/resources/$1"; $route['api/datasets/(:any)/resources/(:num)'] = "api/resources/$1/$2"; +$route['api/datasets/(:any)/resources/delete/(:num)'] = "api/resources/delete/$1/$2"; $route['api/datasets/(:any)/resources/delete_all'] = "api/resources/delete_all/$1"; $route['api/datasets/(:any)/resources/import_rdf'] = "api/resources/import_rdf/$1"; $route['api/datasets/(:any)/resources/download/(:num)'] = "api/resources/download/$1/$2"; diff --git a/application/config/solr.php b/application/config/solr.php index 3fff03b4b..a08e31238 100644 --- a/application/config/solr.php +++ b/application/config/solr.php @@ -30,6 +30,17 @@ 'bf'=>'' ); +//variable search +$config['solr_edismax_variable_options']=array( + 'qf'=>'labl^20.0 name^20.0 catgry qstn', //query fields - qf="title^20 nation keywords" + 'pf'=>'', //phrase fields + 'mm'=>'3<90%', //minimum match - 3, 2, 75%, -25% + 'ps'=>'', + 'qs'=>'', + 'bq'=>'', + 'bf'=>'' +); + $config['solr_debug']=false; diff --git a/application/controllers/Catalog.php b/application/controllers/Catalog.php index e56e2f2a6..562bfc999 100644 --- a/application/controllers/Catalog.php +++ b/application/controllers/Catalog.php @@ -111,6 +111,15 @@ private function load_facets_data($active_tab=null) $this->input->get("collection") ); + $this->facets['regions']=array(); + if ($this->is_facet_enabled($this->active_tab,'region')){ + $this->facets['regions']=$this->Search_helper_model->get_active_regions( + $repo_id, + $this->active_tab, + $this->input->get("region") + ); + } + $this->facets['da_types']=$this->Search_helper_model->get_active_data_types( $repo_id, $this->active_tab, @@ -191,6 +200,14 @@ private function load_facets_html() ),true); } + //regions + $filters['regions']=$this->load->view('search/facet', + array( + 'items'=>$this->facets['regions'], + 'filter_id'=>'region', + 'is_enabled'=>$this->is_facet_enabled($this->active_tab,'region') + ),true); + //data classifications $filters['data_class']=$this->load->view('search/facet', array( @@ -372,6 +389,7 @@ function _search() $search_options->sk =trim(xss_clean($this->input->get("sk"))); $search_options->vf =xss_clean($this->input->get("vf")); $search_options->country =xss_clean($this->input->get("country")); + $search_options->region =xss_clean($this->input->get("region")); $search_options->view =xss_clean($this->input->get("view")); $search_options->image_view =xss_clean($this->input->get("image_view")); $search_options->topic =xss_clean($this->input->get("topic")); @@ -446,6 +464,7 @@ function _search() //'variable_keywords'=>$search_options->vk, 'variable_fields'=>$search_options->vf, 'countries'=>$search_options->country, + 'regions'=>$search_options->region, 'from'=>$search_options->from, 'to'=>$search_options->to, 'tags'=>$search_options->tag, @@ -480,6 +499,7 @@ function _search() $data['search_options']=$search_options; $data['data_access_types']=$this->facets['da_types'];//$this->Form_model->get_form_list(); $data['data_classifications']=$this->facets['data_class'];//$this->Data_classification_model->get_list(); + $data['regions']=$this->facets['regions']; $data['sid']=$search_options->sid; //show featured only if no filters or search @@ -520,10 +540,10 @@ function vsearch($sid=NULL) 'sort_order'=>$this->input->get_post('sort_order'), 'repo'=>$this->input->get_post('repo') ); + $this->load->library('catalog_search',$params); $data['variables']=$this->catalog_search->v_quick_search($sid); - - $this->load->view("catalog_search/var_quick_list", $data); + $this->load->view("catalog_search/var_quick_list", $data); } @@ -809,7 +829,11 @@ function compare($option=NULL, $format=NULL) } } - //PDF + $view_types=array( + 'survey'=>'variable_ddi', + 'geospatial'=>'geospatial_features' + ); + foreach($items as $item=>$value){ $tmp=explode('/',$value); if (isset($tmp[1])){ @@ -821,7 +845,8 @@ function compare($option=NULL, $format=NULL) 'dataset'=>$this->Dataset_model->get_row($tmp[0]) ); - $item_data['html']=$this->load->view('survey_info/variable_ddi',$item_data,true); + $view_name=isset($view_types[$item_data['dataset']['type']]) ? $view_types[$item_data['dataset']['type']] : 'survey'; + $item_data['html']=$this->load->view('survey_info/'.$view_name,$item_data,true); $list[]=$item_data; } } diff --git a/application/controllers/Study.php b/application/controllers/Study.php index 10ceabe17..64e8356f7 100644 --- a/application/controllers/Study.php +++ b/application/controllers/Study.php @@ -191,6 +191,10 @@ public function variable($sid,$file_id=null, $var_id=null) $variable_template='variable_ddi'; break; + case 'geospatial': + $variable_template='geospatial_features'; + break; + case 'timeseries': $variable_template='timeseries'; break; @@ -301,8 +305,9 @@ public function related_datasets($sid) public function get_microdata($sid) - { - $this->load->model("Form_model"); + { + $this->load->model("Form_model"); + $this->load->model("Data_access_whitelist_model"); $form_obj=$this->Form_model->get_form_by_survey($sid); @@ -329,6 +334,16 @@ public function get_microdata($sid) $content="Data Access Not Available"; } + $user=$this->ion_auth->current_user(); + + if($user){ + $user_whitelisted=$this->Data_access_whitelist_model->has_access($user->id,$sid); + + if($user_whitelisted){ + $content=$this->Data_access_whitelist_model->get_data_files($sid); + } + } + $this->render_page($sid, $content,'get_microdata'); } @@ -432,7 +447,6 @@ private function render_page($sid, $content, $active_tab='description') break; case 'video': case 'image': - //$display_layout='survey_info/layout_scripts'; $page_tabs=array( 'description'=>array( 'label'=>t($dataset_type.'_description'), @@ -447,7 +461,6 @@ private function render_page($sid, $content, $active_tab='description') ); break; case 'timeseries': - //$display_layout='survey_info/layout_scripts'; $page_tabs=array( 'description'=>array( 'label'=>t($dataset_type.'_description'), @@ -477,7 +490,9 @@ private function render_page($sid, $content, $active_tab='description') ), //hide related materials 'related_materials'=>array( - 'show_tab'=> 0 + 'show_tab'=> (int)$related_resources_count, + 'label'=>t('related_materials'), + 'url'=>site_url("catalog/$sid/related-materials"), ) ); break; diff --git a/application/controllers/admin/Attach_related_data.php b/application/controllers/admin/Attach_related_data.php index 688e56a9d..ab2576cd9 100644 --- a/application/controllers/admin/Attach_related_data.php +++ b/application/controllers/admin/Attach_related_data.php @@ -131,7 +131,7 @@ private function _search($skey){ //set pagination options - $base_url = site_url('admin/dialog_select_studies/index/'.$skey); + $base_url = site_url('admin/catalog/attach_related_data/'.$skey); $config['base_url'] = $base_url; $config['total_rows'] = $total; $config['per_page'] = $limit; diff --git a/application/controllers/admin/Catalog.php b/application/controllers/admin/Catalog.php index d284536d7..f86f50548 100644 --- a/application/controllers/admin/Catalog.php +++ b/application/controllers/admin/Catalog.php @@ -24,7 +24,7 @@ public function __construct() $this->load->helper('querystring_helper','url'); $this->load->helper('form'); //$this->load->helper("catalog"); - $this->template->set_template('admin'); + $this->template->set_template('admin'); $this->load->library("Dataset_manager"); //load language file @@ -64,11 +64,15 @@ public function __construct() */ function index() { - $this->template->set_template('admin5'); + // @TODO: Confirm Cleaning of Erros and Messages from previous Forms + $this->session->unset_userdata('error'); + $this->session->unset_userdata('message'); + + $this->template->set_template('admin5'); //css files $inline_styles=$this->load->view('catalog/catalog_style',NULL, TRUE); - $this->template->add_css($inline_styles,'embed'); + $this->template->add_css($inline_styles,'embed'); //js files $this->template->add_js('var site_url="'.site_url().'";','embed'); @@ -93,12 +97,12 @@ function index() //data access types $this->data_access_types=$this->Form_model->get_all(); //data types - $this->catalog_data_types=$this->Search_helper_model->get_dataset_types($this->active_repo->repositoryid); + $this->catalog_data_types=$this->Search_helper_model->get_dataset_types($this->active_repo->repositoryid); if ($db_rows['rows']) { $sid_list=array(); - foreach($db_rows['rows'] as $row) + foreach($db_rows['rows'] as $row) { $sid_list[]=$row['id']; } @@ -120,10 +124,10 @@ function index() $this->template->write('content', $content,true); $this->template->render(); } - + function search() - { + { if (isset($this->active_repo) && $this->active_repo!=null){ $this->Catalog_model->active_repo=$this->active_repo->repositoryid; } @@ -144,6 +148,7 @@ function search() **/ function _search() { + //records to show per page $per_page = $this->input->get("ps"); @@ -153,7 +158,7 @@ function _search() } //current page - $curr_page=$this->input->get('per_page');//$this->uri->segment(4); + $curr_page=$this->input->get('per_page'); //$this->uri->segment(4); //filter to further limit search $filter=array(); @@ -174,7 +179,6 @@ function _search() //survey rows $surveys=$this->Catalog_admin_search_model->search($search_options,$per_page,$curr_page, $filter); - $survey_id_array=array(); if(is_array($surveys)) @@ -266,13 +270,13 @@ function _search() return $data; } - + //return temp upload folder path private function get_temp_upload_folder() { //catalog folder path $catalog_root=$this->config->item("catalog_root"); - + //if not fixed path, use a relative path if (!file_exists($catalog_root) ) { @@ -300,30 +304,83 @@ private function get_temp_upload_folder() function upload() - { - $this->add_study(); - } - - /** - * Upload form for DDI (xml) file - * - * @return void - **/ - function add_study() { //user has permissions on the repo //$this->acl->user_has_repository_access($this->active_repo->id); $this->acl_manager->has_access_or_die('study', 'create',null,$this->active_repo->repositoryid); - $this->template->set_template('admin'); + // @TODO: File Validation Rules + // Files XML or RDF should be allowed in one field, they are exclusive + $this->form_validation->set_rules('userfile',t('msg_select_ddi'),'callback_upload_file_check'); + // RRE - One call back check both + //$this->form_validation->set_rules('rdf-file',t('msg_select_ddi'),'callback_upload_file_check'); - //show upload form when no DDI is uploaded - if(!$this->input->post("submit")){ +// $this->form_validation->set_rules('userfile',t('msg_select_ddi'),'uploaded[userfile]|ext_in[userfile.xml]]'); +// $this->form_validation->set_rules('rdf-file',t('msg_select_ddi'),'uploaded[rdf-file]|mime_in[rdf-file.xml]|ext_in[rdf-file.xml]'); + + if ($this->form_validation->run() == FALSE) { + + $this->template->set_template('admin'); $content=$this->load->view('catalog/ddi_upload_form', array('active_repo'=>$this->active_repo),true); $this->template->write('content', $content,true); $this->template->render(); return; + } else { + + $new_survey=$this->add_study(); + + if (!empty($new_survey)){ + // RRE Clear Errors + // @TODO: Review if messages should be unset too + $this->session->unset_userdata('error'); + //redirect('admin/catalog/edit/'.$result['sid'],'refresh'); + redirect('admin/catalog/edit/'.$new_survey,'refresh'); + return; + } + + } + return redirect('admin/catalog/upload'); + } + + /** + * Upload Form Validation file + * + * @return TRUE | FALSE + * RRE - Validation runs for xml and rdf files + * Rules: $_FILES Array() + * fields: xml - userfile,rdf - rdf-file + * rdf files requires xml + * matching file names + **/ + function upload_file_check() + { + if (empty($_FILES['userfile']['name'])) { + $this->form_validation->set_message('upload_file_check','{field} '.t('msg_select_ddi')); + return FALSE; + } + + if (!empty($_FILES['rdf-file']['name'])) { + if (strtolower(basename($_FILES['rdf-file']['name'],'.rdf')) <> strtolower(basename($_FILES['userfile']['name'],'.xml'))) { + $this->form_validation->set_message('upload_file_check','{field} '.t('Files need to have the same Name')); + return FALSE; + } } + return TRUE; + } + + /** + * Upload form for DDI (xml) file + * + * @return void + * @return Survey ID | NULL + * @TODO: Due a possible Duplicated Record Error or Parse Error + * Message should be returned to the form + **/ + function add_study() + { + // @TODO: Move the Form one level up, add_study calls the model + + //process form $overwrite=$this->input->post("overwrite"); $repositoryid=$this->input->post("repositoryid"); @@ -335,8 +392,8 @@ function add_study() $overwrite=FALSE; } - //process form - + // Uploads the xml File + // @TODO: review if the file should reamin in the directory after the process is executed $temp_upload_folder=$this->get_temp_upload_folder(); //upload class configurations for DDI @@ -347,8 +404,8 @@ function add_study() $this->load->library('upload', $config); - //process uploaded ddi file - $ddi_upload_result=$this->upload->do_upload(); + // @TODO: Review ONLY XML file is in this reference, RDF files ? or XML RDF pair? + $ddi_upload_result=$this->upload->do_upload('userfile'); $uploaded_ddi_path=NULL; @@ -357,7 +414,8 @@ function add_study() $error = $this->upload->display_errors(); $this->db_logger->write_log('ddi-upload',$error,'catalog'); $this->session->set_flashdata('error', $error); - redirect('admin/catalog/add_study','refresh'); + return NULL; + //redirect('admin/catalog/add_study','refresh'); } else //successful upload { @@ -369,7 +427,7 @@ function add_study() $this->load->model("Data_file_model"); $this->load->library('DDI2_import'); - + $user=$this->ion_auth->current_user(); $ddi_path=$uploaded_ddi_path; @@ -381,7 +439,7 @@ function add_study() 'overwrite'=>$overwrite ); - try{ + try { //import ddi $result=$this->ddi2_import->import($params); @@ -390,22 +448,42 @@ function add_study() $this->events->emit('db.after.update', 'surveys', $result['sid'],'refresh'); $this->session->set_flashdata('success', $result); - redirect('admin/catalog/edit/'.$result['sid'],'refresh');return; + + //redirect('admin/catalog/edit/'.$result['sid'],'refresh');return; + return $result['sid']; } - catch(ValidationException $e){ + // @TODO: Find how to replicate this error + catch (ValidationException $e){ $error_output=array( 'status'=>'failed', 'message'=>$e->getMessage(), 'errors'=>$e->GetValidationErrors() ); - $error_str='Validation Error
'.print_r($e->GetValidationErrors(),true).'
'; +// RRE @TODO: Multiple errors in the xml validation + // $error_str='Validation Error
'.print_r($e->GetValidationErrors(),true).'
'; + $arr_errors=$e->GetValidationErrors(); + $error_str='Validation Error
';
+			foreach ($arr_errors as $key_error) {
+				$error_str.=$key_error['message'].'
'; + } + $error_str.='
'; $this->session->set_flashdata('error', $error_str); - redirect('admin/catalog/add_study','refresh');return; + //redirect('admin/catalog/add_study','refresh');return; + //redirect('admin/catalog/upload','refresh'); + + return NULL; } - catch(Exception $e){ + catch (Exception $e){ $this->session->set_flashdata('error', $e->getMessage()); - redirect('admin/catalog/add_study','refresh');return; + //redirect('admin/catalog/add_study','refresh');return; + //redirect('admin/catalog/upload','refresh'); + return NULL; + } + finally { + // @TODO: Review if this is OK. + unlink($ddi_path); + } } @@ -413,7 +491,7 @@ function add_study() private function upload_rdf_file($sid) { $this->load->library('catalog_admin'); - + //upload class configurations for RDF $config['upload_path'] = $this->get_temp_upload_folder(); $config['overwrite'] = FALSE; @@ -423,7 +501,8 @@ private function upload_rdf_file($sid) $this->upload->initialize($config); //process uploaded rdf file - $rdf_upload_result=$this->upload->do_upload('rdf'); + //$rdf_upload_result=$this->upload->do_upload('rdf'); + $rdf_upload_result=$this->upload->do_upload('rdf-file'); $uploaded_rdf_path=''; @@ -445,9 +524,9 @@ private function upload_rdf_file($sid) return true; } - + /** - * + * * Sanitize file name */ private function sanitize_filename($name) @@ -481,9 +560,9 @@ private function __replace_ddi($sid,$new_ddi_file) 'file_type'=>'survey', 'file_path'=>$new_ddi_file ); - + $this->load->library('Metadata_parser', $parser_params); - + //parser to read metadata $parser=$this->metadata_parser->get_reader(); @@ -493,7 +572,7 @@ private function __replace_ddi($sid,$new_ddi_file) if ($new_idno!==$this->sanitize_filename($new_idno)){ throw new Exception(t('IDNO_INVALID_FORMAT').': '.$new_idno); } - + //check if the study already exists, find the sid $new_ddi_sid=$this->dataset_manager->find_by_idno($new_idno); @@ -638,14 +717,14 @@ function refresh($id=NULL) } } - + /** * * Clear files from the imports folder **/ function clear_import_folder() - { + { $this->load->helper('file'); $import_folder=$this->config->item('ddi_import_folder'); @@ -680,17 +759,16 @@ function process_batch_uploads() { //import folder path $import_folder=$this->config->item('ddi_import_folder'); - if (!file_exists($import_folder)){ show_error('FOLDER-NOT-SET'); } $config = array( - 'max_tmp_file_age' => 900, - 'max_execution_time' => 300, - 'target_dir' => $import_folder, + 'max_tmp_file_age' => 900, + 'max_execution_time' => 300, + 'target_dir' => $import_folder, 'allowed_extensions' =>'xml|rdf', - 'overwrite_file' =>TRUE + 'overwrite_file' =>TRUE ); $this->load->library('Chunked_uploader', $config, 'uploader'); @@ -720,7 +798,6 @@ function process_batch_uploads() } - /** * Imports multiple ddi files from the server folder * @@ -739,20 +816,27 @@ function batch_import() $import_folder=$this->config->item('ddi_import_folder'); if (!file_exists($import_folder) ){ - $import_folder="/datasets"; + // @TODO: Review datasets directory does not exist either + // @TODO: Review if this default should set config->item('ddi_import_folder') + // The next calls to config->item('ddi_import_folder') will fail if this is not set. + // $import_folder="/datasets"; + $import_folder="/datafiles/tmp"; } //read files $files['files']=get_dir_file_info($import_folder); if ( $files['files']){ - foreach($files['files'] as $key=>$value){ - if (substr($value['name'],-4)!='.xml'){ + foreach($files['files'] as $key=>$value){ + //if (substr($value['name'],-4)!='.xml'){ + //if (! in_array(pathinfo($value['name'], PATHINFO_EXTENSION), array('xml','rdf'))) { + if (! in_array(pathinfo($value['name'], PATHINFO_EXTENSION), array('xml'))) { + // @TODO: Check if rdf files should be processed unset($files['files'][$key]); } } } - + $options=array( 'repositories'=>$this->Repository_model->select_all(), 'files'=>$files['files'], @@ -792,10 +876,10 @@ function do_batch_import() echo json_encode(array('error'=>t('REPO_ACCESS_DENIED')) ); exit; } - + $this->load->model("Data_file_model"); $this->load->library('DDI2_import'); - + $user=$this->ion_auth->current_user(); $ddi_path=$ddi_file; @@ -827,7 +911,7 @@ function do_batch_import() 'message'=>$e->getMessage(), 'errors'=>$e->GetValidationErrors() ); - + $error=print_r($e->GetValidationErrors(),true); echo json_encode(array('error'=>$error) ); die(); @@ -839,7 +923,7 @@ function do_batch_import() } } - + /** * diff --git a/application/controllers/admin/Dataaccess_whitelist.php b/application/controllers/admin/Dataaccess_whitelist.php new file mode 100644 index 000000000..f3c7226d2 --- /dev/null +++ b/application/controllers/admin/Dataaccess_whitelist.php @@ -0,0 +1,63 @@ +template->set_template('admin5'); + $this->load->model("Data_access_whitelist_model"); + $this->load->model("Repository_model"); + $this->load->helper(array ('querystring_helper','url', 'form') ); + $this->load->library( array('acl_manager','form_validation','pagination') ); + + $this->lang->load('general'); + //$this->output->enable_profiler(TRUE); + } + + function index() + { + $this->acl_manager->has_access_or_die('citation', 'view'); + $options['rows']=$this->Data_access_whitelist_model->select_all(); + $options['collections']=$this->Repository_model->list_all(); + + $content=$this->load->view('dataaccess_whitelist/index', $options,true); + $this->template->write('title', t('Data access whitelist'),true); + $this->template->write('content', $content,true); + $this->template->render(); + } + + + function create() + { + $user_id=$this->Data_access_whitelist_model->get_user_id($this->input->post("email")); + $repository_id=$this->input->post("repository_id"); + + if(!$repository_id || !$user_id){ + $this->session->set_flashdata('error', t('Invalid values for `collection_name` or `email`')); + redirect("admin/dataaccess_whitelist","refresh"); + } + + try{ + $result=$this->Data_access_whitelist_model->insert($repository_id,$user_id); + } + catch(Exception $e){ + $this->session->set_flashdata('error', $e->getMessage()); + redirect("admin/dataaccess_whitelist","refresh"); + } + $this->session->set_flashdata('message', t('form_update_success')); + redirect("admin/dataaccess_whitelist","refresh"); + } + + + function delete($id) + { + $this->Data_access_whitelist_model->delete_by_id($id); + $this->session->set_flashdata('message', t('form_update_success')); + redirect("admin/dataaccess_whitelist","refresh"); + } + + +} +/* End of file Dataaccess_whitelist.php */ +/* Location: ./controllers/admin/Dataaccess_whitelist.php */ diff --git a/application/controllers/api/Dataaccess_whitelist.php b/application/controllers/api/Dataaccess_whitelist.php new file mode 100644 index 000000000..e71d09a28 --- /dev/null +++ b/application/controllers/api/Dataaccess_whitelist.php @@ -0,0 +1,132 @@ +load->helper("date"); + $this->load->model('Dataset_model'); + $this->load->model("Survey_resource_model"); + $this->load->model("Data_access_whitelist_model"); + $this->is_admin_or_die(); + } + + //override authentication to support both session authentication + api keys + function _auth_override_check() + { + if ($this->session->userdata('user_id')){ + return true; + } + + parent::_auth_override_check(); + } + + + /** + * + * List + * + **/ + function index_get() + { + try{ + $result=$this->Data_access_whitelist_model->select_all(); + + $response=array( + 'status'=>'success', + 'result'=>$result + ); + + $this->set_response($response, REST_Controller::HTTP_OK); + } + catch(Exception $e){ + $this->set_response($e->getMessage(), REST_Controller::HTTP_BAD_REQUEST); + } + } + + + /** + * + * + * Create + * + * + */ + function index_post() + { + try{ + $options=$this->raw_json_input(); + + $collection_name=isset($options['collection_name']) ? $options['collection_name'] :null; + $email=isset($options['email']) ? $options['email'] : null; + + $repository_id=$this->Data_access_whitelist_model->get_repo_id($collection_name); + $user_id=$this->Data_access_whitelist_model->get_user_id($email); + + if(!$repository_id || !$user_id){ + throw new Exception("Invalid values for `collection_name` or `email`"); + } + + $result=$this->Data_access_whitelist_model->insert($repository_id,$user_id); + + $output=array( + 'status'=>'success', + 'result'=>$result + ); + $this->set_response($output, REST_Controller::HTTP_OK); + } + catch(Exception $e){ + $error_output=array( + 'status'=>'failed', + 'message'=>$e->getMessage() + ); + $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); + } + } + + + function index_delete() + { + try{ + + $options=$this->raw_json_input(); + + $collection_name=isset($options['collection_name']) ? $options['collection_name'] :null; + $email=isset($options['email']) ? $options['email'] : null; + + $repository_id=$this->Data_access_whitelist_model->get_repo_id($collection_name); + $user_id=$this->Data_access_whitelist_model->get_user_id($email); + + if(!$repository_id || !$user_id){ + throw new Exception("Invalid values for `collection_name` or `email`"); + } + + $result=$this->Data_access_whitelist_model->delete($repository_id,$user_id); + + $response=array( + 'status'=>'success', + 'message'=>'DELETED', + 'result'=>$result + ); + + $this->set_response($response, REST_Controller::HTTP_OK); + } + catch(Exception $e){ + $error_output=array( + 'status'=>'failed', + 'message'=>$e->getMessage() + ); + $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); + } + } + + +} diff --git a/application/controllers/api/Datadeposits.php b/application/controllers/api/Datadeposits.php index 5fdd74dd1..4544111b0 100644 --- a/application/controllers/api/Datadeposits.php +++ b/application/controllers/api/Datadeposits.php @@ -1,101 +1,21 @@ load->model('Catalog_model'); $this->load->helper("date"); $this->load->model('DD_project_model'); $this->load->model('DD_resource_model'); $this->load->model('DD_citation_model'); + $this->is_admin_or_die(); } - //return raw json input - private function raw_json_input() - { - $data=$this->input->raw_input_stream; - //$data = file_get_contents("php://input"); - - if(!$data || trim($data)==""){ - return null; - } - - $json=json_decode($data,true); - - if (!$json){ - throw new Exception("INVALID_JSON_INPUT"); - } - - return $json; - } - - - private function get_api_user_id() - { - if(isset($this->_apiuser) && isset($this->_apiuser->user_id)){ - return $this->_apiuser->user_id; - } - - return false; - } - - - - /** - * - * Check if user has access to project - * - * @is_project_locked - true/false - if set to true, check if user can update project or not - * - */ - private function get_user_project_or_die($project_id,$is_project_locked=false) - { - $user_id=$this->get_api_user_id(); - $project=$this->DD_project_model->select_single($project_id, $user_id); - - if (!$project){ - throw new Exception("PROJECT_NOT_FOUND"); - } - - if($is_project_locked){ - if (strtolower(trim($project['status']))!=='draft'){ - throw new Exception("PROJECT_IS_LOCKED"); - } - } - - return $project; - } - - - /** - * - * - * Check project status - * - * User can only edit a project in DRAFT mode - * - */ - private function is_project_locked($project_id) - { - $status=$this->DD_project_model->get_project_status($project_id); - if (strtolower(trim($status))=='draft'){ - return false; - } - return true; - } - - - - - - /////////////////////////////////// PROJECT /////////////////////////////// - /** * @@ -114,10 +34,7 @@ public function index_get($pid=null) $user_id=$this->get_api_user_id(); //get all projects for current user - $projects=$this->DD_project_model->get_projects($user_id); - - //convert date fields to GMT - array_walk($projects, 'unix_date_to_gmt',array('created','changed')); + $projects=$this->DD_project_model->all_projects($user_id); $response=array( 'items'=>$projects @@ -141,10 +58,10 @@ public function project_get($pid=null,$user_id=null) throw new Exception("MISSING_PARAM: PID"); } - $project=$this->get_user_project_or_die($pid); + $project=$this->DD_project_model->get_by_id($pid); //format dates - array_walk($project, 'unix_date_to_gmt_row',array('created','changed','submitted_date','administer_date')); + array_walk($project, 'unix_date_to_gmt_row',array('created_on','last_modified','submitted_date','administer_date')); $response=array( 'project'=>$project @@ -163,924 +80,125 @@ public function project_get($pid=null,$user_id=null) - - /** - * - * - * Create new project - * - */ - public function index_post() - { - try{ - //post data - //$options=$this->input->post(); - - //raw data - $options=$this->raw_json_input(); - - $user_id=$this->get_api_user_id(); - $options['created_by']=$user_id; - $options['changed_by']=$user_id; - - //validate - if ($this->DD_project_model->validate_project($options)){ - $project_id=$this->DD_project_model->insert($options); - $project=$this->DD_project_model->select_single($project_id); - - $response=array( - 'status'=>'success', - 'project'=>$project - ); - - $this->set_response($response, REST_Controller::HTTP_OK); - } - } - catch(ValidationException $e){ - $error_output=array( - 'status'=>'failed', - 'message'=>$e->getMessage(), - 'errors'=>$e->GetValidationErrors() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'failed', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - - - /** + /** * - * Update project * - * Note: PUT method does work with formData + * Get all resources by the project * + * @pid - (required) project ID + * @resource_id - (optional) resource ID * - */ - function index_put($project_id=null) - { - try{ - if (!$project_id){ - throw new Exception("MISSING_PARAM: PID"); - } - - $options=$this->raw_json_input(); - $user_id=$this->get_api_user_id(); - $options['changed_by']=$user_id; - - $project=$this->get_user_project_or_die($project_id); - - //validate - if ($this->DD_project_model->validate_project($options,$is_new=false)){ - //update project - $this->DD_project_model->update($project_id,$options); - //reload project - $project=$this->DD_project_model->select_single($project_id); - - $response=array( - 'status'=>'success', - 'project'=>$project - ); + **/ + public function resources_get($pid=null, $resource_id=null) + { + //get single resource if resource id is provided + if(is_numeric($pid) && is_numeric($resource_id)){ + return $this->resource_get($pid,$resource_id); + } + + try{ + $project=$this->DD_project_model->get_by_id($pid); + $resources=$this->DD_resource_model->get_project_resources($pid); + + array_walk($resources, 'unix_date_to_gmt',array('created','changed')); + + $response=array( + 'items'=>$resources + ); - $this->set_response($response, REST_Controller::HTTP_OK); - } - } - catch(ValidationException $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage(), - 'errors'=>$e->GetValidationErrors() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - catch(Exception $e){ + $this->set_response($response, REST_Controller::HTTP_OK); + } + catch(Exception $e){ $error_output=array( 'status'=>'error', 'message'=>$e->getMessage() ); $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); } - } + } /** * + * Get a single resource * - * Delete a project * - * @id project ID * */ - function index_delete($id=null) + public function resource_get($project_id=null,$resource_id=null) { try{ - if (!$id){ - throw new Exception("MISSING_PARAM: PID"); - } - - $project=$this->get_user_project_or_die($pid); - - $this->DD_project_model->delete($id); - $result=array( - 'status'=>'success', - 'message'=>'project deleted successfully!!!' - ); - $this->set_response($result, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'failed', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - - - /** - * - * - * Submit project - * - * Note: Submitting a project, locks the project for any further edits - * - * - * - */ - function submit_put($project_id=null) - { - try{ - if (!$project_id){ - throw new Exception("MISSING_PARAM: PID"); - } - - $user_id=$this->get_api_user_id(); - $options['changed_by']=$user_id; - - $project=$this->get_user_project_or_die($project_id,true); - - //submit project - if ($this->DD_project_model->submit_project($project_id,$email_notifications=true)){ - //reload project - $project=$this->DD_project_model->select_single($project_id); - - $response=array( - 'status'=>'success', - 'project'=>$project - ); + $project=$this->DD_project_model->get_by_id($project_id); - $this->set_response($response, REST_Controller::HTTP_OK); - } - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * - * update project status - * - * TODO: to be removed. Added for testing the api - * - * - * - */ - function project_status_put($project_id=null,$status=null) - { - try{ - if (!$project_id){ - throw new Exception("MISSING_PARAM: PROJECT_ID"); - } - if (!$status){ - throw new Exception("MISSING_PARAM: STATUS"); - } - - $user_id=$this->get_api_user_id(); - $options['changed_by']=$user_id; - - $project=$this->get_user_project_or_die($project_id); - - //submit project - if ($this->DD_project_model->set_project_status($project_id,$status,$options)){ - //reload project - $project=$this->DD_project_model->select_single($project_id); - - $response=array( - 'status'=>'success', - 'project'=>$project - ); - - $this->set_response($response, REST_Controller::HTTP_OK); + if(!$project){ + throw new Exception("Project not found"); } + + $resource=$this->DD_resource_model->get_project_resource($resource_id); + $this->set_response($resource, REST_Controller::HTTP_OK); } catch(Exception $e){ $error_output=array( 'status'=>'error', - 'message'=>$e->getMessage() + 'message'=>$e->getMessage() ); $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); } - } - + } - /** - * - * Update project access policy - * - * - */ - function access_policy_put($project_id=null) + function download_get($project_id=null,$resource_id=null) { try{ - if (!$project_id){ - throw new Exception("MISSING_PARAM: PID"); - } - - $project=$this->get_user_project_or_die($project_id); + $project=$this->DD_project_model->get_by_id($project_id); - $options=$this->raw_json_input(); - $user_id=$this->get_api_user_id(); - $options['changed_by']=$user_id; - - //validate - if ($this->DD_project_model->validate_project($options,$is_new=false)){ - //update project - $this->DD_project_model->update($project_id,$options); - //reload project - $project=$this->DD_project_model->select_single($project_id); + if(!$project){ + throw new Exception("Project not found"); + } - $response=array( - 'status'=>'success', - 'project'=>$project - ); + $user=$this->api_user(); - $this->set_response($response, REST_Controller::HTTP_OK); + if(!$user){ + throw new Exception("USER_NOT_LOGGEDIN"); } - } - catch(ValidationException $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage(), - 'errors'=>$e->GetValidationErrors() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - /** - * - * get project access policy - * - * - */ - function access_policy_get($project_id=null) - { - try{ - if (!$project_id){ - throw new Exception("MISSING_PARAM: PID"); + if(!$resource_id){ + throw new Exception("PARAM_NOT_SET: resource_id"); } - - $project=$this->get_user_project_or_die($project_id); - $options=$this->raw_json_input(); - $user_id=$this->get_api_user_id(); - $options['changed_by']=$user_id; + //get project data folder path + $project_folder_path=$this->DD_project_model->get_project_fullpath($project_id); - $access_policy=$this->DD_project_model->get_access_policy_info($project_id,$user_id); - - $response=array( - 'status'=>'success', - 'access_policy'=>$access_policy - ); - - $this->set_response($response, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - - /** - * - * - * Get projects by user - * - * - * - * - */ - public function user_projects_get($user_id=null) - { - try{ - //get current user ID - if(!$user_id){ - $user_id=$this->get_api_user_id(); + if (!$project_folder_path){ + throw new Exception("PROJECT_DATA_FOLDER_NOT_SET"); } - - $projects=$this->DD_project_model->get_user_projects($user_id); - - if (!$project){ - throw new Exception("PROJECT_NOT_FOUND"); + + $this->load->helper('download'); + $this->load->model('DD_resource_model'); + $this->lang->load("resource_manager"); + $this->load->model('managefiles_model'); + + $resource = $this->DD_resource_model->get_project_resource($resource_id); + + if (!$resource){ + throw new Exception("FILE_NOT_FOUND"); } - - //convert date fields to GMT - array_walk($projects, 'unix_date_to_gmt',array('created','changed')); - $response=array( - 'items'=>$projects - ); + $resource_path=unix_path($project_folder_path.'/'.$resource[0]->filename); + + if (!file_exists($resource_path)){ + throw new Exception("FILE_NOT_FOUND:".$resource_path); + } - $this->set_response($response, REST_Controller::HTTP_OK); + force_download3($resource_path,$resource[0]->filename); } catch(Exception $e){ - $error_output=array( + $output=array( 'status'=>'error', 'message'=>$e->getMessage() ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); + $this->set_response($output, REST_Controller::HTTP_BAD_REQUEST); } + } - } - - - - - - /** - * - * - * Update project metadata - * - * - * - * */ - public function metadata_post($project_id=null) - { - try{ - //raw data - $data = file_get_contents("php://input"); - - if (trim($data)==""){ - throw new Exception("NO_INPUT_DATA"); - } - - //decode to JSON to validate JSON is valid - $json=json_decode($data,true); - if (!$json){ - throw new Exception("INVALID_JSON_INPUT"); - } - $project=$this->get_user_project_or_die($project_id); - - //store JSON as is - no encoding/decoding - $this->DD_project_model->set_metadata($project_id,$data); - $this->set_response($json, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * - * Get project metadata - * - * - */ - function metadata_get($project_id) - { - try{ - $project=$this->get_user_project_or_die($project_id); - $metadata=$this->DD_project_model->get_metadata($project_id); - - //when there is no metadata - if (trim($metadata)==""){ - $metadata='{}'; - } - - header('Content-Type: application/json'); - echo $metadata; - die(); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - - } - - - /////////////////////////////////////////////////////////////////////// - /// CITATIONS - /////////////////////////////////////////////////////////////////////// - /** - * - * [GET] citations - list of resources - * [POST] citations - upload one or more files - * [PUT] citations/id - update resource metadata - no file uploads - * [GET] citations/id - Get a single resource - * [DELETE] citations/id - delete a single resource + attachment - * - * - */ - - /** - * - * Get project citations - * - * - */ - public function citations_get($project_id=null, $citation_id=null) - { - //get single resource if resource id is provided - if(is_numeric($project_id) && is_numeric($citation_id)){ - return $this->citation_get($project_id,$citation_id); - } - - try{ - $project=$this->get_user_project_or_die($project_id); - $citations=$this->DD_citation_model->get_project_citations($project_id); - array_walk($citations, 'unix_date_to_gmt',array('created','changed')); - $response=array( - 'items'=>$citations - ); - - $this->set_response($response, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * Get a single citation - * - * - * - */ - public function citation_get($project_id=null,$citation_id=null) - { - try{ - $project=$this->get_user_project_or_die($project_id); - $citation=$this->DD_citation_model->get_project_single_citation($project_id,$citation_id); - $this->set_response($citation, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * - * - * create new citation for the project - * - * - * - * */ - public function citations_post($project_id=null) - { - try{ - $project=$this->get_user_project_or_die($project_id); - $options['citation']=$this->raw_json_input(); - $options['pid']=$project_id; - $options['created_by']=$this->get_api_user_id(); - $options['changed_by']=$this->get_api_user_id(); - - //store JSON as is - no encoding/decoding - $citation_id=$this->DD_citation_model->insert($options); - $citation=$this->DD_citation_model->get_project_single_citation($project_id,$citation_id); - - $output=array( - 'status'=>'success', - 'citation'=>$citation - ); - - $this->set_response($output, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - /** - * - * Update a single citation - * - */ - public function citations_put($pid=null,$cid=null) - { - try{ - $project=$this->get_user_project_or_die($pid); - - if(!$cid){ - throw new Exception("CITATION_ID_NOT_SET"); - } - - $citation=$this->DD_citation_model->get_project_single_citation($pid,$cid); - - if(!$citation){ - throw new Exception("CITATION_NOT_FOUND"); - } - - $options['citation']=$this->raw_json_input(); - $options['citation']=$json; - $options['pid']=$pid; - $options['changed_by']=$this->get_api_user_id(); - - //update - $this->DD_citation_model->update($cid,$options); - $citation=$this->DD_citation_model->get_project_single_citation($pid,$cid); - - $output=array( - 'status'=>'success', - 'citation'=>$citation - ); - - $this->set_response($output, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * - * Delete a citation - * - */ - public function citations_delete($pid=null,$cid=null) - { - try{ - $project=$this->get_user_project_or_die($pid); - - if(!$cid){ - throw new Exception("CITATION_ID_NOT_SET"); - } - - //check citations exists for the project - $citation=$this->DD_citation_model->get_project_single_citation($pid,$cid); - - if(!$citation){ - throw new Exception('CITATION_NOT_FOUND'); - } - - $this->DD_citation_model->delete($cid); - - $response=array( - 'status'=>'success', - 'message'=>'Citation removed' - ); - $this->set_response($response, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /////////////////////////////////////////////////////////////////////// - /// RESOURCES - /////////////////////////////////////////////////////////////////////// - /** - * - * [GET] Resources - list of resources - * [POST] Resources - upload one or more files - * [PUT] Resources/id - update resource metadata - no file uploads - * [GET] Resources/id - Get a single resource - * [DELETE] Resources/id - delete a single resource + attachment - * - * - */ - - - /** - * - * - * Get all resources by the project - * - * @pid - (required) project ID - * @resource_id - (optional) resource ID - * - **/ - public function resources_get($pid=null, $resource_id=null) - { - //get single resource if resource id is provided - if(is_numeric($pid) && is_numeric($resource_id)){ - return $this->resource_get($pid,$resource_id); - } - - try{ - $project=$this->get_user_project_or_die($pid); - $resources=$this->DD_resource_model->get_project_resources($pid); - - array_walk($resources, 'unix_date_to_gmt',array('created','changed')); - - $response=array( - 'items'=>$resources - ); - - $this->set_response($response, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * Get a single resource - * - * - * - */ - public function resource_get($project_id=null,$resource_id=null) - { - try{ - $project=$this->get_user_project_or_die($project_id); - - $resource=$this->DD_resource_model->get_project_single_resource($project_id,$resource_id); - $this->set_response($resource, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * - * Add new resource by uploading a document - * - * - */ - function resources_post($pid=null) - { - try{ - if(!$pid){ - throw new Exception("PROJECT_ID_NOT_SET"); - } - $project=$this->get_user_project_or_die($pid); - - $options=$this->input->post(); - $user_id=$this->get_api_user_id(); - $options['created_by']=$user_id; - $options['changed_by']=$user_id; - $options['pid']=$pid; - - //process file upload - $result=$this->DD_resource_model->upload_file($pid,$file_field_name='file'); - - $uploaded_file_name=$result['file_name']; - $uploaded_path=$result['full_path']; - - $options['filename']=$uploaded_file_name; - - //title is required - if(!isset($options['title'])){ - $options['title']=$uploaded_file_name; - } - - //type is required - if(!isset($options['resource_type'])){ - $options['resource_type']='other'; - } - - //validate - if ($this->DD_resource_model->validate_resource($options)){ - $resource_id=$this->DD_resource_model->insert($options); - $resource=$this->DD_resource_model->select_single($resource_id); - - $response=array( - 'status'=>'success', - 'resource'=>$resource, - 'uploaded_file_name'=>$uploaded_file_name, - ); - - $this->set_response($response, REST_Controller::HTTP_OK); - } - } - catch(ValidationException $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage(), - 'errors'=>$e->GetValidationErrors(), - 'supported_file_types'=>str_replace(",","|",$this->config->item("allowed_resource_types")) - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage(), - 'supported_file_types'=>$this->config->item("allowed_resource_types") - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - - /** - * - * - * Update a single project resource - * - */ - public function resources_put($pid=null, $resource_id=null){ - try{ - if(!$pid){ - throw new Exception("PROJECT_ID_NOT_SET"); - } - $project=$this->get_user_project_or_die($pid); - - if(!$resource_id){ - throw new Exception("RESOURCE_ID_NOT_SET"); - } - - //check resource exists for the project - $resource=$this->DD_resource_model->get_project_single_resource($pid,$resource_id); - - if(!$resource){ - throw new Exception('RESOURCE_NOT_FOUND'); - } - - $options=$this->raw_json_input(); - $user_id=$this->get_api_user_id(); - $options['created_by']=$user_id; - $options['changed_by']=$user_id; - $options['pid']=$pid; - - - //validate - if ($this->DD_resource_model->validate_resource($options,$is_new=false)){ - $this->DD_resource_model->update($resource_id,$options); - $resource=$this->DD_resource_model->select_single($resource_id); - - $response=array( - 'status'=>'success', - 'resource'=>$resource - ); - - $this->set_response($response, REST_Controller::HTTP_OK); - } - } - catch(ValidationException $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage(), - 'errors'=>$e->GetValidationErrors() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - catch(Exception $e){ - $this->set_response($e->getMessage(), REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /** - * - * Delete a single resource - * - */ - public function resources_delete($pid=null,$resource_id=null){ - - try{ - if(!$pid){ - throw new Exception("PROJECT_ID_NOT_SET"); - } - $project=$this->get_user_project_or_die($pid); - - if(!$resource_id){ - throw new Exception("RESOURCE_ID_NOT_SET"); - } - - //check resource exists for the project - $resource=$this->DD_resource_model->get_project_single_resource($pid,$resource_id); - - if(!$resource){ - throw new Exception('RESOURCE_NOT_FOUND'); - } - - $this->DD_resource_model->delete($resource_id); - - $response=array( - 'status'=>'success', - 'message'=>'Resource removed' - ); - $this->set_response($response, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'error', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - - /////////////// REVIEW /////////////////////////// - public function review_get($pid) - { - - } - - - - /////////////// CONTROLLED VOCABULARIES /////////////////// - - //return a list of all access policies - public function list_access_policies_get() - { - - } - - //list of available catalogs for publishing the project - public function list_target_catalogs_get() - { - - } - - //list project types - public function list_project_types_get() - { - - } - } diff --git a/application/controllers/api/Datasets.php b/application/controllers/api/Datasets.php index 0b6a1fd03..3b73df476 100644 --- a/application/controllers/api/Datasets.php +++ b/application/controllers/api/Datasets.php @@ -257,6 +257,15 @@ function doi_post($idno=null) + /** + * + * Alias for index_put method when PUT is not enabled + * + */ + function options_post($idno=null) + { + return $this->index_put($idno); + } /** * @@ -829,25 +838,20 @@ function variable_get($idno=null,$var_id=null) * * Create variables for Datasets * @idno - dataset IDNo - * @file_id - user defined file id e.g. F1 - * + * @merge_metadata - true|false + * - true = partial update metadata + * - false = replace all metadata with new */ - function variables_post($idno=null,$file_id=null,$type='survey') + function variables_post($idno=null,$merge_metadata=false) { try{ $this->has_dataset_access('edit'); $options=(array)$this->raw_json_input(); $user_id=$this->get_api_user_id(); + $merge_metadata=$merge_metadata==='true'; $sid=$this->get_sid_from_idno($idno); - //get file id - $fid=$this->Data_file_model->get_fid_by_fileid($sid,$file_id); - - if(!$fid){ - throw new exception("FILE_NOT_FOUND: ".$file_id); - } - //check if a single variable input is provided or a list of variables $key=key($options); @@ -858,23 +862,46 @@ function variables_post($idno=null,$file_id=null,$type='survey') $options=null; $options=$tmp_options; } + + $valid_data_files=$this->Data_file_model->list_fileid($sid); //validate all variables foreach($options as $key=>$variable){ - $variable['fid']=$file_id; - $this->Variable_model->validate_variable($variable); - } - $result=array(); - foreach($options as $variable) - { - $variable['fid']=$file_id; - //all fields are stored as metadata - $variable['metadata']=$variable; - $variable_id=$this->Variable_model->insert($sid,$variable); - //$variable=$this->Variable_model->select_single($variable_id); - //$result[$variable['vid']]=$variable; - $result[$variable['vid']]=$variable_id; + if (!isset($variable['file_id'])){ + throw new Exception("`file_id` is required"); + } + + if (!in_array($variable['file_id'],$valid_data_files)){ + throw new Exception("Invalid `file_id`: valid values are: ". implode(", ", $valid_data_files )); + } + + if (isset($variable['vid']) && !empty($variable['vid'])){ + //check if variable already exists + $uid=$this->Variable_model->get_uid_by_vid($sid,$variable['vid']); + $variable['fid']=$variable['file_id']; + + if($uid){ + $var_mt=$this->Variable_model->get_var_by_vid($sid,$variable['vid']); + $var_mt=isset($var_mt['metadata']) ? $var_mt['metadata']: array(); + + //replace metadata with new options + if($merge_metadata==true){ + $variable=array_replace_recursive($var_mt,$variable); + } + + $this->Variable_model->validate_variable($variable); + $variable['metadata']=$variable; + $this->Variable_model->update($sid,$uid,$variable); + } + else{ + $this->Variable_model->validate_variable($variable); + $variable['metadata']=$variable; + $this->Variable_model->insert($sid,$variable); + } + + $result[]=$variable['vid']; + } } //update survey varcount @@ -1720,106 +1747,6 @@ function strip_ddi_put($idno=NULL,$strip='') } - /** - * - * Reload facets/filters - * - * @sid - study id - * - */ - public function refresh_filters_put($idno=null) - { - try{ - $sid=$this->get_sid_from_idno($idno); - $this->has_dataset_access('edit',$sid); - $this->dataset_manager->refresh_filters($sid); - - $output=array( - 'status'=>'success' - ); - $this->set_response($output, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $this->set_response($e->getMessage(), REST_Controller::HTTP_BAD_REQUEST); - } - } - - public function refresh_filters_get($idno=null) - { - return $this->refresh_filters_put($idno); - } - - /** - * - * Reload year facets - * - * @sid - study id - * - */ - public function refresh_year_facets_get($start_row=NULL, $limit=1000) - { - try{ - $this->has_dataset_access('edit'); - $output=$this->Dataset_model->refresh_year_facets($start_row, $limit); - $output=array( - 'status'=>'success', - 'result'=>$output - ); - $this->set_response($output, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $error_output=array( - 'status'=>'failed', - 'message'=>$e->getMessage() - ); - $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST); - } - } - - /** - * - * Batch Reload facets/filters by dataset type - * - * @dataset_type - dataset type - microdata, timeseries, etc - * @limit - number of items to process per request - * @start - starting dataset id - * - */ - public function batch_refresh_filters_get($dataset_type=null, $limit=100, $start=0) - { - try{ - $user_id=$this->get_api_user_id(); - $this->has_dataset_access('edit'); - if ($dataset_type==null){ - throw new Exception("DATASET_TYPE_IS_REQUIRED"); - } - - if(!is_numeric($start)){ - throw new Exception("PARAM:START-INVALID"); - } - - $datasets=(array)$this->dataset_manager->get_list_by_type($dataset_type, $limit, $start); - - $last_processed=null; - $output=array(); - foreach($datasets as $dataset){ - $this->dataset_manager->refresh_filters($dataset['id']); - $output[]=$dataset['id']; - $last_processed=$dataset['id']; - } - - $output=array( - 'status'=>'success', - 'datasets_updated'=>$output, - 'last_processed'=>$last_processed - ); - $this->set_response($output, REST_Controller::HTTP_OK); - } - catch(Exception $e){ - $this->set_response($e->getMessage(), REST_Controller::HTTP_BAD_REQUEST); - } - } - /** * @@ -1829,14 +1756,15 @@ public function batch_refresh_filters_get($dataset_type=null, $limit=100, $start * @start - starting dataset id * */ - public function batch_repopulate_index_put($dataset_type=null, $limit=100, $start=0) + public function batch_repopulate_index_get($dataset_type=null, $limit=100, $start=0) { try{ $user_id=$this->get_api_user_id(); $this->has_dataset_access('edit'); - if ($dataset_type==null){ + + /*if ($dataset_type==null){ throw new Exception("DATASET_TYPE_IS_REQUIRED"); - } + }*/ if(!is_numeric($start)){ throw new Exception("PARAM:START-INVALID"); @@ -1845,7 +1773,8 @@ public function batch_repopulate_index_put($dataset_type=null, $limit=100, $star $datasets=$this->dataset_manager->get_list_by_type($dataset_type, $limit, $start); $output=array(); - foreach($datasets as $dataset){ + $last_processed=0; + foreach($datasets as $dataset){ $this->dataset_manager->repopulate_index($dataset['id']); $output[]=$dataset['id']; $last_processed=$dataset['id']; @@ -2087,43 +2016,25 @@ function generate_pdf_post($idno=null) $log_threshold= $this->config->item("log_threshold"); $this->config->set_item("log_threshold",0); //disable logging temporarily - $report_link=''; $params=array('codepage'=>$pdf_options['report_lang']); $this->load->library('pdf_report',$params);// e.g. 'codepage' = 'zh-CN'; $this->load->library('DDI_Browser','','DDI_Browser'); - //get ddi file path from db - $ddi_file=$this->Catalog_model->get_survey_ddi_path($sid); $survey_folder=$this->Catalog_model->get_survey_path_full($sid); - if ($ddi_file===FALSE || !file_exists($ddi_file)){ - throw new Exception('FILE_NOT_FOUND: '. $ddi_file); - } - //output report file name $report_file=unix_path($survey_folder.'/ddi-documentation-'.$this->config->item("language").'-'.$sid.'.pdf'); - if ($report_link=='') - { - //change error logging to 0 - $log_threshold= $this->config->item("log_threshold"); - $this->config->set_item("log_threshold",0); - - $start_time=date("H:i:s",date("U")); - - //write PDF report to a file - $this->pdf_report->generate($report_file,$ddi_file,$pdf_options); - $end_time=date("H:i:s",date("U")); - - //log - $this->db_logger->write_log('survey','report generated '.$start_time.' - '. $end_time,'ddi-report',$sid); + //change error logging to 0 + $log_threshold= $this->config->item("log_threshold"); + $this->config->set_item("log_threshold",0); - //reset threshold level - $this->config->set_item("log_threshold",$log_threshold); - - $report_link=$report_file; - } + //write PDF report to a file + $this->pdf_report->generate($sid,$report_file,$pdf_options); + + //reset threshold level + $this->config->set_item("log_threshold",$log_threshold); $response=array( 'status'=> 'success', diff --git a/application/controllers/api/Resources.php b/application/controllers/api/Resources.php index aa3d2e994..323d2da93 100644 --- a/application/controllers/api/Resources.php +++ b/application/controllers/api/Resources.php @@ -149,6 +149,10 @@ function index_post($idno=null) $options['filename']=$uploaded_file_name; } + if(!isset($options['filename'])){ + $options['filename']=null; + } + //check if resource already exists $resource_exists=$this->Survey_resource_model->check_duplicate($sid,$options['filename'], $options['title'],$options['dctype']); $overwrite=isset($options["overwrite"]) ? $options["overwrite"] : false; @@ -244,9 +248,6 @@ function index_put($idno=null,$resource_id=null) } } - - - //delete a single resource by resource id function index_delete($idno=null,$resource_id=null) { @@ -280,6 +281,11 @@ function index_delete($idno=null,$resource_id=null) } } + //delete using post + function delete_post($idno=null,$resource_id=null) + { + return $this->index_delete($idno,$resource_id); + } //delete all resources by study @@ -301,6 +307,10 @@ public function delete_all_delete($idno=null) } } + public function delete_all_post($idno=null){ + return $this->delete_all_delete($idno); + } + //import rdf file public function import_rdf_post($idno=NULL) @@ -311,14 +321,8 @@ public function import_rdf_post($idno=NULL) $sid=$this->get_sid_from_idno($idno); $this->has_dataset_access('edit',$sid); - $result=$this->Survey_resource_model->upload_rdf($tmp_path=null,'file'); - $uploaded_file_name=$result['file_name']; - $uploaded_path=$result['full_path']; - - //import entries + $uploaded_path=$this->Survey_resource_model->upload_rdf($tmp_path=null,'file'); $imported_count=$this->Survey_resource_model->import_rdf($sid,$uploaded_path); - - //delete rdf @unlink($uploaded_path); $output=array( diff --git a/application/helpers/metadata_view_helper.php b/application/helpers/metadata_view_helper.php index dc1db5eac..c67579c4c 100644 --- a/application/helpers/metadata_view_helper.php +++ b/application/helpers/metadata_view_helper.php @@ -118,6 +118,30 @@ function render_group($name, $fields, $metadata,$options=array()) } } + +if ( ! function_exists('render_group_array')) +{ + function render_group_array($name, $fields, $metadata,$options=array()) + { + $ci =& get_instance(); + + $output=[]; + foreach($fields as $field_name=>$field_type){ + $value=get_field_value($field_name,$metadata); + //$field_options=isset($field_type['options']) + if (is_array($field_type)){ + $output[$field_name]= render_field($field_type[0],$field_name,$value,$options=$field_type['options']); + } + else{ + $output[$field_name]= render_field($field_type,$field_name,$value,$options); + } + } + + return $output; + } +} + + if ( ! function_exists('render_group_text')) { function render_group_text($section_name, $html) @@ -134,7 +158,7 @@ function render_group_text($section_name, $html) -if ( ! function_exists('render_columns')) +if ( ! function_exists('render_columns')) { function render_columns($name, $fields, $metadata,$options=array()) { @@ -227,5 +251,23 @@ function get_string_value($data,$type='text') throw new Exception("TYPE_NOT_SUPPORTED: ".$type); } -/* End of file search_helper.php */ -/* Location: ./application/helpers/search_helper.php */ \ No newline at end of file + +if ( ! function_exists('authors_to_string')) +{ + function authors_to_string($authors=array()) + { + $output=array(); + foreach($authors as $author){ + $author_name=array( + isset($author['first_name']) ? $author['first_name'] : '', + isset($author['last_name']) ? $author['last_name']: '' + ); + $output[]=implode(" ", array_filter($author_name)); + } + + return implode(", ", $output); + } +} + +/* End of file metadata_view_helper.php */ +/* Location: ./application/helpers/metadata_view_helper.php */ \ No newline at end of file diff --git a/application/language/arabic/breadcrumbs_lang.php b/application/language/arabic/breadcrumbs_lang.php index b15c72de1..7ab4f1408 100644 --- a/application/language/arabic/breadcrumbs_lang.php +++ b/application/language/arabic/breadcrumbs_lang.php @@ -1,7 +1,17 @@ الربط أو إلغاء الارتباط لربط الدراسات أو إلغاء ربطها."; +$lang['copy_studies_to']="نسخ الدراسات إلى"; +$lang['change_repo']="تحويل"; +$lang['repositoryid']="مجموعة"; +$lang['copy_studies']="نسخ الدراسات"; +$lang['transfer_study_ownership']="نقل مالك الدراسة"; +$lang['transfer_ownership']="نقل المالك"; +$lang['msg_studies_to_transfer']="الدراسات التي سيتم نقلها"; +$lang['study_owned']="الدراسة المملوكة"; +$lang['study_linked']="الدراسة المربوطة"; +$lang['is_harvested_study']="الدراسة المحصودة"; +$lang['select_publish_unpublish']="حدد للنشر / إلغاء النشر"; +$lang['publish']="نشر"; +$lang['series']="سلسلة"; +$lang['data_access']="النفاذ للبيانات"; +$lang['overwrite_if_exists']="إستبدل إن وجدت؟"; +$lang['sort_by']="ترتيب النتائج حسب:"; +$lang['surveyid']="رقم المسح"; +$lang['no_related_citations_click_here_to_add']="لا توجد اقتباسات مرفقة بهذا المسح، لإضافة الاقتباسات ذات الصلة ، انقر هنا."; +$lang['max_upload_limit']="أقصى حجم لملف التحميل:"; +$lang['upload_ddi']="أضف دراسة"; +$lang['clear_filter']="مسح التصفية/الفلتر"; +$lang['countries']="البلدان"; +$lang['titl']="العنوان"; +$lang['study_status']="حالة الدراسة"; +$lang['all']="الكل"; +$lang['published']="منشورة"; +$lang['unpublished']="غير منشورة"; +$lang['tags']="العلامات Tags"; +$lang['click_to_publish_unpublish']="انقر للنشر أو إلغاء النشر"; +$lang['pdf_not_generated']="لم يتم إنشاء ملف PDF"; +$lang['pdf_uptodate']="ملف PDF محدث"; +$lang['pdf_outdated']="ملف PDF قديم"; +$lang['metadata_in_pdf']="البيانات الوصفية في PDF"; +$lang['replace_ddi']="استبدل DDI"; +$lang['delete_study']="حذف الدراسة"; +$lang['generate_pdf']="إنشاء/توليد ملف PDF"; +$lang['upload_rdf']="تحميل RDF"; +$lang['link_resources']="ربط الموارد"; +$lang['export_ddi']="تصدير DDI"; +$lang['export_rdf']="تصدير RDF"; +$lang['admin_notes']="ملاحظات المسؤول"; +$lang['reviewer_notes']="ملاحظات المراجع"; +$lang['study_collections']="عرض في مجموعات أخرى"; +$lang['study_aliases']="الأسماء المستعارة للدراسة"; +$lang['study_warnings']="تحذيرات!"; +$lang['warning_study_has_no_external_resources']="الدراسة ليس لها موارد خارجية مرفقة"; +$lang['warning_study_has_no_microdata']="الدراسة ليس لها بيانات جزئية مرفقة"; +$lang['warning_study_has_no_questionnaire']="الدراسة ليس لديها إستمارات مرفقة"; +$lang['warning_study_has_pending_licensed_requests']="الدراسة لديها طلبات مرخصة في حالة الانتظار"; +$lang['warning_study_not_published']="الدراسة لم تنشر"; +$lang['warning_study_years_not_set']="الدراسة لم يتم تعيين سنوات جمع البيانات لها "; +$lang['warning_study_has_no_pdf_documentation']="الدراسة لم يتم انشاء توثيق البيانات الوصفية لها في ملف PDF"; +$lang['study_no_questionnaire']="دراسات بدون إستمارات"; +$lang['study_no_datafile']="دراسات بدون بيانات"; +$lang['filter']="فلترة/تصفية"; +$lang['ID']="الرقم/المعرّف"; +$lang['collection']="مجموعة"; +$lang['modified_on']="تعديل بتاريخ"; +$lang['Published']="منشورة"; +$lang['Survey options']="خيارات المسح"; +$lang['Tags']="علامات Tags"; +$lang['Generate PDF']="إنشاء/توليد PDF"; +$lang['Status']="حالة"; +$lang['batch_upload_files']="تحميل ملفات"; +$lang['clear_import_folder']="إمسح ملفات الاستيراد"; +$lang['central_catalog_short_text']="فقرة تصف الكتالوج المركزي"; +$lang['study_exists_in_other_collection']="الدراسة موجودة بالفعل في المجموعة [s%]. لتحديث الدراسة ، يجب عليك التبديل إلى المجموعة وتحميل DDI."; +$lang['type_admin']="ملاحظات المسؤول"; +$lang['type_reviewer']="ملاحظات المراجع"; +$lang['type_public']="ملاحظات عامة"; +$lang['select_note_type']="حدد نوع الملاحظة"; +$lang['admin_note']="ملاحظة المسؤول"; +$lang['reviewer_note']="ملاحظة المراجع"; +$lang['public_note']="ملاحظة عامة"; +$lang['add_note']="أضف ملاحظة"; +$lang['click_on_icon_to_remove_citation']="انقر فوق الرمز s% لإزالة الاقتباس"; +$lang['attach_citation']="إرفاق الاقتباس"; +$lang['js_refreshing_page']="جاري تحميل الصفحة ، برجاء الانتظار ..."; +$lang['remove_from_collection']="إزالة"; +$lang['remove_from_collection_description']="إزالة هذه الدراسة من هذه المجموعة."; +$lang['studies_linked_count']="دراسات مرتبطة من مجموعات أخرى"; +$lang['notes']="ملاحظات"; +$lang['link_study']="ربط"; +$lang['unlink_study']="إزالة الربط"; +$lang['transfer']="نقل"; +$lang['select_the_repository_from_the_list_below']="حدد المجموعة من القائمة أدناه لنقل الملكية إلى مجموعة أخرى."; +$lang['study_metadata_updated']="تم تحديث البيانات الوصفية للدراسة!"; +$lang['refresh_ddi']="تحديث DDI"; +$lang['batch_refresh_ddi']="تحديث حزمة DDI"; +$lang['ddi_batch_refresh_title']="تحديث حزمة DDI"; +$lang['btn_refresh']="تحديث DDI"; +$lang['refresh_ddi_description']="تحديث DDI تحدث قاعدة البيانات بالبيانات الوصفية من DDI."; +$lang['total_studies_found']="مجموع الدراسات التي وجدت"; +$lang['mark_as_featured']="العرض كدراسة مميزة؟"; +$lang['msg_study_ownership_has_changed']="تغيرت ملكية الدراسة!"; +$lang['replace_ddi_failed_duplicate_study_found']="يحتوي الكتالوج على دراسة أخرى بنفس المعرف"; +$lang['show_selected_only']="إظهار المحدد فقط"; +$lang['Data available from external repository']="البيانات متاحة من مستودع خارجي"; +$lang['Data not available']="البيانات غير متوفرة"; +$lang['error_no_collection_selected']="لم تقم بتحديد المجموعة!"; +$lang['confirm_publish_records']="تأكيد لنشر الدراسة؟"; +$lang['confirm_publish']="ينشر؟"; +$lang['attach_citations']="إرفاق الإقتباسات"; +$lang['return_to_edit_page']="العودة لتحرير الصفحة"; +$lang['attach_related_data']="إرفاق ذات الصلة"; +$lang['no_related_studies_click_here_to_add']="لا توجد دراسات ذات صلة مرفقة"; +$lang['relationship_type']="نوع العلاقة"; +$lang['draft']="مسودة"; +$lang['confirm_unpublish_records']="هل أنت متأكد أنك تريد إلغاء نشر السجلات؟"; +$lang['confirm_unpublish']="تأكيد إلغاء النشر"; +$lang['idno']="رقم/معرّف الدراسة"; +$lang['search_results_for']="نتائج البحث عن:"; +$lang['tab_overview']="نبذة"; +$lang['tab_manage_files']="ملفات"; +$lang['tab_resources']="موارد"; +$lang['tab_citations']="اقتباسات"; +$lang['tab_data_files']="ملفات البيانات"; +$lang['tab_notes']="ملاحظات"; +$lang['tab_related_data']="دراسات ذات صلة"; +$lang['license']="رخصة"; +$lang['select_license']="إختر الرخصة"; +$lang['select_study_thumbnail']="إختر ملف الصورة (PNG ، JPG ، JPEG ، GIF)"; +$lang['Thumbnal']="الصورة المصغرة"; +$lang['Upload thumbnal']="تحميل الصورة المصغرة"; + + +/* End of file catalog_admin */ +/* Location: ./application/language/arabic/catalog_admin */ \ No newline at end of file diff --git a/application/language/arabic/catalog_search_lang.php b/application/language/arabic/catalog_search_lang.php index 053567a5f..635dd9ae7 100644 --- a/application/language/arabic/catalog_search_lang.php +++ b/application/language/arabic/catalog_search_lang.php @@ -1,114 +1,250 @@ %d من %d-%d عرض "; -$lang['found_study']="%dمسح من %dوجود"; -$lang['found_studies']="%dمسوح من %dوجود "; -$lang['showing_variables']="متغيرات%d من%d-%dعرض "; -$lang['showing_pages']="%dمن %s صفحة "; -$lang['variables_keywords_found']=" d% تم العثور على كلمات البحث في d% متغير من أصل"; -$lang['link_browse_metadata']="تصفح البيانات الوصفية"; -$lang['link_browse_metadata_hover']="تصفح البيانات الوصفية"; -$lang['link_access_policy']="سياسة النفاذ"; +$lang['showing_studies']="إظهار %d-%d من%d"; +$lang['found_study']="تم العثور على %d دراسة من أصل %d"; +$lang['found_studies']="تم العثور على % d دراسات من إجمالي % d "; +$lang['found_variable']="تم العثور على % d متغير من أصل % d "; +$lang['found_variables']="تم العثور على % d متغيرات من أصل % d "; +$lang['showing_variables']="إظهار %d-%d من % s المتغيرات"; +$lang['showing_pages']=" الصفحة d% من s% +"; +$lang['variables_keywords_found']="تم العثور على كلمة (كلمات) رئيسية في d% متغير (متغيرات) من d% "; +$lang['link_browse_metadata']="إستعراض البيانات الوصفية"; +$lang['link_browse_metadata_hover']="إستعراض البيانات الوصفية"; +$lang['link_access_policy']="سياسة النفاذ/الوصول"; $lang['link_access_policy_hover']="سياسة النفاذ الى البيانات االجزئية"; $lang['link_data']="بيانات"; -$lang['link_data_direct_hover']="استمارة طلب البيانات الجزئية (نفاذ مباشر)"; -$lang['link_data_public_hover']="استمارة طلب البيانات الجزئية (نفاذ للعموم) "; -$lang['link_data_licensed_hover']="استمارة طلب البيانات الجزئية (نفاذ مرخص) "; -$lang['link_data_enclave_hover']="استمارة طلب البيانات الجزئية (في المركز)"; -$lang['link_citations']="وصلة الاقتباس"; +$lang['link_data_direct_hover']="نموذح طلب البيانات الجزئية (نفاذ مباشر)"; +$lang['link_data_public_hover']="نموذج طلب البيانات الجزئية (نفاذ للعموم) "; +$lang['link_data_licensed_hover']="نموذج طلب البيانات الجزئية (نفاذ مرخص) "; +$lang['link_data_enclave_hover']="نموذج طلب البيانات الجزئية (في المركز)"; +$lang['link_citations']="الإقتباس"; $lang['link_citations_hover']="الدراسات ذات الصلة بالاقتباسات"; -$lang['link_reports']="التقارير و المخرجات التحليلية"; -$lang['link_reports_hover']="التقارير و المخرجات التحليلية"; -$lang['link_indicators']="المؤشرات و الجداول (قاعدة البيانات)"; -$lang['link_indicators_hover']="المؤشرات و الجداول (قاعدة البيانات)"; +$lang['link_reports']="التقارير والمخرجات التحليلية"; +$lang['link_reports_hover']="التقارير والمخرجات التحليلية"; +$lang['link_indicators']="أدوات تفاعلية"; +$lang['link_indicators_hover']="أدوات تفاعلية"; $lang['link_questionnaires']="الاستمارات"; $lang['link_questionnaires_hover']="الاستمارات"; $lang['link_technical']="الوثائق التقنية"; $lang['link_technical_hover']="الوثائق التقنية"; -$lang['link_study_website']="موقع الدراسة"; -$lang['link_study_website_hover']="موقع الدراسة(مع كل الوثائق المتاحة) "; -$lang['link_ddi']=" (DDI)البيانات الوصفية للمسح"; -$lang['link_ddi_hover']=" DDIالبيانات الوصفية للمسح بصيغة "; -$lang['switch_to_study_view']="تبديل الى عرض المسوح"; +$lang['link_study_website']="الموقع الإلكترني للدراسة"; +$lang['link_study_website_hover']="الموقع الإلكترني للدراسة (مع كل الوثائق المتاحة) "; +$lang['link_ddi']=" البيانات الوصفية للدراسة (DDI)"; +$lang['link_ddi_hover']=" البيانات الوصفية للمسح بصيغة DDI "; +$lang['switch_to_study_view']="تبديل الى عرض الدراسة"; $lang['compare_hover']="مقارنة المتغيرات"; $lang['compare_selected_variables']="مقارنة المتغيرات المختارة"; $lang['mark_for_variable_comparison']="تعيين المتغير للمقارنة"; -$lang['variable_info']="معلومات على المتغيرات"; -$lang['field_survey_title']="اسم المسح"; -$lang['js_searching']="...جاري البحث الرجاء الانتظار"; -$lang['js_loading']="...جاري التحميل الرجاء الانتظار"; +$lang['variable_info']="معلومات المتغير"; +$lang['field_survey_title']="عنوان المسح"; +$lang['js_searching']="جاري البحث الرجاء الانتظار ..."; +$lang['js_loading']="جاري التحميل الرجاء الانتظار ..."; $lang['js_invalid_year_range_selected']="مجموعة السنوات المختارة غير صالحة."; -$lang['js_topic_selected']="المواضيع المختارة"; +$lang['js_topic_selected']="الموضوع المختار"; $lang['js_topics_selected']="المواضيع المختارة"; -$lang['js_country_selected']="البلدان المختارة"; +$lang['js_country_selected']="البلد المختارة"; $lang['js_countries_selected']="البلدان المختارة"; -$lang['title_compare_variables']="مقارنة المتغيرات المختارة"; +$lang['title_compare_variables']="مقارنة المتغيرات "; $lang['click_drag_move']="انقر واسحب للنقل"; -$lang['open_in_new_window']="افتح صفحة جديدة"; -$lang['download_pdf']=" PDFتنزيل"; -$lang['click_to_browse_metadata']="انقر هنا لتصفح البيانات الوصفية"; -$lang['producers']="المنتجين"; -$lang['sponsors']="الممولين"; -$lang['citations_of_publications']="الاستشهادات والمنشورات التي استعملت الدراسة"; -$lang['study_resources']="وثائق الدراسة"; +$lang['open_in_new_window']="افتح في صفحة جديدة"; +$lang['download_pdf']=" تنزيل PDF"; +$lang['download_csv']="تنزيل ملف CSV"; +$lang['download_json']="تنزيل ملف JSON"; +$lang['click_to_browse_metadata']="انقر هنا لإستعراض البيانات الوصفية"; +$lang['producers']="المنتجون"; +$lang['sponsors']="الممولون"; +$lang['citations_of_publications']="المنشورات ذات الصلة"; $lang['click_to_view_information']="انقر لعرض المعلومات"; -$lang['view_more_information']="عرض معلومات اكثر"; +$lang['view_more_information']="عرض المزيد من المعلومات"; $lang['technical_documents']="وثائق تقنية"; $lang['reports']="تقارير"; -$lang['questionnaires']="استبيانات"; -$lang['other_materials']="مواد اخرى"; +$lang['questionnaires']="إستمارات"; +$lang['other_materials']="مواد أخرى"; $lang['description']="وصف"; -$lang['abstract']="خلاصة"; +$lang['abstract']="ملخص"; $lang['table_of_contents']="جدول المحتويات"; $lang['classification']="تصنيف"; $lang['compare_hover_text']="مقارنة المتغيرات المختارة"; -$lang['select_number_of_records_per_page']="اختر عدد من السجلات في كل صفحة"; -$lang['source_catalog']=" s%البيانات الوصفية يوفرها"; -$lang['source']="مورد"; -$lang['download_ddi']="DDIتحميل "; +$lang['select_number_of_records_per_page']="حدد عدد السجلات لإظهارها لكل صفحة"; +$lang['source_catalog']="البيانات الوصفية الموفرة من قبل s%"; +$lang['source']="المصدر"; +$lang['download_ddi']="تنزيل DDI"; $lang['link_data_remote_hover']="البيانات الجزئية المتاحة من مستودع خارجي "; -$lang['collections']="مجموعة"; -$lang['legend_direct_access']="النفاذ المباشر"; -$lang['legend_data_public']="الملفات للاستخدم العام"; -$lang['legend_data_licensed']="ملف بموجب ترخيص"; +$lang['collections']="مجموعات"; +$lang['legend_data_direct']="الوصول المباشر إلى البيانات"; +$lang['legend_data_public']="ملفات البيانات المؤهلة للإستخدام العام"; +$lang['legend_data_licensed']="ملفات بيانات بموجب ترخيص"; $lang['legend_data_enclave']="البيانات الجزئية في المركز"; +$lang['legend_data_open']="الوصول المفتوح للبيانات"; $lang['legend_data_remote']="البيانات المتاحة من خلال مستودع خارجي"; +$lang['legend_data_data_na']="البيانات غير المتوفرة"; +$lang['legend_data_cc40']="رخصة المشاع الإبداعي 4.0"; +$lang['legend_data_research']="بحث البيانات الجزئية"; +$lang['legend_data_research_public']="البيانات الجزئية للبحث العام"; +$lang['legend_data_research_license']="بحث البيانات الجزئية بترخيص"; +$lang['legend_data_research_public_lic']="البيانات الجزئية للأبحاث العامة مع الترخيص"; +$lang['data_class_public']="عام"; +$lang['data_class_official']="رسمي"; +$lang['data_class_confidential']="خصوصي وسري"; +$lang['license']="مرخص"; +$lang['data_class_note_public']="تم تصنيف مجموعة البيانات هذه على أنها عامة بموجب سياسة تصنيف الوصول إلى المعلومات. يمكن للموظفين والمستخدمين الخارجيين الوصول إلى مجموعة البيانات هذه."; +$lang['data_class_note_official']="تم تصنيف مجموعة البيانات هذه على أنها رسمية بموجب سياسة تصنيف الوصول إلى المعلومات. الوصول إلى البيانات يقتصر على الموظفين فقط."; +$lang['data_class_note_confidential']="تم تصنيف مجموعة البيانات هذه على أنها سرية بموجب سياسة تصنيف الوصول إلى المعلومات. الوصول إلى البيانات يقتصر على الموظفين فقط."; $lang['no_variables_to_compare']="لم تقم بتحديد أية متغيرات للمقارنة. الرجاء العودة وتحديد بعض المتغيرات ثم قم بتشغيل المقارنة مرة أخرى"; -$lang['accesspolicy']="سياسة النفاذ"; -$lang['study_meta_description']="يتم سرد %s التي تنتجها %s في كتالوج %s. البيانات والبيانات الوصفية متاحة من الرابط أعلاه."; -$lang['meta_description_catalog']="كتالوج البيانات يمكنك من تصفح وبحث وتحميل و دراسة البيانات و البيانات الوصفية . +$lang['refno']="الرقم المرجعي"; +$lang['accesspolicy']="سياسة النفاذ/الوصول"; +$lang['study_meta_description']="يتم سرد s% التي تنتجها s% في كتالوج s%. البيانات والبيانات الوصفية متاحة من الرابط أعلاه."; +$lang['meta_description_catalog']="كتالوج البيانات يمكنك من تصفح، بحث وتنزيل البيانات والبيانات الوصفية للدراسة . "; -$lang['new_window']="فتح نافذة جديدة +$lang['new_window']="فتح في نافذة جديدة "; - - -/* End of file catalog_search_lang.php */ -/* Location: ./application/language/arabic/catalog_search_lang.php */ \ No newline at end of file +$lang['harvested_study_access_complete_metadata']="تم حصاد المعلومات المقدمة في هذه الصفحة من مستودع مساهم: %s +يمكنك تصفح وتنزيل البيانات الوصفية من هذه الصفحة. لتنزيل المواد ذات الصلة والوصول إلى البيانات، <;a href="%s"> قم بزيارة صفحة المسح في المستودع الأصلي ."; +$lang['data']="بيانات"; +$lang['by']="بواسطة"; +$lang['data_direct_description']="يتم توفير مجموعات البيانات والوثائق ذات الصلة للمستخدمين مجانًا. ليست هناك حاجة لتسجيل الدخول إلى التطبيق."; +$lang['data_public_description']="الوثائق ذات الصلة متاحة مجانا للمستخدمين. ومع ذلك ، يجب على المستخدمين تسجيل الدخول إلى التطبيق للوصول إلى مجموعات البيانات هذه."; +$lang['data_licensed_description']="الوثائق ذات الصلة متاحة مجانا للمستخدمين. يتطلب الوصول إلى مجموعات البيانات أن يتقدم المستخدم بطلب للحصول على الموافقة للوصول إلى مجموعات البيانات هذه. يجب على المستخدمين تسجيل الدخول إلى التطبيق وملء نموذج الطلب عند التقدم للحصول على حق الوصول."; +$lang['data_enclave_description']="الوثائق ذات الصلة متاحة مجانا للمستخدمين. يتطلب الوصول إلى مجموعات البيانات أن يتقدم المستخدم بطلب للحصول على الموافقة للوصول إلى مجموعات البيانات هذه في مكان وبيئة آمنة في المركز."; +$lang['data_remote_description']="الوثائق ذات الصلة متاحة مجانا للمستخدمين. يتم الاحتفاظ بمجموعات البيانات في كتالوجات في الخارج أو في مؤسسات أخرى."; +$lang['data_na_description']="الوثائق ذات الصلة متاحة مجانا للمستخدمين. ومع ذلك ، فإن مجموعات البيانات لهذه الدراسات غير متوفرة."; +$lang['data_open_description']="مجموعات البيانات والوثائق ذات الصلة للمستخدمين يتم توفيرها مجانًا."; +$lang['filter_by_data']="الوصول للبيانات"; +$lang['legend_na_access']="البيانات غير متوفرة"; +$lang['central_data_catalog']="كتالوج/فهرس البيانات المركزي"; +$lang['data_catalogs']="كتالوج/فهرس البيانات"; +$lang['visit_catalog']="قم بزيارة الكتالوج"; +$lang['catalog_owned_by']="مجموعة"; +$lang['legend_citations']="اقتباسات من المنشورات التي استخدمت الدراسة"; +$lang['catalog_history']="تاريخ/سجل الكتالوج"; +$lang['search_no_results']="

لم يتطابق بحثك مع أي دراسات أجريت في الفهرس.

+

الاقتراحات: +