PREFIX cell_annotation_schema: <https://cellular-semantics.sanger.ac.uk/ontology/CAS/>
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#>

cell_annotation_schema:Labelset a rdfs:Class .

rdfs:label a rdf:Property ;
  rdfs:comment "name of annotation key" , """This denotes any free-text term which the author uses to annotate cells, i.e. the preferred cell label name used by the author. Abbreviations are exceptable in this field; refer to 'cell_fullname' for related details. 
Certain key words have been reserved:
- `'doublets'` is reserved for encoding cells defined as doublets based on some computational analysis
- `'junk'` is reserved for encoding cells that failed sequencing for some reason, e.g. few genes detected, high fraction of mitochondrial reads
- `'unknown'` is explicitly reserved for unknown or 'author does not know'
- `'NA'` is incomplete, i.e. no cell annotation was provided""" ;
  rdfs:range xsd:string .

<http://purl.obolibrary.org/obo/IAO_0000115> a rdf:Property ;
  rdfs:comment "The description of the dataset. e.g. 'A total of 15 retinal ganglion cell clusters were identified from over 99K retinal ganglion cell nuclei in the current atlas. Utilizing previous characterized markers from macaque, 5 clusters can be annotated.'" , "Free-text review of annotation. This is required if the verdict is disagree and should include reasons for disagreement." ;
  rdfs:range xsd:string .

cell_annotation_schema:annotation_method a rdf:Property ;
  rdfs:comment "The method used for creating the cell annotations. This MUST be one of the following strings: `'algorithmic'`, `'manual'`, or `'both'`" ;
  rdfs:range cell_annotation_schema:AnnotationMethodOptions .

cell_annotation_schema:automated_annotation a rdf:Property ;
  rdfs:range cell_annotation_schema:AutomatedAnnotation .

<http://purl.obolibrary.org/obo/PCL_0010001> a rdfs:Class ;
  rdfs:comment "A collection of fields recording a cell type/class/state annotation on some set of cells, supporting evidence and provenance. As this is intended as a general schema, compulsory fields are kept to a minimum. However, tools using this schema are encouarged to specify a larger set of compulsory fields for publication.    Note: This schema deliberately allows for additional fields in order to support ad hoc user fields, new formal schema extensions and project/tool specific metadata." .

cell_annotation_schema:synonyms a rdf:Property ;
  rdfs:comment "List of synonyms" ;
  rdfs:range xsd:string .

cell_annotation_schema:has_cellid a rdf:Property ;
  rdfs:comment "Cell barcode sequences/UUIDs used to uniquely identify the cells within the AnnData/Seurat matrix. Any and all cell barcode sequences/UUIDs MUST be included in the AnnData/Seurat matrix." ;
  rdfs:range xsd:string .

cell_annotation_schema:has_labelset a rdf:Property ;
  rdfs:comment """The unique name of the set of cell annotations. 
Each cell within the AnnData/Seurat file MUST be associated with a 'cell_label' value in order for this to be a valid 'cellannotation_setname'.""" ;
  rdfs:range xsd:string .

cell_annotation_schema:author_annotation_fields a rdf:Property ;
  rdfs:comment "A dictionary of author defined key value pairs annotating the cell set. The names and aims of these fields MUST not clash with official annotation fields." ;
  rdfs:range <https://w3id.org/linkml/Any> .

<http://purl.obolibrary.org/obo/RO_0002473> a rdf:Property ;
  rdfs:comment """This MUST be a term from either the Cell Ontology (https://www.ebi.ac.uk/ols/ontologies/cl) or from some ontology that extends it by classifying cell types under terms from the Cell Ontology
e.g. the Provisional Cell Ontology (https://www.ebi.ac.uk/ols/ontologies/pcl) or the Drosophila Anatomy Ontology (DAO) (https://www.ebi.ac.uk/ols4/ontologies/fbbt).

NOTE: The closest available ontology term matching the value within the field 'cell_label' (at the time of publication) MUST be used.
For example, if the value of 'cell_label' is 'relay interneuron', but this entity does not yet exist in the ontology, users must choose the closest available term in the CL ontology. In this case, it's the broader term 'interneuron' i.e.  https://www.ebi.ac.uk/ols/ontologies/cl/terms?obo_id=CL:0000099.""" ;
  rdfs:range cell_annotation_schema:CellTypeEnum .

<http://www.w3.org/2004/02/skos/core#preflabel> a rdf:Property ;
  rdfs:comment """This MUST be the full-length name for the biological entity listed in `cell_label` by the author. (If the value in `cell_label` is the full-length term, this field will contain the same value.) 
NOTE: any reserved word used in the field 'cell_label' MUST match the value of this field. 

EXAMPLE 1: Given the matching terms 'LC' and 'luminal cell' used to annotate the same cell(s), then users could use either terms as values in the field 'cell_label'. However, the abbreviation 'LC' CANNOT be provided in the field 'cell_fullname'. 

EXAMPLE 2: Either the abbreviation 'AC' or the full-length term intended by the author 'GABAergic amacrine cell' MAY be placed in the field 'cell_label', but as full-length term naming this biological entity, 'GABAergic amacrine cell' MUST be placed in the field 'cell_fullname'.""" ;
  rdfs:range xsd:string .

cell_annotation_schema:rationale a rdf:Property ;
  rdfs:comment """The free-text rationale which users provide as justification/evidence for their cell annotations. 
Researchers are encouraged to use this field to cite relevant publications in-line using standard academic citations of the form `(Zheng et al., 2020)` This human-readable free-text MUST be encoded as a single string.
All references cited SHOULD be listed using DOIs under rationale_dois. There MUST be a 2000-character limit.""" ;
  rdfs:range xsd:string .

cell_annotation_schema:reviews a rdf:Property ;
  rdfs:range cell_annotation_schema:Review .

cell_annotation_schema:cell_ontology_term a rdf:Property ;
  rdfs:comment "This MUST be the human-readable name assigned to the value of 'cell_ontology_term_id'" ;
  rdfs:range xsd:string .

cell_annotation_schema:rationale_dois a rdf:Property ;
  rdfs:range xsd:string .

cell_annotation_schema:marker_gene_evidence a rdf:Property ;
  rdfs:comment "Gene names explicitly used as evidence, which MUST be in the matrix of the AnnData/Seurat file" ;
  rdfs:range xsd:string .

cell_annotation_schema:Review a rdfs:Class .

cell_annotation_schema:datestamp a rdf:Property ;
  rdfs:comment "Time and date review was last edited." ;
  rdfs:range xsd:string .

cell_annotation_schema:reviewer a rdf:Property ;
  rdfs:comment "Review Author" ;
  rdfs:range xsd:string .

cell_annotation_schema:review a rdf:Property ;
  rdfs:comment "Reviewer's verdict on the annotation.  Must be 'Agree' or 'Disagree'" ;
  rdfs:range cell_annotation_schema:ReviewOptions .

cell_annotation_schema:Taxonomy a rdfs:Class .

cell_annotation_schema:author_list a rdf:Property ;
  rdfs:comment "This field stores a list of users who are included in the project as collaborators, regardless of their specific role. An example list; '['John Smith', 'Cody Miller', 'Sarah Jones']'" ;
  rdfs:range xsd:string .

cell_annotation_schema:cellannotation_url a rdf:Property ;
  rdfs:comment "A persistent URL of all cell annotations published (per dataset)." ;
  rdfs:range xsd:string .

cell_annotation_schema:labelsets a rdf:Property ;
  rdfs:range cell_annotation_schema:Labelset .

cell_annotation_schema:matrix_file_id a rdf:Property ;
  rdfs:comment "A resolvable ID for a cell by gene matrix file in the form namespace:accession, e.g. CellXGene_dataset:8e10f1c4-8e98-41e5-b65f-8cd89a887122.  Please see https://github.com/cellannotation/cell-annotation-schema/registry/registry.json for supported namespaces." ;
  rdfs:range xsd:anyURI .

cell_annotation_schema:author_contact a rdf:Property ;
  rdfs:comment "Primary author's contact. This MUST be a valid email address of the author" ;
  rdfs:range xsd:string .

cell_annotation_schema:annotations a rdf:Property ;
  rdfs:range <http://purl.obolibrary.org/obo/PCL_0010001> .

cell_annotation_schema:cellannotation_timestamp a rdf:Property ;
  rdfs:comment "The timestamp of all cell annotations published (per dataset). This MUST be a string in the format `'%yyyy-%mm-%dd %hh:%mm:%ss'`" ;
  rdfs:range xsd:string .

cell_annotation_schema:title a rdf:Property ;
  rdfs:comment "The title of the dataset. This MUST be less than or equal to 200 characters. e.g. 'Human retina cell atlas - retinal ganglion cells'." ;
  rdfs:range xsd:string .

cell_annotation_schema:cellannotation_schema_version a rdf:Property ;
  rdfs:comment """The schema version, the cell annotation open standard. Current version MUST follow 0.1.0
This versioning MUST follow the format `'[MAJOR].[MINOR].[PATCH]'` as defined by Semantic Versioning 2.0.0, https://semver.org/""" ;
  rdfs:range xsd:string .

cell_annotation_schema:orcid a rdf:Property ;
  rdfs:comment "Primary author's orcid. This MUST be a valid ORCID for the author" ;
  rdfs:range xsd:string .

cell_annotation_schema:cellannotation_version a rdf:Property ;
  rdfs:comment "The version for all cell annotations published (per dataset). This MUST be a string. The recommended versioning format is `'[MAJOR].[MINOR].[PATCH]'` as defined by Semantic Versioning 2.0.0, https://semver.org/" ;
  rdfs:range xsd:string .

cell_annotation_schema:author_name a rdf:Property ;
  rdfs:comment "Primary author's name. This MUST be a string in the format `[FIRST NAME] [LAST NAME]`" ;
  rdfs:range xsd:string .

cell_annotation_schema:AutomatedAnnotation a rdfs:Class ;
  rdfs:comment "A set of fields for recording the details of the automated annotation algorithm used. (Common 'automated annotation methods' would include PopV, Azimuth, CellTypist, scArches, etc.)" .

cell_annotation_schema:algorithm_name a rdf:Property ;
  rdfs:comment "The name of the algorithm used. It MUST be a string of the algorithm's name." ;
  rdfs:range xsd:string .

cell_annotation_schema:algorithm_version a rdf:Property ;
  rdfs:comment "The version of the algorithm used (if applicable). It MUST be a string of the algorithm's version, which is typically in the format '[MAJOR].[MINOR]', but other versioning systems are permitted (based on the algorithm's versioning)." ;
  rdfs:range xsd:string .

cell_annotation_schema:algorithm_repo_url a rdf:Property ;
  rdfs:comment "This field denotes the URL of the version control repository associated with the algorithm used (if applicable). It MUST be a string of a valid URL." ;
  rdfs:range xsd:string .

cell_annotation_schema:reference_location a rdf:Property ;
  rdfs:comment """This field denotes a valid URL of the annotated dataset that was the source of annotated reference data. 
This MUST be a string of a valid URL. The concept of a 'reference' specifically refers to 'annotation transfer' algorithms, whereby a 'reference' dataset is used to transfer cell annotations to the 'query' dataset.""" ;
  rdfs:range xsd:string .

<https://w3id.org/linkml/Any> a rdfs:Class .

cell_annotation_schema:marker_gene_context a rdf:Property ;
  rdfs:comment """The context in which the marker genes given in the marker gene evidence field should be tested. Context should consist of a list of field_name:value.  Where field name = an obs field name.   The obs field name may be further broken down into labelset.field name, where a field is attached to a  specific labelset.
""" ;
  rdfs:range xsd:string .

cell_annotation_schema:CellTypeEnum a rdfs:Class .

cell_annotation_schema:AnnotationMethodOptions a rdfs:Class .

cell_annotation_schema:AnnotationMethodOptions.ALGORITHMIC a cell_annotation_schema:AnnotationMethodOptions .

cell_annotation_schema:AnnotationMethodOptions.BOTH a cell_annotation_schema:AnnotationMethodOptions .

cell_annotation_schema:AnnotationMethodOptions.MANUAL a cell_annotation_schema:AnnotationMethodOptions .

cell_annotation_schema:ReviewOptions a rdfs:Class .

cell_annotation_schema:ReviewOptions.AGREE a cell_annotation_schema:ReviewOptions .

cell_annotation_schema:ReviewOptions.DISAGREE a cell_annotation_schema:ReviewOptions .
