@prefix af-p: <http://purl.allotrope.org/ontologies/process#> .
@prefix af-r: <http://purl.allotrope.org/ontologies/result#> .
@prefix af-s: <http://purl.allotrope.org/shape/> .
@prefix af-x: <http://purl.allotrope.org/ontologies/property#> .
@prefix bfo: <http://purl.obolibrary.org/obo/BFO> .
@prefix dct: <http://purl.org/dc/terms/> .
@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 sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

af-s:AFS_0000467 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD-MS data processing shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "An SQD-MS data processing CAN have subprocesses of integration, data extraction, data transformation with background correction and averaging." ;
    sh:property [ sh:message "An SQD-MS data processing CAN have integration as subprocess that SHOULD have exactly 1 selected ion chromatogram as input AND exactly 1 peak list as output." ;
            sh:path bfo:_0000117 ;
            sh:qualifiedMinCount 0 ;
            sh:qualifiedValueShape [ sh:class af-p:AFP_0000970 ;
                    sh:message "It MUST be integration that SHOULD have exactly 1 selected ion chromatogram as data input." ;
                    sh:property [ sh:path af-x:AFX_0000542 ;
                            sh:qualifiedMaxCount 1 ;
                            sh:qualifiedMinCount 1 ;
                            sh:qualifiedValueShape [ sh:class af-r:AFR_0000035 ;
                                    sh:message "It MUST be a selected ion chromatogram." ] ;
                            sh:qualifiedValueShapesDisjoint true ;
                            sh:severity sh:Warning ],
                        [ sh:path af-x:AFX_0000544 ;
                            sh:qualifiedMaxCount 1 ;
                            sh:qualifiedMinCount 1 ;
                            sh:qualifiedValueShape [ sh:class af-r:AFR_0000432 ;
                                    sh:message "It MUST be a peak list." ] ;
                            sh:qualifiedValueShapesDisjoint true ;
                            sh:severity sh:Warning ] ] ;
            sh:qualifiedValueShapesDisjoint true ],
        [ sh:message "An SQD-MS data processing CAN have a data transformation as subprocess that SHOULD have exactly 1 result of a mass spectrometry scan as input AND exactly 1 mass spectrum as output. It SHOULD have averaging and background correction as subprocesses AND SHOULD conform to detailed constraints." ;
            sh:path bfo:_0000117 ;
            sh:qualifiedMinCount 0 ;
            sh:qualifiedValueShape af-s:AFS_0000498 ;
            sh:qualifiedValueShapesDisjoint true ],
        [ sh:message "An SQD-MS data processing CAN have a data extraction as subprocess that SHOULD have exactly 1 result of a mass spectrometry scan as input AND exactly 1 selected ion chromatogram as output." ;
            sh:path bfo:_0000117 ;
            sh:qualifiedMinCount 0 ;
            sh:qualifiedValueShape [ sh:class af-p:AFP_0003722 ;
                    sh:message "It MUST be data extraction that SHOULD have exactly 1 result of a mass spectrometry scan as input AND exactly 1 selected ion chromatogram as output." ;
                    sh:property [ sh:path af-x:AFX_0000544 ;
                            sh:qualifiedMaxCount 1 ;
                            sh:qualifiedMinCount 1 ;
                            sh:qualifiedValueShape [ sh:class af-r:AFR_0000035 ;
                                    sh:message "It MUST be a selected ion chromatogram." ] ;
                            sh:qualifiedValueShapesDisjoint true ;
                            sh:severity sh:Warning ],
                        [ sh:path af-x:AFX_0000542 ;
                            sh:qualifiedMaxCount 1 ;
                            sh:qualifiedMinCount 1 ;
                            sh:qualifiedValueShape af-s:AFS_0000521 ;
                            sh:qualifiedValueShapesDisjoint true ;
                            sh:severity sh:Warning ] ] ;
            sh:qualifiedValueShapesDisjoint true ] ;
    sh:targetClass af-p:AFP_0002089 .

af-s:AFS_0000514 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD fingerprinting shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "A well-formed Allotrope fingerprinting SHOULD have a reference mass spectrum AND a mass spectrum as data input AND SHOULD have a search result as data output. Reference mass spectrum and search result SHOULD conform to detailed constraints." ;
    sh:property [ sh:class af-r:AFR_0000439 ;
            sh:maxCount 2 ;
            sh:message "It SHOULD have exactly two data inputs of mass spectrum." ;
            sh:minCount 2 ;
            sh:path af-x:AFX_0000542 ;
            sh:severity sh:Warning ],
        [ sh:message "It SHOULD have a data input of exactly one reference mass spectrum." ;
            sh:path af-x:AFX_0000542 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000515 ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ],
        [ sh:message "It SHOULD have a data output of library search result." ;
            sh:path af-x:AFX_0000544 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape [ sh:class af-r:AFR_0001953 ] ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ] ;
    sh:severity sh:Warning ;
    sh:targetClass af-p:AFP_0002691 .

af-s:AFS_0000516 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "Spectral library search result shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "A well-formed Allotrope spectral library search result MUST have exactly 1 facet of reference mass spectrum AND 1 facet of analyte hit quality index. It CAN be described by a description." ;
    sh:property [ sh:message "It MUST have exactly 1 facet of reference mass spectrum." ;
            sh:path af-x:AFX_0002803 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000515 ],
        [ sh:message "It MUST have exactly 1 facet of analyte hit quality index that describes exactly 1 reference spectrum." ;
            sh:path af-x:AFX_0002803 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape [ sh:class af-r:AFR_0001613 ] ;
            sh:qualifiedValueShapesDisjoint true ],
        af-s:AFS_0000198 ;
    sh:targetClass af-p:AFP_0001953 .

af-s:AFS_0000526 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD-MS data processing shape with id" ;
    sh:and ( af-s:AFS_0000001 af-s:AFS_0000465 ) ;
    sh:message "An SQD-MS data processing SHOULD have an identifier." ;
    sh:severity sh:Warning ;
    sh:targetClass af-p:AFP_0002089 .

af-s:AFS_0000498 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD data transformation shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:class af-r:AFR_0003598 ;
    sh:message "An SQD-MS data transformation MUST have exactly 1 unprocessed mass spectrum as data input AND 1 processed mass spectrum as data output. It SHOULD have subprocesses of averaging and background correction." ;
    sh:property [ sh:path af-x:AFX_0000542 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000491 ;
            sh:qualifiedValueShapesDisjoint true ],
        [ sh:path af-x:AFX_0000544 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000495 ;
            sh:qualifiedValueShapesDisjoint true ],
        [ sh:path bfo:_0000117 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000499 ;
            sh:qualifiedValueShapesDisjoint true ],
        [ sh:path bfo:_0000117 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000501 ;
            sh:qualifiedValueShapesDisjoint true ] .

af-s:AFS_0000499 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD averaging shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:class af-r:AFR_0003657 ;
    sh:message "It MUST be averaging that MUST have a time range as data input." ;
    sh:property [ sh:path af-x:AFX_0000542 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000506 ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ] .

af-s:AFS_0000501 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD background correction shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:class af-p:AFP_0003721 ;
    sh:message "It MUST be background correction that SHOULD have pre- AND post-peak background time measurement ranges as data inputs." ;
    sh:property [ sh:path af-x:AFX_0000542 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000502 ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ],
        [ sh:path af-x:AFX_0000542 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000503 ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ] .

af-s:AFS_0000502 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD pre-peak background time measurement range shape" ;
    sh:and ( af-s:AFS_0000505 ),
        ( af-s:AFS_0000001 ) ;
    sh:class af-r:AFR_0001961 ;
    sh:message "It MUST be pre-peak background time measurement range that MUST have a time range." .

af-s:AFS_0000503 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "SQD post-peak background time measurement range shape" ;
    sh:and ( af-s:AFS_0000505 ),
        ( af-s:AFS_0000001 ) ;
    sh:class af-r:AFR_0001962 ;
    sh:message "It MUST be post-peak background time measurement range that MUST have a time range." .

af-s:AFS_0000521 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    skos:prefLabel "result of MS scan shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:class af-r:AFR_0000761 ;
    sh:message "It MUST be a result of a mass spectrometry scan." ;
    sh:property [ sh:class af-p:AFP_0002515 ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:path [ sh:inversePath af-x:AFX_0000544 ] ] .

<http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> a owl:Ontology ;
    dct:description "Main module of the Allotrope SQD-MS Data Processing Shape library." ;
    dct:license <http://purl.allotrope.org/voc/creative-commons-attribution-license> ;
    dct:publisher <http://www.allotrope.org> ;
    dct:rights <http://purl.allotrope.org/voc/attribution>,
        <http://purl.allotrope.org/voc/copyright> ;
    dct:title "Allotrope SQD-MS Data Processing Shape Library - (CR/2024/12)" ;
    owl:imports <http://purl.allotrope.org/shapes/adm/core/REC/2021/12/prefix.shacl>,
        <http://purl.allotrope.org/shapes/adm/core/REC/2022/06/common.shapes>,
        <http://purl.allotrope.org/shapes/adm/core/REC/2022/06/datum.shapes>,
        <http://purl.allotrope.org/shapes/adm/core/REC/2022/06/description.shapes>,
        <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-mass-spectrum.shapes>,
        sh: ;
    owl:priorVersion <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2020/09/sqd-ms-data-processing.shapes> ;
    owl:versionIRI <http://purl.allotrope.org/shapes/adm/sqd-ms/CR/2024/12/sqd-ms-data-processing.shapes> ;
    owl:versionInfo "CR/2024/12" ;
    skos:prefLabel "SQD-MS data processing shapes" .

