@prefix adms: <http://www.w3.org/ns/adms#> .
@prefix chemrof: <https://w3id.org/chemrof/> .
@prefix ciaaw: <https://hendrikborgelt.github.io/Draft_for_IUPAC_CIAAW-Isotopic-Abundances-and-Atomic-Weights/ciaaw-draft#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@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 shape: <https://hendrikborgelt.github.io/Draft_for_IUPAC_CIAAW-Isotopic-Abundances-and-Atomic-Weights/ciaaw-draft/shapes#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

shape:AbundanceIsAFraction a sh:NodeShape ;
    rdfs:label "Abundance is a fraction" ;
    sh:sparql [ sh:message "An isotopic abundance must lie between 0 and 1, found {?value}." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this ?value WHERE {
                $this ciaaw:value/(qudt:lowerBound|qudt:upperBound|qudt:numericValue) ?value .
                FILTER (?value < 0 || ?value > 1)
            }""" ] ;
    sh:targetClass ciaaw:IsotopicAbundanceDeclaration .

shape:AbundancesSumToOne a sh:NodeShape ;
    rdfs:label "Abundances of an element sum to 1" ;
    sh:severity sh:Warning ;
    sh:sparql [ sh:message "The current abundances sum to {?value}, expected 1 within 0.0005." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this ?value WHERE {
                {
                    SELECT $this (SUM(?amount) AS ?value) WHERE {
                        $this ciaaw:hasIsotope/ciaaw:currentAbundance/ciaaw:value/qudt:numericValue ?amount .
                    } GROUP BY $this
                }
                FILTER NOT EXISTS { $this ciaaw:hasIsotope/ciaaw:currentAbundance/ciaaw:value/qudt:lowerBound ?any }
                FILTER (ABS(?value - 1) > 0.0005)
            }""" ;
            sh:severity sh:Warning ] ;
    sh:targetClass chemrof:ChemicalElement .

shape:AtomicMassDeclaration a sh:NodeShape ;
    rdfs:label "Atomic mass declaration"@en ;
    sh:node shape:Declaration ;
    sh:property shape:AtomicMassDeclaration-ciaaw-ofIsotope,
        shape:AtomicMassDeclaration-ciaaw-value,
        shape:AtomicMassDeclaration-rdf-type ;
    sh:targetClass ciaaw:AtomicMassDeclaration .

shape:BoundsInOrder a sh:NodeShape ;
    rdfs:label "Bounds are in order" ;
    sh:property shape:BoundsInOrder-check ;
    sh:targetSubjectsOf qudt:lowerBound .

shape:ConventionalAtomicWeightDeclaration a sh:NodeShape ;
    rdfs:label "Conventional atomic weight declaration"@en ;
    sh:node shape:Declaration ;
    sh:property shape:ConventionalAtomicWeightDeclaration-ciaaw-ofElement,
        shape:ConventionalAtomicWeightDeclaration-ciaaw-value,
        shape:ConventionalAtomicWeightDeclaration-rdf-type ;
    sh:targetClass ciaaw:ConventionalAtomicWeightDeclaration .

shape:CurrentIsInHistory a sh:NodeShape ;
    rdfs:label "Current declaration is part of the history" ;
    sh:sparql [ sh:message "The current declaration {?value} is missing from ciaaw:hasDeclaration." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this ?value WHERE {
                $this ciaaw:currentStandardAtomicWeight|ciaaw:currentConventionalAtomicWeight|ciaaw:currentAbundance|ciaaw:currentAtomicMass ?value .
                FILTER NOT EXISTS { $this ciaaw:hasDeclaration ?value }
            }""" ] ;
    sh:targetClass chemrof:ChemicalElement,
        chemrof:Isotope .

shape:DeclarationPointsBack a sh:NodeShape ;
    rdfs:label "Declaration points back to its subject" ;
    sh:sparql [ sh:message "Declaration {?value} does not point back with ciaaw:ofElement or ciaaw:ofIsotope." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this ?value WHERE {
                $this ciaaw:hasDeclaration ?value .
                FILTER NOT EXISTS { ?value ciaaw:ofElement|ciaaw:ofIsotope $this }
            }""" ] ;
    sh:targetClass chemrof:ChemicalElement,
        chemrof:Isotope .

shape:DeprecationIsComplete a sh:NodeShape ;
    rdfs:label "Deprecation names a replacement and a status" ;
    sh:sparql [ sh:message "A deprecated declaration needs both dcterms:isReplacedBy and adms:status." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this WHERE {
                $this owl:deprecated true .
                FILTER (NOT EXISTS { $this dcterms:isReplacedBy ?new } || NOT EXISTS { $this adms:status ?status })
            }""" ] ;
    sh:targetSubjectsOf owl:deprecated .

shape:Element a sh:NodeShape ;
    rdfs:label "Chemical element"@en ;
    sh:property shape:Element-chemrof-atomic_number,
        shape:Element-chemrof-symbol,
        shape:Element-ciaaw-currentConventionalAtomicWeight,
        shape:Element-ciaaw-currentConventionalAtomicWeight-2,
        shape:Element-ciaaw-currentStandardAtomicWeight,
        shape:Element-ciaaw-currentStandardAtomicWeight-2,
        shape:Element-ciaaw-hasDeclaration,
        shape:Element-ciaaw-hasIsotope,
        shape:Element-ciaaw-longestLivedMassNumber,
        shape:Element-ciaaw-standardAtomicWeightLower,
        shape:Element-ciaaw-standardAtomicWeightUncertainty,
        shape:Element-ciaaw-standardAtomicWeightUpper,
        shape:Element-ciaaw-standardAtomicWeightValue,
        shape:Element-rdf-type,
        shape:Element-rdfs-label,
        shape:Element-skos-closeMatch ;
    sh:targetClass chemrof:ChemicalElement .

shape:Footnote a sh:NodeShape ;
    rdfs:label "Footnote"@en ;
    sh:property shape:Footnote-rdf-type,
        shape:Footnote-skos-definition,
        shape:Footnote-skos-notation ;
    sh:targetClass ciaaw:Footnote .

shape:Isotope a sh:NodeShape ;
    rdfs:label "Isotope"@en ;
    sh:property shape:Isotope-ciaaw-currentAbundance,
        shape:Isotope-ciaaw-currentAbundance-2,
        shape:Isotope-ciaaw-currentAtomicMass,
        shape:Isotope-ciaaw-currentAtomicMass-2,
        shape:Isotope-ciaaw-hasDeclaration,
        shape:Isotope-ciaaw-massNumber,
        shape:Isotope-rdf-type,
        shape:Isotope-skos-closeMatch ;
    sh:targetClass chemrof:Isotope .

shape:IsotopeBelongsToOneElement a sh:NodeShape ;
    rdfs:label "Isotope belongs to one element" ;
    sh:property shape:IsotopeBelongsToOneElement-check ;
    sh:targetClass chemrof:Isotope .

shape:IsotopicAbundanceDeclaration a sh:NodeShape ;
    rdfs:label "Isotopic abundance declaration"@en ;
    sh:node shape:Declaration ;
    sh:property shape:IsotopicAbundanceDeclaration-ciaaw-ofIsotope,
        shape:IsotopicAbundanceDeclaration-ciaaw-value,
        shape:IsotopicAbundanceDeclaration-rdf-type ;
    sh:targetClass ciaaw:IsotopicAbundanceDeclaration .

shape:ReplacementIsMutual a sh:NodeShape ;
    rdfs:label "Replacement links run both ways" ;
    sh:sparql [ sh:message "{?value} must link back with dcterms:replaces." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this ?value WHERE {
                $this dcterms:isReplacedBy ?value .
                FILTER NOT EXISTS { ?value dcterms:replaces $this }
            }""" ] ;
    sh:targetSubjectsOf dcterms:isReplacedBy .

shape:ShortcutsMatchCurrentDeclaration a sh:NodeShape ;
    rdfs:label "Derived shortcuts match the current declaration" ;
    sh:sparql [ sh:message "Derived shortcut {?value} differs from the current declaration." ;
            sh:prefixes shape:prefixes ;
            sh:select """
            SELECT $this ?value WHERE {
                {
                    $this ciaaw:standardAtomicWeightLower ?value .
                    FILTER NOT EXISTS {
                        $this ciaaw:currentStandardAtomicWeight/ciaaw:value/qudt:lowerBound ?original .
                        FILTER (?original = ?value)
                    }
                } UNION {
                    $this ciaaw:standardAtomicWeightUpper ?value .
                    FILTER NOT EXISTS {
                        $this ciaaw:currentStandardAtomicWeight/ciaaw:value/qudt:upperBound ?original .
                        FILTER (?original = ?value)
                    }
                } UNION {
                    $this ciaaw:standardAtomicWeightValue ?value .
                    FILTER NOT EXISTS {
                        $this ciaaw:currentStandardAtomicWeight/ciaaw:value/qudt:numericValue ?original .
                        FILTER (?original = ?value)
                    }
                } UNION {
                    $this ciaaw:standardAtomicWeightUncertainty ?value .
                    FILTER NOT EXISTS {
                        $this ciaaw:currentStandardAtomicWeight/ciaaw:value/qudt:standardUncertainty ?original .
                        FILTER (?original = ?value)
                    }
                }
            }""" ] ;
    sh:targetClass chemrof:ChemicalElement .

shape:StandardAtomicWeightDeclaration a sh:NodeShape ;
    rdfs:label "Standard atomic weight declaration"@en ;
    sh:node shape:Declaration ;
    sh:property shape:StandardAtomicWeightDeclaration-ciaaw-ofElement,
        shape:StandardAtomicWeightDeclaration-ciaaw-value,
        shape:StandardAtomicWeightDeclaration-rdf-type ;
    sh:targetClass ciaaw:StandardAtomicWeightDeclaration .

shape:UncertaintyIsPositive a sh:NodeShape ;
    rdfs:label "Uncertainty is positive" ;
    sh:property shape:UncertaintyIsPositive-check ;
    sh:targetSubjectsOf qudt:standardUncertainty .

shape:AtomicMassDeclaration-ciaaw-ofIsotope sh:class chemrof:Isotope ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "of isotope"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:ofIsotope .

shape:AtomicMassDeclaration-ciaaw-value sh:description "Not generated yet. The two source tables do not contain atomic masses."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:node shape:MassValue ;
    sh:nodeKind sh:BlankNode ;
    sh:path ciaaw:value .

shape:AtomicMassDeclaration-rdf-type sh:hasValue ciaaw:AtomicMassDeclaration ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:BoundsInOrder-check a sh:PropertyShape ;
    sh:lessThanOrEquals qudt:upperBound ;
    sh:message "The lower bound must not exceed the upper bound." ;
    sh:path qudt:lowerBound .

shape:ConventionalAtomicWeightDeclaration-ciaaw-ofElement sh:class chemrof:ChemicalElement ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "of element"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:ofElement .

shape:ConventionalAtomicWeightDeclaration-ciaaw-value sh:description "Not generated yet. The two source tables do not contain abridged values."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:node shape:SingleValue ;
    sh:nodeKind sh:BlankNode ;
    sh:path ciaaw:value .

shape:ConventionalAtomicWeightDeclaration-rdf-type sh:hasValue ciaaw:ConventionalAtomicWeightDeclaration ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:Declaration-adms-status sh:description "The ADMS status IRI still needs to be confirmed."@en ;
    sh:maxCount 1 ;
    sh:name "status"@en ;
    sh:nodeKind sh:IRI ;
    sh:path adms:status .

shape:Declaration-ciaaw-footnote sh:class ciaaw:Footnote ;
    sh:name "footnote"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:footnote .

shape:Declaration-dcterms-isReplacedBy sh:maxCount 1 ;
    sh:name "replaced by"@en ;
    sh:nodeKind sh:IRI ;
    sh:path dcterms:isReplacedBy ;
    sh:xone ( [ sh:class ciaaw:StandardAtomicWeightDeclaration ] [ sh:class ciaaw:ConventionalAtomicWeightDeclaration ] [ sh:class ciaaw:IsotopicAbundanceDeclaration ] [ sh:class ciaaw:AtomicMassDeclaration ] ) .

shape:Declaration-dcterms-issued sh:datatype xsd:gYear ;
    sh:description "Year of the assigning report."@en ;
    sh:maxCount 1 ;
    sh:name "year issued"@en ;
    sh:nodeKind sh:Literal ;
    sh:path dcterms:issued .

shape:Declaration-dcterms-replaces sh:maxCount 1 ;
    sh:name "replaces"@en ;
    sh:nodeKind sh:IRI ;
    sh:path dcterms:replaces ;
    sh:xone ( [ sh:class ciaaw:StandardAtomicWeightDeclaration ] [ sh:class ciaaw:ConventionalAtomicWeightDeclaration ] [ sh:class ciaaw:IsotopicAbundanceDeclaration ] [ sh:class ciaaw:AtomicMassDeclaration ] ) .

shape:Declaration-dcterms-source sh:description "DOI of the assigning report."@en ;
    sh:name "source"@en ;
    sh:nodeKind sh:IRI ;
    sh:path dcterms:source ;
    sh:pattern "^(https://doi\\.org/)" .

shape:Declaration-owl-deprecated sh:datatype xsd:boolean ;
    sh:description "True once a later declaration has replaced this one."@en ;
    sh:maxCount 1 ;
    sh:name "deprecated"@en ;
    sh:nodeKind sh:Literal ;
    sh:path owl:deprecated .

shape:Element-chemrof-atomic_number sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:minInclusive 1 ;
    sh:name "atomic number"@en ;
    sh:nodeKind sh:Literal ;
    sh:path chemrof:atomic_number .

shape:Element-chemrof-symbol sh:datatype xsd:string ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "symbol"@en ;
    sh:nodeKind sh:Literal ;
    sh:path chemrof:symbol ;
    sh:pattern "^[A-Z][a-z]{0,2}$" .

shape:Element-ciaaw-currentConventionalAtomicWeight sh:class ciaaw:ConventionalAtomicWeightDeclaration ;
    sh:maxCount 1 ;
    sh:name "current conventional atomic weight"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentConventionalAtomicWeight .

shape:Element-ciaaw-currentConventionalAtomicWeight-2 sh:description "A current pointer may never lead to a deprecated declaration."@en ;
    sh:maxCount 1 ;
    sh:name "current conventional atomic weight"@en ;
    sh:node shape:NotDeprecated ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentConventionalAtomicWeight .

shape:Element-ciaaw-currentStandardAtomicWeight sh:class ciaaw:StandardAtomicWeightDeclaration ;
    sh:description "Absent when the table gives no standard atomic weight."@en ;
    sh:maxCount 1 ;
    sh:name "current standard atomic weight"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentStandardAtomicWeight .

shape:Element-ciaaw-currentStandardAtomicWeight-2 sh:description "A current pointer may never lead to a deprecated declaration."@en ;
    sh:maxCount 1 ;
    sh:name "current standard atomic weight"@en ;
    sh:node shape:NotDeprecated ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentStandardAtomicWeight .

shape:Element-ciaaw-hasDeclaration sh:description "All declarations including deprecated ones."@en ;
    sh:name "declaration"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:hasDeclaration ;
    sh:xone ( [ sh:class ciaaw:StandardAtomicWeightDeclaration ] [ sh:class ciaaw:ConventionalAtomicWeightDeclaration ] ) .

shape:Element-ciaaw-hasIsotope sh:class chemrof:Isotope ;
    sh:name "isotope"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:hasIsotope .

shape:Element-ciaaw-longestLivedMassNumber sh:datatype xsd:integer ;
    sh:description "Elements without stable isotopes: the mass number bracketed in the table."@en ;
    sh:maxCount 1 ;
    sh:minInclusive 1 ;
    sh:name "longest-lived mass number"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:longestLivedMassNumber .

shape:Element-ciaaw-standardAtomicWeightLower sh:datatype xsd:decimal ;
    sh:description "Derived shortcut copied from the current declaration. Never edited by hand."@en ;
    sh:maxCount 1 ;
    sh:name "lower bound (derived)"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:standardAtomicWeightLower .

shape:Element-ciaaw-standardAtomicWeightUncertainty sh:datatype xsd:decimal ;
    sh:description "Derived shortcut."@en ;
    sh:maxCount 1 ;
    sh:name "uncertainty (derived)"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:standardAtomicWeightUncertainty .

shape:Element-ciaaw-standardAtomicWeightUpper sh:datatype xsd:decimal ;
    sh:description "Derived shortcut."@en ;
    sh:maxCount 1 ;
    sh:name "upper bound (derived)"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:standardAtomicWeightUpper .

shape:Element-ciaaw-standardAtomicWeightValue sh:datatype xsd:decimal ;
    sh:description "Derived shortcut."@en ;
    sh:maxCount 1 ;
    sh:name "value (derived)"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:standardAtomicWeightValue .

shape:Element-rdf-type sh:hasValue chemrof:ChemicalElement ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:Element-rdfs-label sh:datatype rdf:langString ;
    sh:description "Lower case as printed in the CIAAW tables. Further languages may be added."@en ;
    sh:minCount 1 ;
    sh:name "name"@en ;
    sh:nodeKind sh:Literal ;
    sh:path rdfs:label .

shape:Element-skos-closeMatch sh:description "Taken from the supplement. Never guessed."@en ;
    sh:name "ChEBI match"@en ;
    sh:nodeKind sh:IRI ;
    sh:path skos:closeMatch ;
    sh:pattern "^(http://purl\\.obolibrary\\.org/obo/CHEBI_)" .

shape:Footnote-rdf-type sh:hasValue ciaaw:Footnote ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:Footnote-skos-definition sh:datatype rdf:langString ;
    sh:description "As printed below the CIAAW tables."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "wording"@en ;
    sh:nodeKind sh:Literal ;
    sh:path skos:definition .

shape:Footnote-skos-notation sh:datatype xsd:string ;
    sh:in ( "g" "m" "r" ) ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "letter"@en ;
    sh:nodeKind sh:Literal ;
    sh:path skos:notation .

shape:IntervalValue-ciaaw-significantFiguresLower sh:datatype xsd:integer ;
    sh:description "Absent when the bound is zero."@en ;
    sh:maxCount 1 ;
    sh:minInclusive 1 ;
    sh:name "significant figures of the lower bound"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFiguresLower .

shape:IntervalValue-ciaaw-significantFiguresUpper sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minInclusive 1 ;
    sh:name "significant figures of the upper bound"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFiguresUpper .

shape:IntervalValue-qudt-hasUnit sh:hasValue unit:UNITLESS ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "unit"@en ;
    sh:nodeKind sh:IRI ;
    sh:path qudt:hasUnit .

shape:IntervalValue-qudt-lowerBound sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "lower bound"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:lowerBound .

shape:IntervalValue-qudt-upperBound sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "upper bound"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:upperBound .

shape:IntervalValue-rdf-type sh:hasValue qudt:QuantityValue ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:Isotope-ciaaw-currentAbundance sh:class ciaaw:IsotopicAbundanceDeclaration ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "current abundance"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentAbundance .

shape:Isotope-ciaaw-currentAbundance-2 sh:description "A current pointer may never lead to a deprecated declaration."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "current abundance"@en ;
    sh:node shape:NotDeprecated ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentAbundance .

shape:Isotope-ciaaw-currentAtomicMass sh:class ciaaw:AtomicMassDeclaration ;
    sh:maxCount 1 ;
    sh:name "current atomic mass"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentAtomicMass .

shape:Isotope-ciaaw-currentAtomicMass-2 sh:description "A current pointer may never lead to a deprecated declaration."@en ;
    sh:maxCount 1 ;
    sh:name "current atomic mass"@en ;
    sh:node shape:NotDeprecated ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:currentAtomicMass .

shape:Isotope-ciaaw-hasDeclaration sh:description "All declarations including deprecated ones."@en ;
    sh:minCount 1 ;
    sh:name "declaration"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:hasDeclaration ;
    sh:xone ( [ sh:class ciaaw:IsotopicAbundanceDeclaration ] [ sh:class ciaaw:AtomicMassDeclaration ] ) .

shape:Isotope-ciaaw-massNumber sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:minInclusive 1 ;
    sh:name "mass number"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:massNumber .

shape:Isotope-rdf-type sh:hasValue chemrof:Isotope ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:Isotope-skos-closeMatch sh:description "Taken from the supplement. Never guessed."@en ;
    sh:name "ChEBI match"@en ;
    sh:nodeKind sh:IRI ;
    sh:path skos:closeMatch ;
    sh:pattern "^(http://purl\\.obolibrary\\.org/obo/CHEBI_)" .

shape:IsotopeBelongsToOneElement-check a sh:PropertyShape ;
    sh:maxCount 1 ;
    sh:message "An isotope must belong to exactly one element." ;
    sh:minCount 1 ;
    sh:path [ sh:inversePath ciaaw:hasIsotope ] .

shape:IsotopicAbundanceDeclaration-ciaaw-ofIsotope sh:class chemrof:Isotope ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "of isotope"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:ofIsotope .

shape:IsotopicAbundanceDeclaration-ciaaw-value sh:description "Amount fraction between 0 and 1."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:nodeKind sh:BlankNode ;
    sh:path ciaaw:value ;
    sh:xone ( shape:IntervalValue shape:ValueWithUncertainty shape:SingleValue ) .

shape:IsotopicAbundanceDeclaration-rdf-type sh:hasValue ciaaw:IsotopicAbundanceDeclaration ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:MassValue a sh:NodeShape ;
    rdfs:label "Mass with uncertainty"@en ;
    sh:closed true ;
    sh:property shape:MassValue-ciaaw-significantFigures,
        shape:MassValue-ciaaw-significantFiguresUncertainty,
        shape:MassValue-qudt-hasUnit,
        shape:MassValue-qudt-numericValue,
        shape:MassValue-qudt-standardUncertainty,
        shape:MassValue-rdf-type .

shape:MassValue-ciaaw-significantFigures sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:minInclusive 1 ;
    sh:name "significant figures"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFigures .

shape:MassValue-ciaaw-significantFiguresUncertainty sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:minInclusive 1 ;
    sh:name "digits of the uncertainty"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFiguresUncertainty .

shape:MassValue-qudt-hasUnit sh:hasValue unit:DA ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "unit"@en ;
    sh:nodeKind sh:IRI ;
    sh:path qudt:hasUnit .

shape:MassValue-qudt-numericValue sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:numericValue .

shape:MassValue-qudt-standardUncertainty sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "uncertainty"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:standardUncertainty .

shape:MassValue-rdf-type sh:hasValue qudt:QuantityValue ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:NotDeprecated-owl-deprecated sh:datatype xsd:boolean ;
    sh:description "Helper shape: owl:deprecated is absent or false."@en ;
    sh:in ( false ) ;
    sh:maxCount 1 ;
    sh:name "deprecated"@en ;
    sh:nodeKind sh:Literal ;
    sh:path owl:deprecated .

shape:SingleValue-ciaaw-significantFigures sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minInclusive 1 ;
    sh:name "significant figures"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFigures .

shape:SingleValue-qudt-hasUnit sh:hasValue unit:UNITLESS ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "unit"@en ;
    sh:nodeKind sh:IRI ;
    sh:path qudt:hasUnit .

shape:SingleValue-qudt-numericValue sh:datatype xsd:decimal ;
    sh:description "Stated without an uncertainty."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:numericValue .

shape:SingleValue-rdf-type sh:hasValue qudt:QuantityValue ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:StandardAtomicWeightDeclaration-ciaaw-ofElement sh:class chemrof:ChemicalElement ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "of element"@en ;
    sh:nodeKind sh:IRI ;
    sh:path ciaaw:ofElement .

shape:StandardAtomicWeightDeclaration-ciaaw-value sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:nodeKind sh:BlankNode ;
    sh:path ciaaw:value ;
    sh:xone ( shape:IntervalValue shape:ValueWithUncertainty shape:SingleValue ) .

shape:StandardAtomicWeightDeclaration-rdf-type sh:hasValue ciaaw:StandardAtomicWeightDeclaration ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:UncertaintyIsPositive-check a sh:PropertyShape ;
    sh:message "A standard uncertainty must be greater than zero." ;
    sh:minExclusive 0 ;
    sh:path qudt:standardUncertainty .

shape:ValueWithUncertainty-ciaaw-significantFigures sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:minInclusive 1 ;
    sh:name "significant figures"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFigures .

shape:ValueWithUncertainty-ciaaw-significantFiguresUncertainty sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:minInclusive 1 ;
    sh:name "digits of the uncertainty"@en ;
    sh:nodeKind sh:Literal ;
    sh:path ciaaw:significantFiguresUncertainty .

shape:ValueWithUncertainty-qudt-hasUnit sh:hasValue unit:UNITLESS ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "unit"@en ;
    sh:nodeKind sh:IRI ;
    sh:path qudt:hasUnit .

shape:ValueWithUncertainty-qudt-numericValue sh:datatype xsd:decimal ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "value"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:numericValue .

shape:ValueWithUncertainty-qudt-standardUncertainty sh:datatype xsd:decimal ;
    sh:description "Scaled from the digits in brackets in the table."@en ;
    sh:maxCount 1 ;
    sh:minCount 1 ;
    sh:name "uncertainty"@en ;
    sh:nodeKind sh:Literal ;
    sh:path qudt:standardUncertainty .

shape:ValueWithUncertainty-rdf-type sh:hasValue qudt:QuantityValue ;
    sh:minCount 1 ;
    sh:name "type"@en ;
    sh:nodeKind sh:IRI ;
    sh:path rdf:type .

shape:IntervalValue a sh:NodeShape ;
    rdfs:label "Interval"@en ;
    sh:closed true ;
    sh:property shape:IntervalValue-ciaaw-significantFiguresLower,
        shape:IntervalValue-ciaaw-significantFiguresUpper,
        shape:IntervalValue-qudt-hasUnit,
        shape:IntervalValue-qudt-lowerBound,
        shape:IntervalValue-qudt-upperBound,
        shape:IntervalValue-rdf-type .

shape:ValueWithUncertainty a sh:NodeShape ;
    rdfs:label "Value with uncertainty"@en ;
    sh:closed true ;
    sh:property shape:ValueWithUncertainty-ciaaw-significantFigures,
        shape:ValueWithUncertainty-ciaaw-significantFiguresUncertainty,
        shape:ValueWithUncertainty-qudt-hasUnit,
        shape:ValueWithUncertainty-qudt-numericValue,
        shape:ValueWithUncertainty-qudt-standardUncertainty,
        shape:ValueWithUncertainty-rdf-type .

shape:SingleValue a sh:NodeShape ;
    rdfs:label "Single value"@en ;
    sh:closed true ;
    sh:property shape:SingleValue-ciaaw-significantFigures,
        shape:SingleValue-qudt-hasUnit,
        shape:SingleValue-qudt-numericValue,
        shape:SingleValue-rdf-type .

shape:Declaration a sh:NodeShape ;
    rdfs:label "Declaration"@en ;
    sh:property shape:Declaration-adms-status,
        shape:Declaration-ciaaw-footnote,
        shape:Declaration-dcterms-isReplacedBy,
        shape:Declaration-dcterms-issued,
        shape:Declaration-dcterms-replaces,
        shape:Declaration-dcterms-source,
        shape:Declaration-owl-deprecated .

shape:NotDeprecated a sh:NodeShape ;
    rdfs:label "Not deprecated"@en ;
    sh:property shape:NotDeprecated-owl-deprecated .

shape:prefixes a owl:Ontology ;
    sh:declare [ sh:namespace "https://hendrikborgelt.github.io/Draft_for_IUPAC_CIAAW-Isotopic-Abundances-and-Atomic-Weights/ciaaw-draft#"^^xsd:anyURI ;
            sh:prefix "ciaaw" ],
        [ sh:namespace "http://purl.org/dc/terms/"^^xsd:anyURI ;
            sh:prefix "dcterms" ],
        [ sh:namespace "http://www.w3.org/2002/07/owl#"^^xsd:anyURI ;
            sh:prefix "owl" ],
        [ sh:namespace "http://www.w3.org/ns/adms#"^^xsd:anyURI ;
            sh:prefix "adms" ],
        [ sh:namespace "http://qudt.org/schema/qudt/"^^xsd:anyURI ;
            sh:prefix "qudt" ] .

