@prefix re: <https://ontology.inferal.com/modules/commerce-refund-evidence/> .
@prefix ctx: <https://ontology.inferal.com/modules/commerce-transaction/> .
@prefix rng: <https://ontology.inferal.com/modules/range/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix mod: <https://w3id.org/mod#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix pubacc: <https://ontology.inferal.com/modules/publication-access/> .
re:CohortShape a sh:NodeShape ;
 sh:targetClass re:Cohort ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:policy ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:placementWindow ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:cutoff ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:selectionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:orderSelectionCoverageEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:selectedOrder ; sh:minCount 0 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:cutoffInclusive ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ] ;
 sh:property [ sh:path re:orderSelectionCompleteness ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:DeclaredComplete re:DeclaredPartial re:Unassessed) ] ;
 sh:property [ sh:path re:revisionStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:hasValue re:SelectedRepresentation ] .
re:EligibilityPolicyShape a sh:NodeShape ;
 sh:targetClass re:EligibilityPolicy ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:policyEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:currencySupportEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:signedValueEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:prePurchaseEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:orderNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:refundNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:policyVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:denominatorBasis ; sh:minCount 1 ; sh:maxCount 1 ; sh:hasValue re:FullBuyerCharge ] ;
 sh:property [ sh:path re:identityStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:hasValue re:SuppliedDeclaration ] ;
 sh:property [ sh:path re:allowSigned ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ] ;
 sh:property [ sh:path re:allowPrePurchase ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ] ;
 sh:property [ sh:path re:recognisedPayment ; sh:minCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:recognisedLifecycle ; sh:minCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:admittedPayment ; sh:minCount 0 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:admittedLifecycle ; sh:minCount 0 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:supportedCurrency ; sh:minCount 1 ; sh:datatype xsd:string ; sh:pattern "^[A-Z]{3}$" ] .
re:OrderBindingShape a sh:NodeShape ;
 sh:targetClass re:OrderBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceOrder ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:nativeKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:nativeNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:identityEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] .
re:SelectedOrderBindingShape a sh:NodeShape ;
 sh:targetClass re:SelectedOrderBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceOrder ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:nativeKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:nativeNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:identityEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] .
re:UnselectedOrderBindingShape a sh:NodeShape ;
 sh:targetClass re:UnselectedOrderBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceOrder ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:nativeKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:nativeNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:identityEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:repeatsBinding ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionInterpretation ; sh:minCount 1 ; sh:maxCount 1 ; sh:hasValue re:RepeatedObservation ] .
re:RefundBindingShape a sh:NodeShape ;
 sh:targetClass re:RefundBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceRefund ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:nativeKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:nativeNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:identityEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] .
re:SelectedRefundBindingShape a sh:NodeShape ;
 sh:targetClass re:SelectedRefundBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceRefund ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:nativeKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:nativeNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:identityEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] .
re:UnselectedRefundBindingShape a sh:NodeShape ;
 sh:targetClass re:UnselectedRefundBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceRefund ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:nativeKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:nativeNamespace ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:merchantScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:identityEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:repeatsBinding ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:revisionInterpretation ; sh:minCount 1 ; sh:maxCount 1 ; sh:hasValue re:RepeatedObservation ] .
re:HistoryDeclarationShape a sh:NodeShape ;
 sh:targetClass re:HistoryDeclaration ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceOrder ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:historyStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:DeclaredComplete re:DeclaredPartial re:Unassessed) ] ;
 sh:property [ sh:path re:historyEvidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:cutoff ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:cutoffInclusive ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ] .
re:AssessmentShape a sh:NodeShape ;
 sh:targetClass re:Assessment ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceRecord ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:cohort ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:policy ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:sourceGraph ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:reason ; sh:minCount 0 ; sh:nodeKind sh:IRI ] .
re:OrderAssessmentShape a sh:NodeShape ;
 sh:targetClass re:OrderAssessment ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:orderEligibility ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:Eligible re:Excluded re:Unassessed re:OutsideCohort) ] ;
 sh:property [ sh:path re:identityStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:DeclaredSelected re:DeclaredUnselected re:Unassessed) ] ;
 sh:property [ sh:path re:chargeStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:Comparable re:Unassessed) ] ;
 sh:property [ sh:path re:historyStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:DeclaredComplete re:DeclaredPartial re:Unassessed) ] ;
 sh:property [ sh:path re:numeratorStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:DeclaredComplete re:DeclaredPartial re:Unassessed) ] ;
 sh:property [ sh:path re:foundOrder ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ] ;
 sh:property [ sh:path re:qualifiedCharge ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:decimal ] ;
 sh:property [ sh:path re:currency ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[A-Z]{3}$" ] .
re:OrderAssessmentShape sh:node re:AssessmentShape .
re:RefundAssessmentShape a sh:NodeShape ;
 sh:targetClass re:RefundAssessment ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:refundEligibility ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:Eligible re:Excluded re:Unassessed re:OutsideCohort) ] ;
 sh:property [ sh:path re:identityStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:DeclaredSelected re:DeclaredUnselected re:Unassessed) ] ;
 sh:property [ sh:path re:moneyStanding ; sh:minCount 1 ; sh:maxCount 1 ; sh:in (re:Comparable re:Unassessed) ] ;
 sh:property [ sh:path re:sourceOwner ; sh:minCount 0 ; sh:nodeKind sh:BlankNodeOrIRI ] ;
 sh:property [ sh:path re:qualifiedRefund ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:decimal ] ;
 sh:property [ sh:path re:currency ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[A-Z]{3}$" ] .
re:RefundAssessmentShape sh:node re:AssessmentShape .
re:CohortAssessmentShape a sh:NodeShape ;
 sh:targetClass re:CohortAssessment ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:currency ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[A-Z]{3}$" ] .
re:CohortAssessmentShape sh:node re:AssessmentShape .
re:ExecutionContextShape a sh:NodeShape ;
 sh:targetClass re:ExecutionContext ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceGraph ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:selectionGraph ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:dictionaryGraph ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:assessmentGraph ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:cohort ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:sourceDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[0-9a-f]{64}$" ] ;
 sh:property [ sh:path re:selectionDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[0-9a-f]{64}$" ] ;
 sh:property [ sh:path re:packageDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[0-9a-f]{64}$" ] ;
 sh:property [ sh:path re:inputRecipeDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[0-9a-f]{64}$" ] ;
 sh:property [ sh:path re:sourceDescriptorPath ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:selectionDescriptorPath ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] ;
 sh:property [ sh:path re:engine ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ] .
re:TermBindingShape a sh:NodeShape ;
 sh:targetClass re:TermBinding ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path re:sourceGraph ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:IRI ] ;
 sh:property [ sh:path re:term ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ] .
re:StandingShape a sh:NodeShape ;
 sh:targetClass re:Standing ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path rdfs:label ; sh:minCount 1 ; sh:nodeKind sh:Literal ] .
re:DiagnosticReasonShape a sh:NodeShape ;
 sh:targetClass re:DiagnosticReason ;
 sh:nodeKind sh:IRI ;
 sh:property [ sh:path rdfs:label ; sh:minCount 1 ; sh:nodeKind sh:Literal ] .
re:CohortShape sh:property [ sh:path rdf:type ; sh:maxCount 1 ; sh:hasValue re:Cohort ] .
re:EligibilityPolicyShape sh:property [ sh:path rdf:type ; sh:maxCount 1 ; sh:hasValue re:EligibilityPolicy ] .
re:EligibilityPolicyShape sh:sparql [ sh:message "Admitted states must be recognised" ; sh:select "PREFIX re: <https://ontology.inferal.com/modules/commerce-refund-evidence/> SELECT $this WHERE { $this re:admittedPayment ?state . FILTER NOT EXISTS { $this re:recognisedPayment ?state } }" ] .
re:EligibilityPolicyShape sh:sparql [ sh:message "Admitted states must be recognised" ; sh:select "PREFIX re: <https://ontology.inferal.com/modules/commerce-refund-evidence/> SELECT $this WHERE { $this re:admittedLifecycle ?state . FILTER NOT EXISTS { $this re:recognisedLifecycle ?state } }" ] .
