<commit_before>package uk.ac.wellcome.models

case class Concept(
  label: String,
  ontologyType: String = "Concept"
)<commit_msg>Flesh out the Concept and QualifiedConcept models<commit_after>package uk.ac.wellcome.models

sealed trait AbstractConcept {
  val label: String
  val ontologyType: String
}

// This is an example of a QualifiedConcept and a Concept from Silver's notes:
//
//   "subjects": [
//     {
//       "label": "Tuberculosis - prevention & control.",
//       "type": "QualifiedConcept",
//       "concept": {
//         "id": "hd2891f",
//         "label": "Tuberculosis",
//         "type": "Concept",
//         "identifiers": [
//           {
//             "type": "Identifier",
//             "identifierScheme": "mesh",
//             "value": "D014376Q000517"
//           }
//         ],
//         "qualifiers": [
//           {
//             "qualifierType": "general-subdivision" ,
//             "label": "prevention & control",
//             "type": "Concept"
//           }
//         ]
//       }
//     },
//   ]
//
// In particular, these models assume:
//
//  - A Work can have a mixture of Concept or a QualifiedConcept in the subject
//    and genre fields
//  - The "concept" on a QualifiedConcept is never another QualifiedConcept
//  - The "qualifiers" field can be nested -- so you could have something like:
//
//        "qualifiers": [
//          {
//            "qualifierType": "subdivision",
//            "label": "fizzbuzz",
//            "type": "Concept",
//            "qualifiers": [
//              {
//                "qualifierType": "sub-subdivision",
//                "label": "fizz",
//                "type": "Concept",
//              }
//            ]
//          }
//        ]
//

case class Concept(
  label: String,
  qualifierType: Option[String] = None,
  qualifiers: List[Concept] = List(),
  ontologyType: String = "Concept"
) extends AbstractConcept

case class QualifiedConcept(
  label: String,
  concept: Concept,
  ontologyType: String = "QualifiedConcept"
) extends AbstractConcept
{'fraction_non_alphanumeric': 0.15295256534365925, 'fraction_numerical': 0.007744433688286544, 'mean_word_length': 1.745019920318725, 'pattern_counts': {'":': 23, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3952740', 'n_tokens_mistral': 638, 'n_tokens_neox': 608, 'n_words': 154}