PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX cosmos_bc: <https://www.cdisc.org/cosmos/biomedical_concept_v1.0>
PREFIX NCIT: <http://purl.obolibrary.org/obo/NCIT_>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX vann: <http://purl.org/vocab/vann/>

cosmos_bc: a owl:Ontology ;
  vann:preferredNamespacePrefix "cosmos_bc" ;
  vann:preferredNamespaceUri "https://www.cdisc.org/cosmos/biomedical_concept_v1.0"^^xsd:anyURI ;
  sh:declare [
    sh:prefix "linkml" ;
    sh:namespace "https://w3id.org/linkml/"^^xsd:anyURI
  ] , [
    sh:prefix "cosmos_bc" ;
    sh:namespace "https://www.cdisc.org/cosmos/biomedical_concept_v1.0"^^xsd:anyURI
  ] , [
    sh:prefix "NCIT" ;
    sh:namespace "http://purl.obolibrary.org/obo/NCIT_"^^xsd:anyURI
  ] .

cosmos_bc:BiomedicalConcept a owl:Class ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:package_date ;
    owl:allValuesFrom xsd:date
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:package_date ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:package_type ;
    owl:allValuesFrom cosmos_bc:PackageTypeEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:package_type ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:ncit_code ;
    owl:allValuesFrom [
      a rdfs:Datatype ;
      owl:onDatatype xsd:string ;
      owl:withRestrictions ( _:o10 )
    ]
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:ncit_code ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:href ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:parent_concept_id ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:parent_concept_id ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:categories ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:categories ;
    owl:minCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:short_name ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:short_name ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:synonyms ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:result_scales ;
    owl:allValuesFrom cosmos_bc:BiomedicalConceptResultScaleEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:definition ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:definition ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:coding ;
    owl:allValuesFrom cosmos_bc:Coding
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:data_element_concepts ;
    owl:allValuesFrom cosmos_bc:DataElementConcept
  ] .

_:o10 xsd:pattern "(C[0-9]+)" .

cosmos_bc:Coding a owl:Class ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:code ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:code ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:system ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:system ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:system_name ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:system_name ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

cosmos_bc:DataElementConcept a owl:Class ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:ncit_code ;
    owl:allValuesFrom [
      a rdfs:Datatype ;
      owl:onDatatype xsd:string ;
      owl:withRestrictions ( _:o33 )
    ]
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:ncit_code ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:href ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:short_name ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:short_name ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:data_type ;
    owl:allValuesFrom cosmos_bc:DataElementConceptDataTypeEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:data_type ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty cosmos_bc:example_set ;
    owl:allValuesFrom xsd:string
  ] .

_:o33 xsd:pattern "(C[0-9]+)" .

cosmos_bc:ncit_code a owl:DatatypeProperty ;
  rdfs:comment "NCIt code" ;
  rdfs:range [
    a rdfs:Datatype ;
    owl:onDatatype xsd:string ;
    owl:withRestrictions ( _:o42 )
  ] ;
  a owl:FunctionalProperty .

_:o42 xsd:pattern "(C[0-9]+)" .

cosmos_bc:href a owl:ObjectProperty ;
  rdfs:comment "Link to NCIt for the Biomedical Concept" ;
  a owl:FunctionalProperty .

cosmos_bc:package_date a owl:DatatypeProperty ;
  rdfs:comment "Biomedical Concept package release date indicating when the BC package was published to production" ;
  rdfs:range xsd:date ;
  a owl:FunctionalProperty .

cosmos_bc:package_type a owl:ObjectProperty ;
  rdfs:comment "Package type (bc for Biomedical Concepts)" ;
  rdfs:range cosmos_bc:PackageTypeEnum ;
  a owl:FunctionalProperty .

cosmos_bc:categories a owl:DatatypeProperty ;
  rdfs:comment "Biomedical Concept category for the faciliation of API search and extract" ;
  rdfs:range xsd:string .

cosmos_bc:parent_concept_id a owl:DatatypeProperty ;
  rdfs:comment "C-code for the parent concept in the NCIt hiearchy; blank if concept is not available in NCIt" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

cosmos_bc:short_name a owl:DatatypeProperty ;
  rdfs:comment "NCI Preferred Name for the concept; provisional name will be used if concept is not available in NCIt" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

cosmos_bc:synonyms a owl:DatatypeProperty ;
  rdfs:comment "Biomedical Concept synonym equivalent to BC short name for the facilitation of API search and extraction" ;
  rdfs:range xsd:string .

cosmos_bc:result_scales a owl:ObjectProperty ;
  rdfs:comment "Scale of measurement for the Biomedical Concept result" ;
  rdfs:range cosmos_bc:BiomedicalConceptResultScaleEnum .

cosmos_bc:definition a owl:DatatypeProperty ;
  rdfs:comment "NCIt definition for the Biomedical Concept; provisional defintion if concept is not available in NCIt" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

cosmos_bc:coding a owl:ObjectProperty ;
  rdfs:comment "Coding for the Biomedical Concept" ;
  rdfs:range cosmos_bc:Coding .

cosmos_bc:system a owl:DatatypeProperty ;
  rdfs:comment "Identifies the code system for the synonym concept. The URL of the code system should be used if it exists" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

cosmos_bc:system_name a owl:DatatypeProperty ;
  rdfs:comment "Human-readable name for the code system" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

cosmos_bc:code a owl:DatatypeProperty ;
  rdfs:comment "Synonym concept for the Biomedical Concept as defined in a code system" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

cosmos_bc:data_element_concepts a owl:ObjectProperty ;
  rdfs:comment "Data Element Concept" ;
  rdfs:range cosmos_bc:DataElementConcept .

cosmos_bc:data_type a owl:ObjectProperty ;
  rdfs:comment "Data Type for the Data Element Concept" ;
  rdfs:range cosmos_bc:DataElementConceptDataTypeEnum ;
  a owl:FunctionalProperty .

cosmos_bc:example_set a owl:DatatypeProperty ;
  rdfs:comment "Example values for the Data Element Concept" ;
  rdfs:range xsd:string .

cosmos_bc:PackageTypeEnum a owl:Class ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( cosmos_bc:PackageTypeEnum.BC )
  ] .

cosmos_bc:PackageTypeEnum.BC a owl:NamedIndividual ;
  skos:notation "bc" ;
  a cosmos_bc:PackageTypeEnum .

cosmos_bc:BiomedicalConceptResultScaleEnum a owl:Class ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( cosmos_bc:BiomedicalConceptResultScaleEnum.ORDINAL cosmos_bc:BiomedicalConceptResultScaleEnum.NARRATIVE cosmos_bc:BiomedicalConceptResultScaleEnum.NOMINAL cosmos_bc:BiomedicalConceptResultScaleEnum.QUANTITATIVE cosmos_bc:BiomedicalConceptResultScaleEnum.TEMPORAL )
  ] .

cosmos_bc:BiomedicalConceptResultScaleEnum.ORDINAL a owl:NamedIndividual ;
  skos:notation "Ordinal" ;
  a cosmos_bc:BiomedicalConceptResultScaleEnum .

cosmos_bc:BiomedicalConceptResultScaleEnum.NARRATIVE a owl:NamedIndividual ;
  skos:notation "Narrative" ;
  a cosmos_bc:BiomedicalConceptResultScaleEnum .

cosmos_bc:BiomedicalConceptResultScaleEnum.NOMINAL a owl:NamedIndividual ;
  skos:notation "Nominal" ;
  a cosmos_bc:BiomedicalConceptResultScaleEnum .

cosmos_bc:BiomedicalConceptResultScaleEnum.QUANTITATIVE a owl:NamedIndividual ;
  skos:notation "Quantitative" ;
  a cosmos_bc:BiomedicalConceptResultScaleEnum .

cosmos_bc:BiomedicalConceptResultScaleEnum.TEMPORAL a owl:NamedIndividual ;
  skos:notation "Temporal" ;
  a cosmos_bc:BiomedicalConceptResultScaleEnum .

cosmos_bc:DataElementConceptDataTypeEnum a owl:Class ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( cosmos_bc:DataElementConceptDataTypeEnum.BOOLEAN cosmos_bc:DataElementConceptDataTypeEnum.DATE cosmos_bc:DataElementConceptDataTypeEnum.DATETIME cosmos_bc:DataElementConceptDataTypeEnum.DECIMAL cosmos_bc:DataElementConceptDataTypeEnum.DURATION cosmos_bc:DataElementConceptDataTypeEnum.FLOAT cosmos_bc:DataElementConceptDataTypeEnum.INTEGER cosmos_bc:DataElementConceptDataTypeEnum.STRING cosmos_bc:DataElementConceptDataTypeEnum.URI )
  ] .

cosmos_bc:DataElementConceptDataTypeEnum.BOOLEAN a owl:NamedIndividual ;
  skos:notation "boolean" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.DATE a owl:NamedIndividual ;
  skos:notation "date" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.DATETIME a owl:NamedIndividual ;
  skos:notation "datetime" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.DECIMAL a owl:NamedIndividual ;
  skos:notation "decimal" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.DURATION a owl:NamedIndividual ;
  skos:notation "duration" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.FLOAT a owl:NamedIndividual ;
  skos:notation "float" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.INTEGER a owl:NamedIndividual ;
  skos:notation "integer" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.STRING a owl:NamedIndividual ;
  skos:notation "string" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

cosmos_bc:DataElementConceptDataTypeEnum.URI a owl:NamedIndividual ;
  skos:notation "uri" ;
  a cosmos_bc:DataElementConceptDataTypeEnum .

vann:preferredNamespacePrefix a owl:AnnotationProperty .

vann:preferredNamespaceUri a owl:AnnotationProperty .

skos:notation a owl:AnnotationProperty .

sh:declare a owl:AnnotationProperty .

sh:prefix a owl:AnnotationProperty .

sh:namespace a owl:AnnotationProperty .

xsd:date a rdfs:Datatype .
