@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 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_0000514 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/REC/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/REC/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 ] ;
    sh:targetClass af-p:AFP_0001953 .

af-s:AFS_0000521 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/REC/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 ] ] .

af-s:AFS_0000526 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/sqd-ms/REC/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 .

<http://purl.allotrope.org/shapes/adm/sqd-ms/REC/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 - (REC/2024/12)" ;
    owl:imports <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/core/REC/2022/06/prefix.shapes>,
        <http://purl.allotrope.org/shapes/adm/sqd-ms/REC/2024/12/sqd-ms-mass-spectrum.shapes> ;
    owl:priorVersion <http://purl.allotrope.org/shapes/adm/sqd-ms/REC/2022/06/sqd-ms-data-processing.shapes> ;
    owl:versionIRI <http://purl.allotrope.org/shapes/adm/sqd-ms/REC/2024/12/sqd-ms-data-processing.shapes> ;
    owl:versionInfo "REC/2024/12" ;
    skos:prefLabel "SQD-MS data processing shapes" .

