{"id":19740154,"url":"https://github.com/nceas/metadig-r","last_synced_at":"2025-04-30T05:32:49.549Z","repository":{"id":10836173,"uuid":"67173612","full_name":"NCEAS/metadig-r","owner":"NCEAS","description":"MetaDIG client package for R","archived":false,"fork":false,"pushed_at":"2024-04-23T18:56:48.000Z","size":74,"stargazers_count":3,"open_issues_count":2,"forks_count":4,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-04-23T20:37:43.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NCEAS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-09-01T23:30:24.000Z","updated_at":"2022-10-16T18:51:30.000Z","dependencies_parsed_at":"2024-04-23T19:58:18.843Z","dependency_job_id":"a071f4d3-e880-42bc-b25c-4010adba8a31","html_url":"https://github.com/NCEAS/metadig-r","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCEAS%2Fmetadig-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCEAS%2Fmetadig-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCEAS%2Fmetadig-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCEAS%2Fmetadig-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NCEAS","download_url":"https://codeload.github.com/NCEAS/metadig-r/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224198945,"owners_count":17272189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T01:19:44.632Z","updated_at":"2024-11-12T01:19:46.008Z","avatar_url":"https://github.com/NCEAS.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metadig\n\nThe *metadig* R package provides functions that assist in authoring and running metadata\nchecks in R to be used by the [Java metadata quality engine](https://github.com/NCEAS/metadig-engine)\ncreated by the Metadata Improvement and Guidance project (MetaDIG), a National Science Foundation\nfunded project (grant #1443062). When complete and tested, these checks can then be included in quality suites\nrunning the Java reference implementation of the quality engine.\n\nThe MetaDIG project has defined a methodology for running tests to evaluate the conformance of a\nmetadata document to a set of quality metrics, using an automated metadata quality engine that runs\na suite of checks for a single or collection of metadata documents. A data repository that\nuses this quality engine is located at \u003chttps://arcticdata.io\u003e.\n\n## Installation\n\nInstall the package using:\n\n```{r}\n# install.packages(\"remotes\")\nremotes::install_github(\"NCEAS/metadig-r\")\n```\n\n## Usage\n\n### `check_presence(name)`\n\nChecks if the given `name` is non-`NULL` and sets an appropriate status and \noutput.\n\n**Example:**\nGiven name `title` (`/eml/dataset/title`): 'My dataset'\n\n```{r}\ncheck_presence(title)\n```\n\n- Status: SUCCESS\n- Output:\n    - \"Object 'title' was present and was of length 10.\"\n\n\n### `success(message)` \u0026 `failure(message)`\n\nSets the status for a check and, optionally, creates a new output \nwith your message. Once a check's status is set to FAILURE, it cannot be set\nback to SUCCESS.\n\n**Example:**\n\nGiven name `title` (`/eml/dataset/title`)\n\n```{r}\nif (nchar(title) \u003e 100) {\n  success(\"Title was long enough.\")\n} else {\n  failure(\"Title was too short.\")\n}\n```\n\n- Status: SUCCESS\n- Output:\n    - \"Title was long enough.\"\n\n\n### `runCheck(checkXML, metadataXML)`\n\nQuality checks authored for the Java quality engine can be tested in the R environment using this package.\nChecks must be written in an XML format designed for the quality engine, \nwhich includes the source code of the check.\n\nExamples of quality checks written in R are available in this package within the \"inst/extdata\" folder.\nThe following example runs a quality check in the R environment, using an example metadata file that is\nalso provided by the package:\n\n```{r}\nlibrary(metadig)\nlibrary(xml2)\n\ncheckFile \u003c- system.file(\"extdata/dataset_title_length-check.xml\", package = \"metadig\")\nmetadataFile \u003c- system.file(\"extdata/example_EML.xml\", package = \"metadig\")\n\nresults \u003c- runCheck(checkFile, metadataFile)\n```\n\nThe returned `results` object provides a status of the check which can include\nSUCCESS, FAILURE, or SKIP as well as output describing the results of the check.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnceas%2Fmetadig-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnceas%2Fmetadig-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnceas%2Fmetadig-r/lists"}