biothings / discovery-app

The Data Discovery Engine project by the CD2H Data working-group
http://discovery.biothings.io
Apache License 2.0
4 stars 9 forks source link

Add human-readable names to controlled vocabulary terms in DDE forms #150

Open flaneuse opened 2 years ago

flaneuse commented 2 years ago

In the NIAID Dataset/ComputationalTool guide, many of the terms are tied to controlled vocabularies, like measurementTechnique, healthCondition, infectiousAgent, species. The guide currently allows you to look up the term by name, but it only saves the url from the ontology, so the human-readable form is lost.

It'd be good to save these labels as a DefinedTerm, with the syntax:

{
    "@type": "DefinedTerm",
    "@id": < unique identifier in ontology > ,
    "termCode": < unique identifier in ontology > ,
    "url": < url in ontology > ,
    "inDefinedTermSet": < ontology url stub without the unique identifier > ,
    "name": < name in ontology >
}

Example dataset

{
  "@type": "Dataset",
  "identifier": ["cvisb_30788396"],
  "doi": null,
  "name": "Lassa Fever in Post-Conflict Sierra Leone",
  "description": "Background\n",
  "measurementTechnique": ["immunological assay"],
  "creator": [{
    "name": "Consortium for Viral Systems Biology (CViSB)",
    "dateModified": "CViSB"
  }],
  "sdPublisher": {
    "name": "Figshare"
  },
  "distribution": [{
    "contentUrl": "https:\/\/figshare.com\/articles\/dataset\/_Lassa_Fever_in_Post_Conflict_Sierra_Leone_\/968276",
    "dateModified": "2014-03-19"
  }],
  "funding": [{
    "identifier": "U19AI135995",
    "funder": {
      "name": "National Institute of Allergy and Infectious Diseases (NIAID)"
    }
  }],
  "citation": null,
  "license": null,
  "species": ["http://purl.obolibrary.org/obo/NCBITaxon_9606"],
  "infectiousAgent": ["https://www.ontobee.org/ontology/NCBITaxon?iri=http://purl.obolibrary.org/obo/NCBITaxon_11620"],
  "healthCondition": ["http://purl.obolibrary.org/obo/MONDO_0005820"],
  "spatialCoverage": ["Sierra Leone"],
  "temporalCoverage": "2008-2012"
}

Expected output

Note: since these fields are not strict in having an ontology being required, it's possible that you will have terms (like immunological assay in measurementTechnique that are not tied to an ontology.

"measurementTechnique": [{
    "@type": "DefinedTerm",
    "name": "immunological assay"
  }],
  "species": [{
    "@type": "DefinedTerm",
    "@id": "NCBITaxon_9606",
    "termCode": "NCBITaxon_9606",
    "url": "http://purl.obolibrary.org/obo/NCBITaxon_9606",
    "inDefinedTermSet": "http://purl.obolibrary.org/obo",
    "name": "Homo sapiens"
  }],
  "infectiousAgent": [{
    "@type": "DefinedTerm",
    "@id": "NCBITaxon_11620",
    "termCode": "NCBITaxon_11620",
    "url": "https://www.ontobee.org/ontology/NCBITaxon?iri=http://purl.obolibrary.org/obo/NCBITaxon_11620",
    "inDefinedTermSet": "http://purl.obolibrary.org/obo",
    "name": "Lassa mammarenavirus"
  }],
  "healthCondition": [{
    "@type": "DefinedTerm",
    "@id": "MONDO_0005820",
    "termCode": "MONDO_0005820",
    "url": "http://purl.obolibrary.org/obo/MONDO_0005820",
    "inDefinedTermSet": "http://purl.obolibrary.org/obo",
    "name": "Lassa fever"
  }]
gtsueng commented 2 years ago

casing on termcode should be termCode

flaneuse commented 2 years ago

thanks @gtsueng , edited.

flaneuse commented 1 year ago

Also want to be able to search either the term name and/or the term url