PREFIX folio: <http://IBCNServices.github.io/Folio-Ontology/Folio.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 xsd: <http://www.w3.org/2001/XMLSchema#>

folio:FailureMode a sh:NodeShape ;
  rdfs:comment "The specific manner or way by which a failure occurs in terms of failure of the item (being a part or (sub) system) function under investigation; it may generally describe the way the failure occurs. It shall at least clearly describe a (end) failure state of the item (or function in case of a Functional FMEA) under consideration. It is the result of the failure mechanism (cause of the failure mode).." ;
  sh:closed false ;
  sh:property [
    sh:name "happenedAt" ;
    sh:description "Relation between the failure cause and the corresponding device/system." ;
    sh:minCount 1 ;
    sh:path folio:happenedAt ;
    sh:order 0
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 1
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 2
  ] ;
  sh:targetClass folio:FailureMode .

folio:DetectionMethod a sh:NodeShape ;
  rdfs:comment "This relies on components’ survey to trigger a warning about abnormalities." ;
  sh:closed false ;
  sh:targetClass folio:DetectionMethod .

folio:Category a sh:NodeShape ;
  rdfs:comment "An ConfirmedAnomaly can happen once (transient), periodically (recurrent) or definitively (permanent)." ;
  sh:closed false ;
  sh:targetClass folio:Category .

folio:NotReviewed a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/resultTime> ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasLabeller ;
    sh:order 1
  ] ;
  sh:targetClass folio:NotReviewed .

folio:ConsequenceDomain a sh:NodeShape ;
  rdfs:comment "Each domain relates to a specific kind of consequence of the ConfirmedAnomaly." ;
  sh:closed false ;
  sh:targetClass folio:ConsequenceDomain .

<http://www.w3.org/ns/sosa/Procedure> a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass <http://www.w3.org/ns/sosa/Procedure> .

<http://www.w3.org/ns/sosa/Observation> a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass <http://www.w3.org/ns/sosa/Observation> .

folio:Rejected a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/resultTime> ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasLabeller ;
    sh:order 1
  ] ;
  sh:targetClass folio:Rejected .

folio:toObservation a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass folio:toObservation .

<http://www.w3.org/ns/sosa/ObservableProperty> a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass <http://www.w3.org/ns/sosa/ObservableProperty> .

folio:observedProperty a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass folio:observedProperty .

<http://www.w3.org/ns/sosa/resultTime> a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass <http://www.w3.org/ns/sosa/resultTime> .

folio:Cause a sh:NodeShape ;
  rdfs:comment "The cause refers to the description suspected to be the source of the ConfirmedAnomaly" ;
  sh:closed false ;
  sh:targetClass folio:Cause .

folio:fromObservation a sh:NodeShape ;
  rdfs:comment "First observation describing the underfined behaviour" ;
  sh:closed false ;
  sh:targetClass folio:fromObservation .

folio:MergedAnomaly a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:name "hasCategory" ;
    sh:description "Relation between the observed element and its category" ;
    sh:minCount 1 ;
    sh:path folio:hasCategory ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/ssn/wasOriginatedBy> ;
    sh:and (
      []
      []
      []
    ) ;
    sh:order 1
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasSubAnomaly ;
    sh:order 2
  ] , [
    sh:name "hasDomain" ;
    sh:description "Relation between the observed element and its domain" ;
    sh:minCount 1 ;
    sh:path folio:hasDomain ;
    sh:order 3
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/usedProcedure> ;
    sh:order 4
  ] , [
    sh:name "hasDetection" ;
    sh:description "Relation between the observed element and the detection method" ;
    sh:minCount 1 ;
    sh:path folio:hasDetection ;
    sh:order 5
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 6
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 7
  ] , [
    sh:name "hasCriticality" ;
    sh:description "Relation between the observed element and the criticality" ;
    sh:minCount 1 ;
    sh:path folio:hasCriticality ;
    sh:order 8
  ] ;
  sh:targetClass folio:MergedAnomaly .

<http://www.w3.org/ns/ssn/System> a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass <http://www.w3.org/ns/ssn/System> .

folio:RelabeledAnomaly a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:name "hasCategory" ;
    sh:description "Relation between the observed element and its category" ;
    sh:minCount 1 ;
    sh:path folio:hasCategory ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/ssn/wasOriginatedBy> ;
    sh:and (
      []
      []
      []
    ) ;
    sh:order 1
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasSubAnomaly ;
    sh:order 2
  ] , [
    sh:name "hasDomain" ;
    sh:description "Relation between the observed element and its domain" ;
    sh:minCount 1 ;
    sh:path folio:hasDomain ;
    sh:order 3
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/usedProcedure> ;
    sh:order 4
  ] , [
    sh:name "hasDetection" ;
    sh:description "Relation between the observed element and the detection method" ;
    sh:minCount 1 ;
    sh:path folio:hasDetection ;
    sh:order 5
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 6
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 7
  ] , [
    sh:name "hasCriticality" ;
    sh:description "Relation between the observed element and the criticality" ;
    sh:minCount 1 ;
    sh:path folio:hasCriticality ;
    sh:order 8
  ] ;
  sh:targetClass folio:RelabeledAnomaly .

folio:Anomaly a sh:NodeShape ;
  rdfs:comment "Description of possible unwanted behaviour" ;
  sh:closed false ;
  sh:property [
    sh:name "hasCategory" ;
    sh:description "Relation between the observed element and its category" ;
    sh:minCount 1 ;
    sh:path folio:hasCategory ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/ssn/wasOriginatedBy> ;
    sh:and (
      []
      []
      []
    ) ;
    sh:order 1
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasSubAnomaly ;
    sh:order 2
  ] , [
    sh:name "hasDomain" ;
    sh:description "Relation between the observed element and its domain" ;
    sh:minCount 1 ;
    sh:path folio:hasDomain ;
    sh:order 3
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/usedProcedure> ;
    sh:order 4
  ] , [
    sh:name "hasDetection" ;
    sh:description "Relation between the observed element and the detection method" ;
    sh:minCount 1 ;
    sh:path folio:hasDetection ;
    sh:order 5
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 6
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 7
  ] , [
    sh:name "hasCriticality" ;
    sh:description "Relation between the observed element and the criticality" ;
    sh:minCount 1 ;
    sh:path folio:hasCriticality ;
    sh:order 8
  ] ;
  sh:targetClass folio:Anomaly .

folio:IntermediateEffect a sh:NodeShape ;
  rdfs:comment "The failure effect as it applies at the next higher indenture level." ;
  sh:closed false ;
  sh:property [
    sh:name "isIntermediateEffect" ;
    sh:description "Relation defining an failure effect as intermediate effect." ;
    sh:minCount 1 ;
    sh:path folio:isIntermediateEffect ;
    sh:order 0
  ] , [
    sh:name "happenedAt" ;
    sh:description "Relation between the failure cause and the corresponding device/system." ;
    sh:minCount 1 ;
    sh:path folio:happenedAt ;
    sh:order 1
  ] , [
    sh:name "hasFailureMode" ;
    sh:description "Relation between the failure effect and the corresponding failure mode." ;
    sh:minCount 1 ;
    sh:path folio:hasFailureMode ;
    sh:order 2
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 3
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 4
  ] ;
  sh:targetClass folio:IntermediateEffect .

<http://www.w3.org/ns/ssn/Stimulus> a sh:NodeShape ;
  sh:closed false ;
  sh:targetClass <http://www.w3.org/ns/ssn/Stimulus> .

folio:LocalEffect a sh:NodeShape ;
  rdfs:comment "The visible failure effect as it applies to the item under analysis." ;
  sh:closed false ;
  sh:property [
    sh:name "happenedAt" ;
    sh:description "Relation between the failure cause and the corresponding device/system." ;
    sh:minCount 1 ;
    sh:path folio:happenedAt ;
    sh:order 0
  ] , [
    sh:name "hasFailureMode" ;
    sh:description "Relation between the failure effect and the corresponding failure mode." ;
    sh:minCount 1 ;
    sh:path folio:hasFailureMode ;
    sh:order 1
  ] , [
    sh:name "isLocalEffect" ;
    sh:description "Relation defining an failure effect as the first mentioned effect." ;
    sh:minCount 1 ;
    sh:path folio:isLocalEffect ;
    sh:order 2
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 3
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 4
  ] ;
  sh:targetClass folio:LocalEffect .

folio:FailureEffect a sh:NodeShape ;
  rdfs:comment "Immediate consequences of a failure on operation, function or functionality, or status of some item." ;
  sh:closed false ;
  sh:property [
    sh:name "hasFailureMode" ;
    sh:description "Relation between the failure effect and the corresponding failure mode." ;
    sh:minCount 1 ;
    sh:path folio:hasFailureMode ;
    sh:order 0
  ] , [
    sh:name "happenedAt" ;
    sh:description "Relation between the failure cause and the corresponding device/system." ;
    sh:minCount 1 ;
    sh:path folio:happenedAt ;
    sh:order 1
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 2
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 3
  ] ;
  sh:targetClass folio:FailureEffect .

<https://w3id.org/linkml/Any> a sh:NodeShape ;
  rdfs:comment "An unconstrained type or object" ;
  sh:closed false ;
  sh:targetClass <https://w3id.org/linkml/Any> .

folio:ConfirmedAnomaly a sh:NodeShape ;
  rdfs:comment "ConfirmedAnomaly’s description. Should then express, at least, which part of the system is affected, by what. Ideally, this should be completed with additional information, such as which components observe the ConfirmedAnomaly, or the worth of its management." ;
  sh:closed false ;
  sh:property [
    sh:name "hasCategory" ;
    sh:description "Relation between the observed element and its category" ;
    sh:minCount 1 ;
    sh:path folio:hasCategory ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/ssn/wasOriginatedBy> ;
    sh:and (
      []
      []
      []
    ) ;
    sh:order 1
  ] , [
    sh:name "hasDomain" ;
    sh:description "Relation between the observed element and its domain" ;
    sh:minCount 1 ;
    sh:path folio:hasDomain ;
    sh:order 2
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/usedProcedure> ;
    sh:order 3
  ] , [
    sh:name "hasDetection" ;
    sh:description "Relation between the observed element and the detection method" ;
    sh:minCount 1 ;
    sh:path folio:hasDetection ;
    sh:order 4
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 5
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 6
  ] , [
    sh:name "hasCriticality" ;
    sh:description "Relation between the observed element and the criticality" ;
    sh:minCount 1 ;
    sh:path folio:hasCriticality ;
    sh:order 7
  ] , [
    sh:path folio:hasStatus ;
    sh:class folio:Confirmed ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 8
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasSubAnomaly ;
    sh:order 9
  ] ;
  sh:targetClass folio:ConfirmedAnomaly .

folio:UnknownPatternAnomaly a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:name "hasCategory" ;
    sh:description "Relation between the observed element and its category" ;
    sh:minCount 1 ;
    sh:path folio:hasCategory ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/ssn/wasOriginatedBy> ;
    sh:and (
      []
      []
      []
    ) ;
    sh:order 1
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasSubAnomaly ;
    sh:order 2
  ] , [
    sh:name "hasDomain" ;
    sh:description "Relation between the observed element and its domain" ;
    sh:minCount 1 ;
    sh:path folio:hasDomain ;
    sh:order 3
  ] , [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/usedProcedure> ;
    sh:order 4
  ] , [
    sh:name "hasDetection" ;
    sh:description "Relation between the observed element and the detection method" ;
    sh:minCount 1 ;
    sh:path folio:hasDetection ;
    sh:order 5
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 6
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 7
  ] , [
    sh:name "hasCriticality" ;
    sh:description "Relation between the observed element and the criticality" ;
    sh:minCount 1 ;
    sh:path folio:hasCriticality ;
    sh:order 8
  ] ;
  sh:targetClass folio:UnknownPatternAnomaly .

folio:Effect a sh:NodeShape ;
  rdfs:comment "The effect describes one aspect of the observed phenomenon." ;
  sh:closed false ;
  sh:targetClass folio:Effect .

folio:Confirmed a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/resultTime> ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasLabeller ;
    sh:order 1
  ] ;
  sh:targetClass folio:Confirmed .

folio:FailureCause a sh:NodeShape ;
  rdfs:comment "Failure causes are defects in design, process, quality, or part application, which are the underlying cause of a failure or which initiate a process which leads to failure. Also, the failure effect at the highest indenture level or total system. A failure mode may have more causes." ;
  sh:closed false ;
  sh:property [
    sh:name "isEndEffect" ;
    sh:description "Relation defining an failure effect as end effect." ;
    sh:minCount 1 ;
    sh:path folio:isEndEffect ;
    sh:order 0
  ] , [
    sh:name "happenedAt" ;
    sh:description "Relation between the failure cause and the corresponding device/system." ;
    sh:minCount 1 ;
    sh:path folio:happenedAt ;
    sh:order 1
  ] , [
    sh:name "hasEffect" ;
    sh:description "Relation between a failure and it corresponding effect." ;
    sh:minCount 1 ;
    sh:path folio:hasEffect ;
    sh:order 2
  ] , [
    sh:name "hasCause" ;
    sh:description "Relation between a failure and it corresponding cause." ;
    sh:minCount 1 ;
    sh:path folio:hasCause ;
    sh:order 3
  ] ;
  sh:targetClass folio:FailureCause .

folio:Status a sh:NodeShape ;
  sh:closed false ;
  sh:property [
    sh:minCount 1 ;
    sh:path <http://www.w3.org/ns/sosa/resultTime> ;
    sh:order 0
  ] , [
    sh:minCount 1 ;
    sh:path folio:hasLabeller ;
    sh:order 1
  ] ;
  sh:targetClass folio:Status .

folio:Criticality a sh:NodeShape ;
  rdfs:comment "It is a time dependent worth attributed to the ConfirmedAnomaly management." ;
  sh:closed false ;
  sh:targetClass folio:Criticality .
