Skip to content

Commit

Permalink
Merge pull request #68 from kbss-cvut/feature/65-support-fault-event-…
Browse files Browse the repository at this point in the history
…model-with-fha-and-sns-properties

Feature/65 support fault event model with fha and sns properties
  • Loading branch information
kostobog authored Mar 14, 2024
2 parents 8814489 + 82573b8 commit 8ff3a53
Show file tree
Hide file tree
Showing 24 changed files with 337 additions and 62 deletions.
75 changes: 75 additions & 0 deletions ontology-generator/ontology/fta-fmea-model.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ fta-fmea:has-part rdf:type owl:ObjectProperty ;
owl:inverseOf fta-fmea:isPartOf .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-participant
fta-fmea:has-participant rdf:type owl:ObjectProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-prediction
fta-fmea:has-prediction rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf fta-fmea:has-general-estimate .
Expand All @@ -120,6 +124,10 @@ fta-fmea:has-requirement rdf:type owl:ObjectProperty .
fta-fmea:has-scenario rdf:type owl:ObjectProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-type-category
fta-fmea:has-type-category rdf:type owl:ObjectProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-value
fta-fmea:has-value rdf:type owl:ObjectProperty .

Expand Down Expand Up @@ -320,6 +328,10 @@ fta-fmea:requires rdf:type owl:ObjectProperty ;
rdfs:label "requires" .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-selected-estimation
fta-fmea:has-selected-estimation rdf:type owl:ObjectProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/triggeredBy
fta-fmea:triggeredBy rdf:type owl:ObjectProperty ;
rdfs:domain fta-fmea:Event ;
Expand All @@ -343,6 +355,18 @@ fta-fmea:from rdf:type owl:DatatypeProperty ;
rdfs:domain fta-fmea:failure-rate-requirement .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/ata-code
fta-fmea:ata-code rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/code
fta-fmea:code rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/criticality
fta-fmea:criticality rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-duration
fta-fmea:has-duration rdf:type owl:DatatypeProperty ;
rdfs:subPropertyOf owl:topDataProperty ;
Expand All @@ -353,11 +377,31 @@ fta-fmea:has-duration rdf:type owl:DatatypeProperty ;
fta-fmea:has-end rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/material-reference
fta-fmea:material-reference rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/part-number
fta-fmea:part-number rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/quantity
fta-fmea:quantity rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/schematic-designation
fta-fmea:schematic-designation rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-start
fta-fmea:has-start rdf:type owl:DatatypeProperty ;
rdfs:domain fta-fmea:Event .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/stock
fta-fmea:stock rdf:type owl:DatatypeProperty .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasBehaviorType
fta-fmea:hasBehaviorType rdf:type owl:DatatypeProperty ;
rdfs:domain fta-fmea:Behavior ;
Expand Down Expand Up @@ -468,6 +512,7 @@ fta-fmea:Behavior rdf:type owl:Class ;

### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Component
fta-fmea:Component rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:item ;
rdfs:label "Component" .


Expand Down Expand Up @@ -533,6 +578,7 @@ fta-fmea:Situation rdf:type owl:Class ;

### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/System
fta-fmea:System rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:item ;
rdfs:label "System" .


Expand All @@ -553,6 +599,11 @@ fta-fmea:analysis-event rdf:type owl:Class .
fta-fmea:analysis-product rdf:type owl:Class .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/ata-system
fta-fmea:ata-system rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:System .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/estimation-event
fta-fmea:estimation-event rdf:type owl:Class ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
Expand Down Expand Up @@ -629,15 +680,39 @@ fta-fmea:fha-fault-event rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:fault-event-type .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item
fta-fmea:item rdf:type owl:Class .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/method
fta-fmea:method rdf:type owl:Class .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/reusable-system
fta-fmea:reusable-system rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:System .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sns-component
fta-fmea:sns-component rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:System .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/summary
fta-fmea:summary rdf:type owl:Class ;
rdfs:label "Summary" .


### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/verification-method
fta-fmea:verification-method rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:method .


### http://onto.fel.cvut.cz/ontologies/reliability-analysis-application/sns-component-failure-type
<http://onto.fel.cvut.cz/ontologies/reliability-analysis-application/sns-component-failure-type> rdf:type owl:Class ;
rdfs:subClassOf fta-fmea:fault-event-type .


#################################################################
# Individuals
#################################################################
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/cz/cvut/kbss/analysis/model/Behavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
import lombok.Getter;
import lombok.Setter;

import jakarta.validation.constraints.NotEmpty;

import java.util.HashSet;
import java.util.Set;

@OWLClass(iri = Vocabulary.s_c_Behavior)
@MappedSuperclass
@Getter
@Setter
public abstract class Behavior extends NamedEntity {
public abstract class Behavior extends DomainEntity<Behavior> {

@OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.EAGER)
protected Set<Behavior> supertypes;

@OWLDataProperty(iri = Vocabulary.s_p_hasBehaviorType)
private BehaviorType behaviorType = BehaviorType.AtomicBehavior;
Expand All @@ -33,7 +33,7 @@ public abstract class Behavior extends NamedEntity {
private Set<Event> manifestations = new HashSet<>();

@OWLObjectProperty(iri = Vocabulary.s_p_hasComponent, fetch = FetchType.EAGER)
private Component component;
private Item item;


@OWLObjectProperty(iri = Vocabulary.s_p_activatedBy)
Expand Down
23 changes: 4 additions & 19 deletions src/main/java/cz/cvut/kbss/analysis/model/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.*;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -14,26 +15,10 @@
@OWLClass(iri = Vocabulary.s_c_Component)
@Getter
@Setter
public class Component extends NamedEntity {
public class Component extends Item {

@OWLObjectProperty(iri = Vocabulary.s_p_hasFunction, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Function> functions = new HashSet<>();

@OWLObjectProperty(iri = Vocabulary.s_p_hasFailureMode, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<FailureMode> failureModes = new HashSet<>();

@OWLObjectProperty(iri = Vocabulary.s_p_isPartOf, cascade = {CascadeType.MERGE, CascadeType.REFRESH}, fetch = FetchType.EAGER)
private URI parentComponent;

public void addFunction(Function function) {
function.setComponent(this);
getFunctions().add(function);
}

public void addFailureMode(FailureMode failureMode) {
failureMode.setComponent(this);
getFailureModes().add(failureMode);
}
@OWLObjectProperty(iri = Vocabulary.s_p_isPartOf, cascade = {CascadeType.MERGE, CascadeType.REFRESH})// TODO - how to load parent components, e.g. simulate fetch EAGER
private Item parentComponent;

@Override
public String toString() {
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/cz/cvut/kbss/analysis/model/DomainEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cz.cvut.kbss.analysis.model;

import cz.cvut.kbss.analysis.model.util.TypeCategory;
import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.*;
import lombok.Getter;
import lombok.Setter;

import java.util.Set;

@MappedSuperclass
@Getter
@Setter
public abstract class DomainEntity<T extends DomainEntity> extends NamedEntity{

@OWLDataProperty(iri = Vocabulary.s_p_has_type_category)
private TypeCategory typeCategory;

public abstract Set<T> getSupertypes();
public abstract void setSupertypes(Set<T> supertypes);

}
9 changes: 8 additions & 1 deletion src/main/java/cz/cvut/kbss/analysis/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.CascadeType;
import cz.cvut.kbss.jopa.model.annotations.FetchType;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty;
import lombok.Getter;
Expand All @@ -13,7 +14,13 @@
@OWLClass(iri = Vocabulary.s_c_Event)
@Getter
@Setter
public class Event extends NamedEntity {
public class Event extends DomainEntity<Event> {

@OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.EAGER)
protected Set<Event> supertypes;

@OWLObjectProperty(iri = Vocabulary.s_p_isPartOf, fetch = FetchType.EAGER)
protected Set<Event> contextEvents;

@OWLObjectProperty(iri = Vocabulary.s_p_manifestationOf, cascade = CascadeType.ALL)
private Behavior behavior;
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/cz/cvut/kbss/analysis/model/FailureRate.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cz.cvut.kbss.analysis.model;

import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.CascadeType;
import cz.cvut.kbss.jopa.model.annotations.FetchType;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty;
import lombok.Getter;
Expand All @@ -11,13 +13,13 @@
@Setter
public class FailureRate extends AbstractEntity{

@OWLObjectProperty(iri = Vocabulary.s_p_has_requirement)
@OWLObjectProperty(iri = Vocabulary.s_p_has_requirement, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private FailureRateRequirement requirement;

@OWLObjectProperty(iri = Vocabulary.s_p_has_estimate)
@OWLObjectProperty(iri = Vocabulary.s_p_has_estimate, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private FailureRateEstimate estimate;

@OWLObjectProperty(iri = Vocabulary.s_p_has_prediction)
@OWLObjectProperty(iri = Vocabulary.s_p_has_prediction, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private FailureRateEstimate prediction;

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package cz.cvut.kbss.analysis.model;

import cz.cvut.kbss.analysis.model.method.EstimationMethod;
import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.CascadeType;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty;
import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -14,4 +17,10 @@ public class FailureRateEstimate extends AnalysisProduct{
@OWLDataProperty(iri = Vocabulary.s_p_has_value)
protected Double value;

/**
* The estimation method
*/
@OWLObjectProperty(iri = Vocabulary.s_p_based_on, cascade = CascadeType.ALL)
protected EstimationMethod estimationMethod;

}
7 changes: 2 additions & 5 deletions src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public static FaultEvent create(){
@OWLDataProperty(iri = Vocabulary.s_p_hasFaultEventType)
private FtaEventType eventType;

@OWLDataProperty(iri = Vocabulary.s_p_has_event_type)
private FaultEventType faultEventType;

@OWLDataProperty(iri = Vocabulary.s_p_hasGateType)
private GateType gateType;

Expand All @@ -46,8 +43,8 @@ public static FaultEvent create(){
@OWLDataProperty(iri = Vocabulary.s_p_hasProbability)
private Double probability;

@OWLDataProperty(iri = Vocabulary.s_p_based_on)
private String probabilityDiscriminator;
@OWLObjectProperty(iri = Vocabulary.s_p_has_selected_estimation, fetch = FetchType.EAGER)
private FailureRateEstimate selectedEstimate;

@OWLObjectProperty(iri = Vocabulary.s_p_hasChildren, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<FaultEvent> children = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cz.cvut.kbss.analysis.model;

import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.CascadeType;
import cz.cvut.kbss.jopa.model.annotations.FetchType;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty;
import lombok.Getter;
Expand All @@ -11,7 +13,7 @@
@Setter
public class FaultEventType extends Event{

@OWLObjectProperty(iri = Vocabulary.s_p_has_failure_rate)
@OWLObjectProperty(iri = Vocabulary.s_p_has_failure_rate, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private FailureRate failureRate;

}
45 changes: 45 additions & 0 deletions src/main/java/cz/cvut/kbss/analysis/model/Item.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package cz.cvut.kbss.analysis.model;

import cz.cvut.kbss.analysis.util.Vocabulary;
import cz.cvut.kbss.jopa.model.annotations.*;
import lombok.Getter;
import lombok.Setter;

import java.util.HashSet;
import java.util.Set;

@OWLClass(iri = Vocabulary.s_c_item)
@Getter
@Setter
public class Item extends DomainEntity<Item> {

@OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.EAGER)
protected Set<Item> supertypes;

@OWLObjectProperty(iri = Vocabulary.s_p_documented_in)
private Set<Document> documents;

@OWLObjectProperty(iri = Vocabulary.s_p_hasPartComponent, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Component> components = new HashSet<>();

public void addComponent(Component component) {
getComponents().add(component);
component.setParentComponent(this);
}

@OWLObjectProperty(iri = Vocabulary.s_p_hasFunction, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Function> functions = new HashSet<>();
@OWLObjectProperty(iri = Vocabulary.s_p_hasFailureMode, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<FailureMode> failureModes = new HashSet<>();


public void addFunction(Function function) {
function.setItem(this);
getFunctions().add(function);
}

public void addFailureMode(FailureMode failureMode) {
failureMode.setItem(this);
getFailureModes().add(failureMode);
}
}
Loading

0 comments on commit 8ff3a53

Please sign in to comment.