@prefix af-e: <http://purl.allotrope.org/ontologies/equipment#> .
@prefix af-m: <http://purl.allotrope.org/ontologies/material#> .
@prefix af-p: <http://purl.allotrope.org/ontologies/process#> .
@prefix af-rl: <http://purl.allotrope.org/ontologies/role#> .
@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 ro: <http://purl.obolibrary.org/obo/RO> .
@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_0000432 a sh:PropertyShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> ;
    skos:prefLabel "LCUV can have injection" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "An LCUV process MUST have as an occurrent part at least 1 injection process." ;
    sh:name "LCUV must have injection" ;
    sh:path bfo:_0000117 ;
    sh:qualifiedMinCount 1 ;
    sh:qualifiedValueShape [ sh:class af-p:AFP_0001611 ] ;
    sh:qualifiedValueShapesDisjoint true .

af-s:AFS_0000433 a sh:PropertyShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> ;
    skos:prefLabel "LCUV results with injection" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "An LCUV process SHOULD have as an occurrent part exactly 1 injection process." ;
    sh:name "LCUV results with injection" ;
    sh:path bfo:_0000117 ;
    sh:qualifiedMaxCount 1 ;
    sh:qualifiedMinCount 1 ;
    sh:qualifiedValueShape [ sh:class af-p:AFP_0001611 ] ;
    sh:qualifiedValueShapesDisjoint true ;
    sh:severity sh:Warning .

af-s:AFS_0000434 a sh:PropertyShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> ;
    skos:prefLabel "LCUV can have mobile phase delivery" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "An LCUV process CAN have a mobile phase delivery as occurrent part." ;
    sh:name "LCUV can have mobile phase delivery" ;
    sh:path bfo:_0000117 ;
    sh:qualifiedMinCount 0 ;
    sh:qualifiedValueShape [ sh:class af-p:AFP_0003289 ] ;
    sh:qualifiedValueShapesDisjoint true .

af-s:AFS_0000435 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> ;
    skos:prefLabel "LCUV core process shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "An LCUV process MUST have exactly 1 LCUV system as participant. It SHOULD have at least 1 identifier. It SHOULD have exactly 1 material input with the role of experiment sample." ;
    sh:name "LCUV core process shape" ;
    sh:property [ sh:message "An LCUV process SHOULD have as a material input exactly 1 material entity with the role of experiment sample." ;
            sh:path af-x:AFX_0000696 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000382 ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ],
        [ sh:message "An LCUV process MUST have as a participant exactly 1 LCUV system." ;
            sh:path ro:_0000057 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape [ sh:class af-e:AFE_0000224 ] ;
            sh:qualifiedValueShapesDisjoint true ],
        [ sh:message "An LCUV process SHOULD be identified by at least 1 identifier." ;
            sh:path [ sh:inversePath af-x:AFX_0002717 ] ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape af-s:AFS_0000020 ;
            sh:qualifiedValueShapesDisjoint true ;
            sh:severity sh:Warning ] .

af-s:AFS_0000459 a sh:NodeShape ;
    rdfs:isDefinedBy <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> ;
    skos:prefLabel "LCUV submitting shape" ;
    sh:and ( af-s:AFS_0000001 ) ;
    sh:message "An LCUV submitting MUST have exactly 1 person as participant that MUST have a role of submitter. It MUST have exactly 1 material input and the same material as output." ;
    sh:name "LCUV submitting shape" ;
    sh:property [ sh:class bfo:_0000040 ;
            sh:maxCount 1 ;
            sh:message "An LCUV submitting MUST have exactly 1 material input." ;
            sh:minCount 1 ;
            sh:path af-x:AFX_0000696 ],
        [ sh:class bfo:_0000040 ;
            sh:maxCount 1 ;
            sh:message "An LCUV submitting MUST have exactly 1 material output." ;
            sh:minCount 1 ;
            sh:path af-x:AFX_0000546 ],
        [ sh:message "An LCUV submitting MUST have as a participant exactly 1 submitter." ;
            sh:path ro:_0000057 ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape [ sh:and ( [ sh:class af-m:AFM_0001083 ;
                                sh:message "It MUST be a person with role of submitter." ;
                                sh:property [ sh:message "It MUST have role of submitter." ;
                                        sh:path ro:_0000087 ;
                                        sh:qualifiedMaxCount 1 ;
                                        sh:qualifiedMinCount 1 ;
                                        sh:qualifiedValueShape [ sh:class af-rl:AFRL_0000441 ;
                                                sh:message "It MUST be submitter role that is realized in a submitting process." ;
                                                sh:property [ sh:class af-p:AFP_0003646 ;
                                                        sh:maxCount 1 ;
                                                        sh:message "It MUST be realized in a submitting process." ;
                                                        sh:minCount 1 ;
                                                        sh:path bfo:_0000054 ] ] ;
                                        sh:qualifiedValueShapesDisjoint true ] ] [ sh:message "The person MUST have a submitter role realized in the same submitting process." ;
                                sh:sparql [ a sh:SPARQLConstraint ;
                                        sh:message "The person MUST have a submitter role realized in the same submitting process." ;
                                        sh:prefixes <http://purl.allotrope.org/shapes/adm/core/REC/2021/12/prefix.shacl> ;
                                        sh:select """
							SELECT $this WHERE {
								{
									$this rdf:type/rdfs:subClassOf* af-m:AFM_0001083 . # person
									$this ro:_0000087 ?role . # has role
									?role rdf:type/rdfs:subClassOf* af-rl:AFRL_0000441 . # submitter role
									?role bfo:_0000054 ?submitting1 . # realized in
									?submitting1 rdf:type/rdfs:subClassOf* af-p:AFP_0003646 . # submitting
									$this ^ro:_0000057 ?submitting2 . # inverse has participant
									?submitting2 rdf:type/rdfs:subClassOf* af-p:AFP_0003646 . # submitting
								}
								FILTER(?submitting1 != ?submitting2)
							}
						""" ] ] ) ;
                    sh:message "It MUST be a submitter in the same submitting process." ] ;
            sh:qualifiedValueShapesDisjoint true ] ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "The material input and output MUST be identical." ;
            sh:prefixes <http://purl.allotrope.org/shapes/adm/core/REC/2021/12/prefix.shacl> ;
            sh:select """
			SELECT $this WHERE {
				{
					$this af-x:AFX_0000696 ?material1 . # has material input
					$material1 rdf:type/rdfs:subClassOf* bfo:_0000040 . # material
					$this af-x:AFX_0000546 ?material2 . # has material output
					$material2 rdf:type/rdfs:subClassOf* bfo:_0000040 . # material
				}
				FILTER(?material1 != ?material2)
			}
		""" ] ;
    sh:targetClass af-p:AFP_0003646 .

<http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> a owl:Ontology ;
    dct:description "Core module of the Allotrope LC-UV Process 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 LC-UV Process Core Shape Library - (REC/2024/12)" ;
    owl:imports <http://purl.allotrope.org/shapes/adm/chromatography/REC/2022/06/chromatography-sampling.shapes>,
        <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/identifier.shapes>,
        <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-detection.shapes>,
        <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-injection.shapes>,
        <http://purl.allotrope.org/shapes/qudt/REC/2022/06/qudt.shapes>,
        <http://purl.allotrope.org/shapes/qudt/REC/2022/06/unit.shapes> ;
    owl:priorVersion <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2020/06/lc-uv-process-core.shapes> ;
    owl:versionIRI <http://purl.allotrope.org/shapes/adm/lc-uv/REC/2024/12/lc-uv-process-core.shapes> ;
    owl:versionInfo "REC/2024/12" ;
    skos:prefLabel "LC-UV process core shapes" .

