diff --git a/README.md b/README.md index 705b10a8..7764ee95 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ ## Ontology Vocabulary Vocabulary is generated by maven plugin located in `ontology-generator` subproject. -When ontology definition is changed, the sources need to be regenerated. +When ontology definition is changed, the sources need to be regenerated. +For more details see [README.md](ontology-generator/README.md) ## Persistence diff --git a/ontology-generator/README.md b/ontology-generator/README.md new file mode 100644 index 00000000..a2fb58bc --- /dev/null +++ b/ontology-generator/README.md @@ -0,0 +1,21 @@ +# Project Description + +This project generates the `Vocabulary.java` source file based on the ontology specified in the mapping file. +For more details see configuration in [pom.xml](pom.xml) + +## Project structure +- ./ontology - folder containing the ontology files +- ./src/main/resource/mapping - input mapping file used by the jopa-maven-plugin. The file maps ontology IRIs to files +in the ./ontology folder. + + +## Naming conventions +### RDF resources +- resources should be lower-case with words separated by "-" +- IRI fragment should be separated by "/" instead of "#" +- ontology IRI should start with http://onto.fel.cvut.cz/ontologies/ +- resource IRI cannot end with "/" or "#" at the end of the IRI (applies also to ontology IRI) + +### OWL resources +- object property should be named with "has-" and "is-" prefix +- datatype property should be named without "has-" and "is-" prefix diff --git a/ontology-generator/ontology/fta-fmea-model.ttl b/ontology-generator/ontology/fta-fmea-model.ttl index 6f214ae6..84fa0a02 100644 --- a/ontology-generator/ontology/fta-fmea-model.ttl +++ b/ontology-generator/ontology/fta-fmea-model.ttl @@ -15,64 +15,67 @@ # Object Properties ################################################################# -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/activatedBy -fta-fmea:activatedBy rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Situation ; - rdfs:label "activated by" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-activated-by +fta-fmea:is-activated-by rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:situation ; + rdfs:label "is activated by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/activates -fta-fmea:activates rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Situation ; - rdfs:range fta-fmea:Behavior ; - rdfs:label "activates" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-activating +fta-fmea:is-activating rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:situation ; + rdfs:range fta-fmea:behavior ; + rdfs:label "is activating" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/based-on -fta-fmea:based-on rdf:type owl:ObjectProperty . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-based-on +fta-fmea:is-based-on rdf:type owl:ObjectProperty . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/bringsAbout -fta-fmea:bringsAbout rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Event ; - rdfs:range fta-fmea:Situation ; - rdfs:label "brings about" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-bringing-about +fta-fmea:is-bringing-about rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:event ; + rdfs:range fta-fmea:situation ; + rdfs:label "is bringing about" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/broughtAboutBy -fta-fmea:broughtAboutBy rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Situation ; - rdfs:range fta-fmea:Event ; - rdfs:label "brought about by" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-brought-about-by +fta-fmea:is-brought-about-by rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:situation ; + rdfs:range fta-fmea:event ; + rdfs:label "is brought about by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/categorized-by -fta-fmea:categorized-by rdf:type owl:ObjectProperty . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-categorized-by +fta-fmea:is-categorized-by rdf:type owl:ObjectProperty . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/created-by -fta-fmea:created-by rdf:type owl:ObjectProperty ; - owl:inverseOf fta-fmea:creates . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-created-by +fta-fmea:is-created-by rdf:type owl:ObjectProperty ; + owl:inverseOf fta-fmea:has-created ; + rdfs:label "is created by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/creates -fta-fmea:creates rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Event . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-created +fta-fmea:has-created rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:event ; + rdfs:label "has created" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/documented-in -fta-fmea:documented-in rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:System ; - rdfs:range fta-fmea:Document ; - rdfs:label "Documented in" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-documented-in +fta-fmea:is-documented-in rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:system ; + rdfs:range fta-fmea:document ; + rdfs:label "is documented in" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/estimated-by -fta-fmea:estimated-by rdf:type owl:ObjectProperty ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-estimated-by +fta-fmea:is-estimated-by rdf:type owl:ObjectProperty ; owl:inverseOf fta-fmea:is-general-estimate-of ; rdfs:domain fta-fmea:failure-rate ; - rdfs:range fta-fmea:failure-rate-general-estimate . + rdfs:range fta-fmea:failure-rate-general-estimate ; + rdfs:label "is estimated by" . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-estimate @@ -104,7 +107,7 @@ fta-fmea:has-manual-estimate rdf:type owl:ObjectProperty ; ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-part fta-fmea:has-part rdf:type owl:ObjectProperty ; - owl:inverseOf fta-fmea:isPartOf . + owl:inverseOf fta-fmea:is-part-of . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-participant @@ -128,116 +131,113 @@ fta-fmea:has-scenario rdf:type owl:ObjectProperty . 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 . - -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasChildBehavior -fta-fmea:hasChildBehavior rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Behavior ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-child-behavior +fta-fmea:has-child-behavior rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:behavior ; rdfs:label "has child behavior" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasChildren -fta-fmea:hasChildren rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FaultEvent ; - rdfs:range fta-fmea:FaultEvent ; - rdfs:label "has children" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-child +fta-fmea:has-child rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:fault-event ; + rdfs:range fta-fmea:fault-event ; + rdfs:label "has child" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasChildrenSequence -fta-fmea:hasChildrenSequence rdf:type owl:ObjectProperty ; - rdfs:label "has children sequence" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-child-sequence +fta-fmea:has-child-sequence rdf:type owl:ObjectProperty ; + rdfs:label "has child sequence" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasComponent -fta-fmea:hasComponent rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Component ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-component +fta-fmea:has-component rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:component ; rdfs:label "has component" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasEffect -fta-fmea:hasEffect rdf:type owl:ObjectProperty ; - rdfs:label "has effects" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-effect +fta-fmea:has-effect rdf:type owl:ObjectProperty ; + rdfs:label "has effect" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasFailureMode -fta-fmea:hasFailureMode rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Component ; - rdfs:range fta-fmea:FailureMode ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-failure-mode +fta-fmea:has-failure-mode rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:component ; + rdfs:range fta-fmea:failure-mode ; rdfs:label "has failure mode" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasFailureModesTable -fta-fmea:hasFailureModesTable rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FaultTree ; - rdfs:range fta-fmea:FailureModesTable ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-failure-modes-table +fta-fmea:has-failure-modes-table rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:fault-tree ; + rdfs:range fta-fmea:has-failure-modes-table ; rdfs:label "has failure modes table" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasFinalEffect -fta-fmea:hasFinalEffect rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureModesRow ; - rdfs:range fta-fmea:FaultEvent ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-final-effect +fta-fmea:has-final-effect rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:failure-modes-row ; + rdfs:range fta-fmea:fault-event ; rdfs:label "has final effect" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasFunction -fta-fmea:hasFunction rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Component ; - rdfs:range fta-fmea:Function ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-function +fta-fmea:has-function rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:component ; + rdfs:range fta-fmea:function ; rdfs:label "has function" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasLocalEffect -fta-fmea:hasLocalEffect rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureModesRow ; - rdfs:range fta-fmea:FaultEvent ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-local-effect +fta-fmea:has-local-effect rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:failure-modes-row ; + rdfs:range fta-fmea:fault-event ; rdfs:label "has local effect" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasMitigation -fta-fmea:hasMitigation rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureModesRow ; - rdfs:range fta-fmea:Mitigation ; - rdfs:label "hasMitigation" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-mitigation +fta-fmea:has-mitigation rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:failure-modes-row ; + rdfs:range fta-fmea:mitigation ; + rdfs:label "has mitigation" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasPartComponent -fta-fmea:hasPartComponent rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:System ; - rdfs:range fta-fmea:Component ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-part-component +fta-fmea:has-part-component rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:system ; + rdfs:range fta-fmea:component ; rdfs:label "has part component" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasRPN -fta-fmea:hasRPN rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureModesRow ; - rdfs:range fta-fmea:RiskPriorityNumber ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-rpn +fta-fmea:has-rpn rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:failure-modes-row ; + rdfs:range fta-fmea:risk-priority-number ; rdfs:label "has risk priority number" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasRow -fta-fmea:hasRow rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureModesTable ; - rdfs:range fta-fmea:FailureModesRow ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-row +fta-fmea:has-row rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:has-failure-modes-table ; + rdfs:range fta-fmea:failure-modes-row ; rdfs:label "has row" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/impairedBy -fta-fmea:impairedBy rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Behavior ; - rdfs:label "impaired by" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-impaired-by +fta-fmea:is-impaired-by rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:behavior ; + rdfs:label "is impaired by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/impairs -fta-fmea:impairs rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Behavior ; - rdfs:label "impairs" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-impairing +fta-fmea:is-impairing rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:behavior ; + rdfs:label "is impairing" . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-estimation-of @@ -252,104 +252,90 @@ fta-fmea:is-general-estimate-of rdf:type owl:ObjectProperty ; rdfs:range fta-fmea:failure-rate . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/isChildBehaviorOf -fta-fmea:isChildBehaviorOf rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Behavior ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-child-behavior-of +fta-fmea:is-child-behavior-of rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:behavior ; rdfs:label "is child behavior of" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/isDerivedFrom -fta-fmea:isDerivedFrom rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureModesTable ; - rdfs:range fta-fmea:FaultTree ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-derived-from +fta-fmea:is-derived-from rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:has-failure-modes-table ; + rdfs:range fta-fmea:fault-tree ; rdfs:label "is derived from" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/isManifestedBy -fta-fmea:isManifestedBy rdf:type owl:ObjectProperty ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-manifested-by +fta-fmea:is-manifested-by rdf:type owl:ObjectProperty ; rdfs:label "is manifested by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/isMitigatedBy -fta-fmea:isMitigatedBy rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FailureMode ; - rdfs:range fta-fmea:Mitigation ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-mitigated-by +fta-fmea:is-mitigated-by rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:failure-mode ; + rdfs:range fta-fmea:mitigation ; rdfs:label "is mitigated by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/isPartOf -fta-fmea:isPartOf rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Component ; - rdfs:range fta-fmea:Component ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-part-of +fta-fmea:is-part-of rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:component ; + rdfs:range fta-fmea:component ; rdfs:label "is part of" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/manifestation-of -fta-fmea:manifestation-of rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Event ; - rdfs:range fta-fmea:Behavior ; - rdfs:label "manifestation of" . - - -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/manifestationOf -fta-fmea:manifestationOf rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:FunctionEvent ; - rdfs:range fta-fmea:Function ; - rdfs:label "manifestation of" . - - -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/manifested-by -fta-fmea:manifested-by rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Event ; - rdfs:label "manifested by" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-manifestation-of +fta-fmea:is-manifestation-of rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:event ; + rdfs:range fta-fmea:behavior ; + rdfs:label "is manifestation of" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/manifestedBy -fta-fmea:manifestedBy rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Function ; - rdfs:range fta-fmea:FunctionEvent ; - rdfs:label "manifested by" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-manifestation +fta-fmea:has-manifestation rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:event ; + rdfs:label "has manifestation" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/performed-by -fta-fmea:performed-by rdf:type owl:ObjectProperty . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-performed-by +fta-fmea:is-performed-by rdf:type owl:ObjectProperty ; + rdfs:label "is performed by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/preformed-by -fta-fmea:preformed-by rdf:type owl:ObjectProperty . - - -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/requires -fta-fmea:requires rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Behavior ; - rdfs:range fta-fmea:Behavior ; - rdfs:label "requires" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-required +fta-fmea:has-required rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:behavior ; + rdfs:range fta-fmea:behavior ; + rdfs:label "has required" . ### 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 ; - rdfs:range fta-fmea:Situation ; - rdfs:label "triggered by" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-triggered-by +fta-fmea:is-triggered-by rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:event ; + rdfs:range fta-fmea:situation ; + rdfs:label "is triggered by" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/triggers -fta-fmea:triggers rdf:type owl:ObjectProperty ; - rdfs:domain fta-fmea:Situation ; - rdfs:range fta-fmea:Event ; - rdfs:label "triggers" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-trigger +fta-fmea:has-trigger rdf:type owl:ObjectProperty ; + rdfs:domain fta-fmea:situation ; + rdfs:range fta-fmea:event ; + rdfs:label "has trigger" . ################################################################# # Data properties ################################################################# +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/value +fta-fmea:value rdf:type owl:DatatypeProperty . + ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/from fta-fmea:from rdf:type owl:DatatypeProperty ; rdfs:domain fta-fmea:failure-rate-requirement . @@ -367,14 +353,16 @@ fta-fmea:code rdf:type owl:DatatypeProperty . 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 ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/duration +fta-fmea:duration rdf:type owl:DatatypeProperty ; rdfs:subPropertyOf owl:topDataProperty ; - rdfs:domain fta-fmea:Event . + rdfs:domain fta-fmea:event ; + rdfs:label "duration" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-end -fta-fmea:has-end rdf:type owl:DatatypeProperty . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/end +fta-fmea:end rdf:type owl:DatatypeProperty ; + rdfs:label "end" . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/material-reference @@ -393,102 +381,103 @@ fta-fmea:quantity rdf:type owl:DatatypeProperty . 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/start +fta-fmea:start rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:event ; + rdfs:label "start" . ### 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 ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/behavior-type +fta-fmea:behavior-type rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:behavior ; rdfs:range xsd:string ; - rdfs:label "has behavior type" . + rdfs:label "behavior type" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasDescription -fta-fmea:hasDescription rdf:type owl:DatatypeProperty ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/description +fta-fmea:description rdf:type owl:DatatypeProperty ; rdfs:range xsd:string ; - rdfs:label "has description" . + rdfs:label "description" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasDetection -fta-fmea:hasDetection rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:RiskPriorityNumber ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/detection +fta-fmea:detection rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:risk-priority-number ; rdfs:range xsd:decimal ; - rdfs:label "has detection" . + rdfs:label "detection" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasFailureModeType -fta-fmea:hasFailureModeType rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:Behavior ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-mode-type +fta-fmea:failure-mode-type rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:behavior ; rdfs:range xsd:string ; - rdfs:label "has failure mode type" . + rdfs:label "failure mode type" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasFaultEventType -fta-fmea:hasFaultEventType rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:FaultEvent ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-event-type +fta-fmea:fault-event-type rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:fault-event ; rdfs:range xsd:string ; - rdfs:label "has fault event type" . + rdfs:label "fault event type" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasGateType -fta-fmea:hasGateType rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:FaultEvent ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/gate-type +fta-fmea:gate-type rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:fault-event ; rdfs:range xsd:string ; - rdfs:label "has gate type" . + rdfs:label "gate type" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasName -fta-fmea:hasName rdf:type owl:DatatypeProperty ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/name +fta-fmea:name rdf:type owl:DatatypeProperty ; rdfs:range xsd:string ; - rdfs:label "has name" . + rdfs:label "name" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasOccurrence -fta-fmea:hasOccurrence rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:RiskPriorityNumber ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/occurrence +fta-fmea:occurrence rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:risk-priority-number ; rdfs:range xsd:decimal ; - rdfs:label "has occurrence" . + rdfs:label "occurrence" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasPassword -fta-fmea:hasPassword rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:User ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/password +fta-fmea:password rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:user ; rdfs:range xsd:string ; - rdfs:label "has password" . + rdfs:label "password" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasProbability -fta-fmea:hasProbability rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:FaultEvent ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/probability +fta-fmea:probability rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:fault-event ; rdfs:range xsd:float ; - rdfs:label "has probability" . + rdfs:label "probability" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasSequenceProbability -fta-fmea:hasSequenceProbability rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:FaultEvent ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sequence-probability +fta-fmea:sequence-probability rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:fault-event ; rdfs:range xsd:float ; - rdfs:label "has sequence probability" . + rdfs:label "sequence probability" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasSeverity -fta-fmea:hasSeverity rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:RiskPriorityNumber ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/severity +fta-fmea:severity rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:risk-priority-number ; rdfs:range xsd:decimal ; - rdfs:label "has severity" . + rdfs:label "severity" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/hasUsername -fta-fmea:hasUsername rdf:type owl:DatatypeProperty ; - rdfs:domain fta-fmea:User ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/username +fta-fmea:username rdf:type owl:DatatypeProperty ; + rdfs:domain fta-fmea:user ; rdfs:range xsd:string ; - rdfs:label "has username" . + rdfs:label "username" . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/to @@ -498,93 +487,93 @@ fta-fmea:to rdf:type owl:DatatypeProperty ; ### http://purl.org/dc/terms/source dc-terms:source rdf:type owl:DatatypeProperty ; - rdfs:label "annotation source" . + rdfs:label "source" . ################################################################# # Classes ################################################################# -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Behavior -fta-fmea:Behavior rdf:type owl:Class ; - rdfs:label "Behavior" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/behavior +fta-fmea:behavior rdf:type owl:Class ; + rdfs:label "behavior" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Component -fta-fmea:Component 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" . + rdfs:label "component" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Document -fta-fmea:Document rdf:type owl:Class ; - rdfs:label "Document" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/document +fta-fmea:document rdf:type owl:Class ; + rdfs:label "document" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Event -fta-fmea:Event rdf:type owl:Class ; - rdfs:label "Event" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/event +fta-fmea:event rdf:type owl:Class ; + rdfs:label "event" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/FailureMode -fta-fmea:FailureMode rdf:type owl:Class ; - rdfs:label "Failure mode" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-mode +fta-fmea:failure-mode rdf:type owl:Class ; + rdfs:label "failure mode" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/FailureModesRow -fta-fmea:FailureModesRow rdf:type owl:Class ; - rdfs:label "Faulure Modes Row" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-modes-row +fta-fmea:failure-modes-row rdf:type owl:Class ; + rdfs:label "faulure modes row" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/FailureModesTable -fta-fmea:FailureModesTable rdf:type owl:Class ; - rdfs:label "Faulure Modes Table" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-modes-table +fta-fmea:failure-modes-table rdf:type owl:Class ; + rdfs:label "faulure modes table" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/FaultEvent -fta-fmea:FaultEvent rdf:type owl:Class ; - rdfs:label "Fault event" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-event +fta-fmea:fault-event rdf:type owl:Class ; + rdfs:label "fault event" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/FaultTree -fta-fmea:FaultTree rdf:type owl:Class ; - rdfs:label "Fault Tree" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree +fta-fmea:fault-tree rdf:type owl:Class ; + rdfs:label "fault tree" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Function -fta-fmea:Function rdf:type owl:Class ; - rdfs:label "Function" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/function +fta-fmea:function rdf:type owl:Class ; + rdfs:label "function" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/FunctionEvent -fta-fmea:FunctionEvent rdf:type owl:Class ; - rdfs:label "Function Event" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/function-event +fta-fmea:function-event rdf:type owl:Class ; + rdfs:label "function event" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Mitigation -fta-fmea:Mitigation rdf:type owl:Class ; - rdfs:label "Mitigation" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/mitigation +fta-fmea:mitigation rdf:type owl:Class ; + rdfs:label "mitigation" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/RiskPriorityNumber -fta-fmea:RiskPriorityNumber rdf:type owl:Class ; - rdfs:label "Risk Priority Number" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/risk-priority-number +fta-fmea:risk-priority-number rdf:type owl:Class ; + rdfs:label "risk priority number" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/Situation -fta-fmea:Situation rdf:type owl:Class ; - rdfs:label "Situation" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/situation +fta-fmea:situation rdf:type owl:Class ; + rdfs:label "situation" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/System -fta-fmea:System 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" . + rdfs:label "system" . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/User -fta-fmea:User rdf:type owl:Class ; - rdfs:label "User" . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/user +fta-fmea:user rdf:type owl:Class ; + rdfs:label "user" . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/aircraft-model @@ -601,19 +590,19 @@ 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 . + 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 ; - owl:onProperty fta-fmea:categorized-by ; + owl:onProperty fta-fmea:is-categorized-by ; owl:allValuesFrom fta-fmea:failure-rate-general-estimation-method ] . -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failire-rate-statistical-estimation-method -fta-fmea:failire-rate-statistical-estimation-method rdf:type owl:Class ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-rate-statistical-estimation-method +fta-fmea:failure-rate-statistical-estimation-method rdf:type owl:Class ; rdfs:subClassOf fta-fmea:failure-rate-general-estimation-method . @@ -690,17 +679,17 @@ 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 . + 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 . + 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" . + rdfs:label "summary" . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/verification-method @@ -708,8 +697,8 @@ 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 - rdf:type owl:Class ; +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sns-component-failure-type +fta-fmea:sns-component-failure-type rdf:type owl:Class ; rdfs:subClassOf fta-fmea:fault-event-type . @@ -717,9 +706,9 @@ fta-fmea:verification-method rdf:type owl:Class ; # Individuals ################################################################# -### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failire-rate-statistical-estimation-method -fta-fmea:failire-rate-statistical-estimation-method rdf:type owl:NamedIndividual , - fta-fmea:failire-rate-statistical-estimation-method . +### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-rate-statistical-estimation-method +fta-fmea:failure-rate-statistical-estimation-method rdf:type owl:NamedIndividual , + fta-fmea:failure-rate-statistical-estimation-method . ### http://onto.fel.cvut.cz/ontologies/fta-fmea-application/failure-rate-fta-prediction-method @@ -731,7 +720,7 @@ fta-fmea:failure-rate-fta-prediction-method rdf:type owl:NamedIndividual , # Annotations ################################################################# -fta-fmea:failire-rate-statistical-estimation-method rdfs:label "failure rate statistical estimation method"@en . +fta-fmea:failure-rate-statistical-estimation-method rdfs:label "failure rate statistical estimation method"@en . fta-fmea:failure-rate-fta-prediction-method rdfs:label "failure rate fta prediction method"@en . diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/ComponentController.java b/src/main/java/cz/cvut/kbss/analysis/controller/ComponentController.java index c3f00c4a..dc46eced 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/ComponentController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/ComponentController.java @@ -5,7 +5,6 @@ import cz.cvut.kbss.analysis.model.FailureMode; import cz.cvut.kbss.analysis.model.Function; import cz.cvut.kbss.analysis.service.ComponentRepositoryService; -import cz.cvut.kbss.analysis.service.FunctionRepositoryService; import cz.cvut.kbss.analysis.service.IdentifierService; import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jsonld.JsonLd; @@ -53,21 +52,21 @@ public Component update(@RequestBody ComponentUpdateDTO componentUpdate) { public void delete(@PathVariable(name = "componentFragment") String componentFragment) { log.info("> delete - {}", componentFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); repositoryService.remove(componentUri); } @GetMapping(value = "/{componentFragment}/functions", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getFunctions(@PathVariable(name = "componentFragment") String componentFragment) { log.info("> getFunctions - {}", componentFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); return repositoryService.getFunctions(componentUri); } @GetMapping(value = "/{componentFragment}/failureModes", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getFailureModes(@PathVariable(name = "componentFragment") String componentFragment) { log.info("> getFailureModes - {}", componentFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); return repositoryService.getFailureModes(componentUri); } @@ -75,7 +74,7 @@ public Set getFailureModes(@PathVariable(name = "componentFragment" @PostMapping(value = "/{componentFragment}/failureModes", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}, consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public FailureMode addFailureMode(@PathVariable(name = "componentFragment") String componentFragment, @RequestBody FailureMode failureMode) { log.info("> addFailureMode - {}, {}", componentFragment, failureMode); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); return repositoryService.addFailureMode(componentUri,failureMode); } @@ -84,16 +83,16 @@ public FailureMode addFailureMode(@PathVariable(name = "componentFragment") Stri @PostMapping(value = "/{componentFragment}/failureModes/{failureModeFragment}", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}, consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public void addFailureModeByURI(@PathVariable(name = "componentFragment") String componentFragment, @PathVariable(name = "failureModeFragment") String failureModeFragment) { log.info("> addFailureModeByUri - {}, {}", componentFragment, failureModeFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); repositoryService.addFailureModeByUri(componentUri, failureModeUri); } @DeleteMapping(value = "/{componentFragment}/failureModes/{failureModeFragment}") public void deleteFailureMode(@PathVariable(name = "componentFragment") String componentFragment, @PathVariable(name = "failureModeFragment") String failureModeFragment) { log.info("> deleteFailureMode - {}, {}", componentFragment, failureModeFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); repositoryService.deleteFailureMode(componentUri, failureModeUri); log.info("< deleteFailureMode"); @@ -103,7 +102,7 @@ public void deleteFailureMode(@PathVariable(name = "componentFragment") String c @PostMapping(value = "/{componentFragment}/functions", consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public Function addFunction(@PathVariable(name = "componentFragment") String componentFragment, @RequestBody Function function) { log.info("> addFunction - {}, {}", componentFragment, function); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); return repositoryService.addFunction(componentUri, function); } @@ -112,8 +111,8 @@ public Function addFunction(@PathVariable(name = "componentFragment") String com @PostMapping(value = "/{componentFragment}/functions/{functionFragment}", produces = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public Function addFunctionByURI(@PathVariable(name = "componentFragment") String componentFragment, @PathVariable(name = "functionFragment") String functionFragment) { log.info("> addFunction - {}, {}", componentFragment, functionFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); return repositoryService.addFunctionByURI(componentUri, functionUri); } @@ -121,8 +120,8 @@ public Function addFunctionByURI(@PathVariable(name = "componentFragment") Strin @DeleteMapping(value = "/{componentFragment}/functions/{functionFragment}") public void deleteFunction(@PathVariable(name = "componentFragment") String componentFragment, @PathVariable(name = "functionFragment") String functionFragment) { log.info("> deleteFunction - {}, {}", componentFragment, functionFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); repositoryService.deleteFunction(componentUri, functionUri); log.info("< deleteFunction"); @@ -133,8 +132,8 @@ public Component linkComponents( @PathVariable(name = "componentFragment") String componentFragment, @PathVariable(name = "linkFragment") String linkFragment) { log.info("> addFunction - {}, {}", componentFragment, linkFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); - URI linkComponentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, linkFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); + URI linkComponentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, linkFragment); return repositoryService.linkComponents(componentUri, linkComponentUri); } @@ -142,7 +141,7 @@ public Component linkComponents( @DeleteMapping(value = "/{componentFragment}/linkComponent") public void unlinkComponents(@PathVariable(name = "componentFragment") String componentFragment) { log.info("> unlinkComponents - {}", componentFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); repositoryService.unlinkComponents(componentUri); log.info("< unlinkComponents"); @@ -153,8 +152,8 @@ public void mergeComponents(@PathVariable(name = "sourceFragment") String source ,@PathVariable(name = "targetFragment") String targetFragment){ log.info("> mergeComponents - {} {}", sourceFragment, targetFragment); - URI sourceUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, sourceFragment); - URI targetUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, targetFragment); + URI sourceUri = identifierService.composeIdentifier(Vocabulary.s_c_component, sourceFragment); + URI targetUri = identifierService.composeIdentifier(Vocabulary.s_c_component, targetFragment); repositoryService.mergeComponents(sourceUri, targetUri); } diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/FailureModeController.java b/src/main/java/cz/cvut/kbss/analysis/controller/FailureModeController.java index 420d9c9a..c85c5574 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/FailureModeController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/FailureModeController.java @@ -1,7 +1,6 @@ package cz.cvut.kbss.analysis.controller; -import cz.cvut.kbss.analysis.model.*; -import cz.cvut.kbss.analysis.service.ComponentRepositoryService; +import cz.cvut.kbss.analysis.model.FailureMode; import cz.cvut.kbss.analysis.service.FailureModeRepositoryService; import cz.cvut.kbss.analysis.service.IdentifierService; import cz.cvut.kbss.analysis.util.Vocabulary; @@ -11,8 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import java.net.URI; @@ -36,7 +33,7 @@ public List findAll() { @GetMapping(value = "/{failureModeFragment}", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public FailureMode findFailureMode(@PathVariable(name = "failureModeFragment") String failureModeFragment) { log.info("> findFailureMode - {}", failureModeFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); return repositoryService.findRequired(failureModeUri); } @@ -62,7 +59,7 @@ public FailureMode update(@RequestBody FailureMode failureMode) { public void delete(@PathVariable(name = "failureModeFragment") String failureModeFragment) { log.info("> delete - {}", failureModeFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); repositoryService.remove(failureModeUri); } @@ -70,8 +67,8 @@ public void delete(@PathVariable(name = "failureModeFragment") String failureMod public FailureMode addImpairedBehavior(@PathVariable(name = "failureModeFragment") String failureModeFragment , @PathVariable(name = "impairedBehaviorFragment") String impairedBehaviorFragment) { log.info("> addImpairedBehavior - {}, {}", failureModeFragment, impairedBehaviorFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); - URI impairedBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, impairedBehaviorFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); + URI impairedBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_function, impairedBehaviorFragment); return repositoryService.addImpairedBehavior(failureModeUri, impairedBehaviorUri); } @@ -79,8 +76,8 @@ public FailureMode addImpairedBehavior(@PathVariable(name = "failureModeFragment public void removeImpairedBehavior(@PathVariable(name = "failureModeFragment") String failureModeFragment , @PathVariable(name = "impairedBehaviorFragment") String impairedBehaviorFragment) { log.info("> removeImpairedBehavior - {}, {}", failureModeFragment, impairedBehaviorFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); - URI impairedBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, impairedBehaviorFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); + URI impairedBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_function, impairedBehaviorFragment); repositoryService.removeImpairedBehavior(failureModeUri, impairedBehaviorUri); } @@ -88,8 +85,8 @@ public void removeImpairedBehavior(@PathVariable(name = "failureModeFragment") S public void addRequiredBehavior(@PathVariable(name = "failureModeFragment") String failureModeFragment , @PathVariable(name = "requiredBehaviorFragment") String requiredBehaviorFragment) { log.info("> addRequiredBehavior - {}, {}", failureModeFragment, requiredBehaviorFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); - URI requiredBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, requiredBehaviorFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); + URI requiredBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, requiredBehaviorFragment); repositoryService.addRequiredBehavior(failureModeUri, requiredBehaviorUri); } @@ -97,8 +94,8 @@ public void addRequiredBehavior(@PathVariable(name = "failureModeFragment") Stri public void removeRequiredBehavior(@PathVariable(name = "failureModeFragment") String failureModeFragment , @PathVariable(name = "requiredBehaviorFragment") String requiredBehaviorFragment) { log.info("> removeRequiredBehavior - {}, {}", failureModeFragment, requiredBehaviorFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); - URI requiredBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, requiredBehaviorFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); + URI requiredBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, requiredBehaviorFragment); repositoryService.removeRequiredBehavior(failureModeUri, requiredBehaviorUri); } @@ -106,8 +103,8 @@ public void removeRequiredBehavior(@PathVariable(name = "failureModeFragment") S public void addChildBehavior(@PathVariable(name = "failureModeFragment") String failureModeFragment , @PathVariable(name = "childBehaviorFragment") String childBehaviorFragment) { log.info("> addChildBehavior - {}, {}", failureModeFragment, childBehaviorFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); - URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, childBehaviorFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); + URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, childBehaviorFragment); repositoryService.addChildBehavior(failureModeUri, childBehaviorUri); } @@ -115,22 +112,22 @@ public void addChildBehavior(@PathVariable(name = "failureModeFragment") String public void removeChildBehavior(@PathVariable(name = "failureModeFragment") String failureModeFragment , @PathVariable(name = "childBehaviorFragment") String childBehaviorFragment) { log.info("> removeChildBehavior - {}, {}", failureModeFragment, childBehaviorFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); - URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, childBehaviorFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); + URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, childBehaviorFragment); repositoryService.removeChildBehavior(failureModeUri, childBehaviorUri); } @GetMapping(value = "/{failureModeFragment}/childTransitiveClosure", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getChildTransitiveClosure(@PathVariable(name = "failureModeFragment") String failureModeFragment) { log.info("> getChildTransitiveClosure - {}", failureModeFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); return repositoryService.getTransitiveClosure(failureModeUri, "child"); } @GetMapping(value = "/{failureModeFragment}/requiredTransitiveClosure", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getRequiredTransitiveClosure(@PathVariable(name = "failureModeFragment") String failureModeFragment) { log.info("> getRequiredTransitiveClosure - {}", failureModeFragment); - URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureMode, failureModeFragment); + URI failureModeUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_mode, failureModeFragment); return repositoryService.getTransitiveClosure(failureModeUri, "required"); } } diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/FailureModesTableController.java b/src/main/java/cz/cvut/kbss/analysis/controller/FailureModesTableController.java index d03c4b63..8af15f04 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/FailureModesTableController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/FailureModesTableController.java @@ -52,7 +52,7 @@ public FailureModesTable update(@RequestBody FailureModesTableUpdateDTO tableUpd public void delete(@PathVariable(name = "failureModeTableFragment") String failureModeTableFragment) { log.info("> delete - {}", failureModeTableFragment); - URI tableUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureModesTable, failureModeTableFragment); + URI tableUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_modes_table, failureModeTableFragment); repositoryService.remove(tableUri); } @@ -60,7 +60,7 @@ public void delete(@PathVariable(name = "failureModeTableFragment") String failu public FailureModesTableDataDTO computeTableData(@PathVariable(name = "failureModeTableFragment") String failureModeTableFragment) { log.info("> computeTableData - {}", failureModeTableFragment); - URI tableUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureModesTable, failureModeTableFragment); + URI tableUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_modes_table, failureModeTableFragment); return repositoryService.computeTableData(tableUri); } @@ -68,7 +68,7 @@ public FailureModesTableDataDTO computeTableData(@PathVariable(name = "failureMo public String export(@PathVariable(name = "failureModeTableFragment") String failureModeTableFragment, HttpServletResponse response) { log.info("> export - {}", failureModeTableFragment); - URI tableUri = identifierService.composeIdentifier(Vocabulary.s_c_FailureModesTable, failureModeTableFragment); + URI tableUri = identifierService.composeIdentifier(Vocabulary.s_c_failure_modes_table, failureModeTableFragment); response.setContentType("text/csv"); response.addHeader("Content-Disposition", "attachment; filename=\"table.csv\""); diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/FaultEventController.java b/src/main/java/cz/cvut/kbss/analysis/controller/FaultEventController.java index ea107fd1..e0202e88 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/FaultEventController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/FaultEventController.java @@ -36,7 +36,7 @@ public List findAll() { public void delete(@PathVariable(name = "faultEventFragment") String faultEventFragment) { log.info("> delete - {}", faultEventFragment); - URI faultEventIri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventIri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); FaultEvent instance = repositoryService.findRequired(faultEventIri); repositoryService.remove(instance); } @@ -51,7 +51,7 @@ public void update(@RequestBody FaultEvent faultEvent) { @ResponseStatus(HttpStatus.NO_CONTENT) @PutMapping(value = "/{faultEventFragment}/rectangle", consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}, produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public void updateRectangle(@PathVariable(name = "faultEventFragment") String faultEventFragment, @RequestBody Rectangle rectangle) { - URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); log.trace("> update - updating rectangle - {} for event <{}>", rectangle, faultEventUri); repositoryService.update(rectangle); } @@ -60,7 +60,7 @@ public void updateRectangle(@PathVariable(name = "faultEventFragment") String fa @PostMapping(value = "/{faultEventFragment}/inputEvents", consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public FaultEvent addInputEvent(@PathVariable(name = "faultEventFragment") String faultEventFragment, @RequestBody FaultEvent inputEvent) { log.info("> addInputEvent - {}, {}", faultEventFragment, inputEvent); - URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); return repositoryService.addInputEvent(faultEventUri, inputEvent); } @@ -68,7 +68,7 @@ public FaultEvent addInputEvent(@PathVariable(name = "faultEventFragment") Strin @GetMapping(value = "/{faultEventFragment}/failureMode", produces = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public FailureMode getFailureMode(@PathVariable(name = "faultEventFragment") String faultEventFragment) { log.info("> getFailureMode - {}", faultEventFragment); - URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); return repositoryService.getFailureMode(faultEventUri); } @@ -77,7 +77,7 @@ public FailureMode getFailureMode(@PathVariable(name = "faultEventFragment") Str @PostMapping(value = "/{faultEventFragment}/failureMode", consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public FailureMode addFailureMode(@PathVariable(name = "faultEventFragment") String faultEventFragment, @RequestBody FailureMode failureMode) { log.info("> addFailureMode - {}, {}", faultEventFragment, failureMode); - URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); return repositoryService.addFailureMode(faultEventUri, failureMode); } @@ -85,7 +85,7 @@ public FailureMode addFailureMode(@PathVariable(name = "faultEventFragment") Str @DeleteMapping(value = "/{faultEventFragment}/failureMode") public void deleteFailureMode(@PathVariable(name = "faultEventFragment") String faultEventFragment) { log.info("> deleteFailureMode - {}", faultEventFragment); - URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); repositoryService.deleteFailureMode(faultEventUri); log.info("< deleteFailureMode"); @@ -96,7 +96,7 @@ public void updateChildrenSequence( @PathVariable(name = "faultEventFragment") String faultEventFragment, @RequestBody List childrenSequence) { log.info("> updateChildrenSequence - {}, {}", faultEventFragment, childrenSequence); - URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent, faultEventFragment); + URI faultEventUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_event, faultEventFragment); repositoryService.updateChildrenSequence(faultEventUri, childrenSequence); } diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/FaultTreeController.java b/src/main/java/cz/cvut/kbss/analysis/controller/FaultTreeController.java index afb96f35..95fba2c4 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/FaultTreeController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/FaultTreeController.java @@ -38,7 +38,7 @@ public List summaries() { @GetMapping(value = "/{faultTreeFragment}", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public FaultTree find(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) { log.info("> find - {}", faultTreeFragment); - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); return repositoryService.findRequired(faultTreeUri); } @@ -65,14 +65,14 @@ public FaultTree update(@RequestBody FaultTree faultTree) { public void delete(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) { log.info("> delete - {}", faultTreeFragment); - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); repositoryService.remove(faultTreeUri); } @GetMapping(value = "/{faultTreeFragment}/reusableEvents", produces = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public List reusableEvents(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) { log.info("> reusableEvents - {}", faultTreeFragment); - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); return repositoryService.getReusableEvents(faultTreeUri); } @@ -80,7 +80,7 @@ public List reusableEvents(@PathVariable(name = "faultTreeFragment") @GetMapping(value = "/{faultTreeFragment}/treePaths", produces = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public List> getTreePaths(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) { log.info("> getTreePaths - {}", faultTreeFragment); - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); return repositoryService.getTreePaths(faultTreeUri); } @@ -98,7 +98,7 @@ public FailureModesTable createFailureModesTable( @PathVariable(name = "faultTreeFragment") String faultTreeFragment, @RequestBody FailureModesTable failureModesTable) { log.info("> createFailureModesTable - {}, {}", faultTreeFragment, failureModesTable); - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); return repositoryService.createFailureModesTable(faultTreeUri, failureModesTable); } @@ -106,7 +106,7 @@ public FailureModesTable createFailureModesTable( @GetMapping(value = "/{faultTreeFragment}/failureModesTable", produces = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public FailureModesTable getFailureModesTable(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) { log.info("> getFailureModesTable - {}", faultTreeFragment); - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); return repositoryService.getFailureModesTable(faultTreeUri); } @@ -114,7 +114,7 @@ public FailureModesTable getFailureModesTable(@PathVariable(name = "faultTreeFra @ResponseStatus(HttpStatus.CREATED) @PostMapping(value = "/{functionFragment}/generateFunctionalDependencies/{faultTreeName}", produces = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE}) public FaultTree generateFunctionalDependenciesFaultTree(@PathVariable("functionFragment") String functionFragment,@PathVariable("faultTreeName") String faultTreeName) throws URISyntaxException { - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); log.info("> generateFunctionalDependenciesFaultTree - {}, {}", functionFragment, faultTreeName); return repositoryService.generateFunctionDependencyTree(functionUri,faultTreeName); } @@ -122,7 +122,7 @@ public FaultTree generateFunctionalDependenciesFaultTree(@PathVariable("function @ResponseStatus(HttpStatus.NO_CONTENT) @PutMapping(value = "/{faultTreeFragment}/cutsets") public void performCutSetAnalysis(@PathVariable(name = "faultTreeFragment") String faultTreeFragment){ - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); log.info("> performCutSetAnalysis - {}", faultTreeFragment); repositoryService.performCutSetAnalysis(faultTreeUri); } @@ -130,7 +130,7 @@ public void performCutSetAnalysis(@PathVariable(name = "faultTreeFragment") Stri @ResponseStatus(HttpStatus.NO_CONTENT) @PutMapping(value = "/{faultTreeFragment}/evaluate") public void evaluate(@PathVariable(name = "faultTreeFragment") String faultTreeFragment){ - URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment); + URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_fault_tree, faultTreeFragment); log.info("> performCutSetAnalysis - {}", faultTreeFragment); repositoryService.evaluate(faultTreeUri); } diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/FunctionController.java b/src/main/java/cz/cvut/kbss/analysis/controller/FunctionController.java index ecb65d2b..c4106af7 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/FunctionController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/FunctionController.java @@ -35,23 +35,23 @@ public List findAll() { @GetMapping(value = "/{functionFragment}/requiredFunctions", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getFunctions(@PathVariable(name = "functionFragment") String function) { log.info("> getRequiredFunctions - {}", function); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, function); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, function); return functionRepositoryService.getRequiredBehavior(functionUri); } @PostMapping(value = "/{functionFragment}/requiredFunctions/{requiredFunctionFragment}") public Function addRequiredFunction(@PathVariable(name = "functionFragment") String functionFragment,@PathVariable(name = "requiredFunctionFragment") String requiredFunctionFragment ) { log.info("> addRequiredFunction - {}, {}", functionFragment, requiredFunctionFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); - URI requiredFunctionURI = identifierService.composeIdentifier(Vocabulary.s_c_Function, requiredFunctionFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); + URI requiredFunctionURI = identifierService.composeIdentifier(Vocabulary.s_c_function, requiredFunctionFragment); return functionRepositoryService.addRequiredBehavior(functionUri, requiredFunctionURI); } @DeleteMapping(value = "/{functionFragment}/requiredFunctions/{requiredFunctionFragment}") public void deleteFunction(@PathVariable(name = "functionFragment") String functionFragment, @PathVariable(name = "requiredFunctionFragment") String requiredFunctionFragment) { log.info("> deleteRequiredFunction - {}, {}", functionFragment, functionFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); - URI requiredFunctionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, requiredFunctionFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); + URI requiredFunctionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, requiredFunctionFragment); functionRepositoryService.deleteRequiredBehavior(functionUri,requiredFunctionUri); log.info("< deleteRequiredFunction"); @@ -67,14 +67,14 @@ public Function updateFunction(@RequestBody Function function){ @GetMapping(value = "/{functionFragment}/getComponent", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Component getComponent(@PathVariable(name = "functionFragment") String function) { log.info("> getComponent - {}", function); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, function); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, function); return functionRepositoryService.getComponent(functionUri); } @GetMapping(value = "/{functionFragment}/impairedBehaviors", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public List getImpairedBehaviors(@PathVariable(name = "functionFragment") String function) { log.info("> getImpairedBehaviors - {}", function); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, function); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, function); return functionRepositoryService.getImpairingBehaviors(functionUri); } @@ -82,8 +82,8 @@ public List getImpairedBehaviors(@PathVariable(name = "functionFragmen public void addChildBehavior(@PathVariable(name = "functionFragment") String functionFragment ,@PathVariable(name = "childBehaviorFragment") String childBehaviorFragment ) { log.info("> addChildBehavior - {}, {}", functionFragment, childBehaviorFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); - URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, childBehaviorFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); + URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_function, childBehaviorFragment); functionRepositoryService.addChildBehavior(functionUri, childBehaviorUri); } @@ -91,22 +91,22 @@ public void addChildBehavior(@PathVariable(name = "functionFragment") String fun public void removeChildBehavior(@PathVariable(name = "functionFragment") String failureModeFragment ,@PathVariable(name = "childBehaviorFragment") String childBehaviorFragment ) { log.info("> removeChildBehavior - {}, {}", failureModeFragment, childBehaviorFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, failureModeFragment); - URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, childBehaviorFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, failureModeFragment); + URI childBehaviorUri = identifierService.composeIdentifier(Vocabulary.s_c_function, childBehaviorFragment); functionRepositoryService.removeChildBehavior(functionUri, childBehaviorUri); } @GetMapping(value = "/{functionFragment}/childTransitiveClosure", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getChildTransitiveClosure(@PathVariable(name = "functionFragment") String functionFragment){ log.info("> getChildTransitiveClosure - {}", functionFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); return functionRepositoryService.getTransitiveClosure(functionUri,"child"); } @GetMapping(value = "/{functionFragment}/requiredTransitiveClosure", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getRequiredTransitiveClosure(@PathVariable(name = "functionFragment") String functionFragment){ log.info("> getRequiredTransitiveClosure - {}", functionFragment); - URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_Function, functionFragment); + URI functionUri = identifierService.composeIdentifier(Vocabulary.s_c_function, functionFragment); return functionRepositoryService.getTransitiveClosure(functionUri, "required"); } } diff --git a/src/main/java/cz/cvut/kbss/analysis/controller/SystemController.java b/src/main/java/cz/cvut/kbss/analysis/controller/SystemController.java index 5add8839..2fe2fba8 100755 --- a/src/main/java/cz/cvut/kbss/analysis/controller/SystemController.java +++ b/src/main/java/cz/cvut/kbss/analysis/controller/SystemController.java @@ -42,14 +42,14 @@ public List summaries() { @GetMapping(value = "/{systemFragment}", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public System find(@PathVariable(name = "systemFragment") String systemFragment) { log.info("> find - {}", systemFragment); - URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_System, systemFragment); + URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_system, systemFragment); return repositoryService.findRequired(systemUri); } @GetMapping(value = "/{systemFragment}/failureModes", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE}) public Set getFailureModes(@PathVariable(name = "systemFragment") String systemFragment) { log.info("> getAllFailureModes - {}", systemFragment); - URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_System, systemFragment); + URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_system, systemFragment); return repositoryService.getAllFailureModes(systemUri); } @@ -76,7 +76,7 @@ public System rename(@RequestBody System system) { public void delete(@PathVariable(name = "systemFragment") String systemFragment) { log.info("> delete - {}", systemFragment); - URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_System, systemFragment); + URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_system, systemFragment); repositoryService.remove(systemUri); } @@ -84,8 +84,8 @@ public void delete(@PathVariable(name = "systemFragment") String systemFragment) public void addComponent(@PathVariable(name = "systemFragment") String systemFragment, @PathVariable(name = "componentFragment") String componentFragment) { log.info("> addComponent - {}, {}", systemFragment, componentFragment); - URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_System, systemFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_system, systemFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); repositoryService.addComponent(systemUri, componentUri); } @@ -94,8 +94,8 @@ public void addComponent(@PathVariable(name = "systemFragment") String systemFra public void deleteComponent(@PathVariable(name = "systemFragment") String systemFragment, @PathVariable(name = "componentFragment") String componentFragment) { log.info("> deleteComponent - {}, {}", systemFragment, componentFragment); - URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_System, systemFragment); - URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_Component, componentFragment); + URI systemUri = identifierService.composeIdentifier(Vocabulary.s_c_system, systemFragment); + URI componentUri = identifierService.composeIdentifier(Vocabulary.s_c_component, componentFragment); repositoryService.removeComponent(systemUri, componentUri); } @@ -103,7 +103,7 @@ public void deleteComponent(@PathVariable(name = "systemFragment") String system @PostMapping(value = "/{systemFragment}/documents") public void importDocument(@PathVariable(name = "systemFragment") String systemFragment, @RequestParam URI documentId) throws UnsupportedEncodingException { - URI systemURI = identifierService.composeIdentifier(Vocabulary.s_c_System, systemFragment); + URI systemURI = identifierService.composeIdentifier(Vocabulary.s_c_system, systemFragment); log.info("> importing annotations from document <{}> into system <{}>", documentId, systemURI); annotatorService.convertDocument(documentId.toString()); repositoryService.importDocument(systemURI, documentId); diff --git a/src/main/java/cz/cvut/kbss/analysis/dao/BehaviorDao.java b/src/main/java/cz/cvut/kbss/analysis/dao/BehaviorDao.java index c70e60bf..1b70971d 100644 --- a/src/main/java/cz/cvut/kbss/analysis/dao/BehaviorDao.java +++ b/src/main/java/cz/cvut/kbss/analysis/dao/BehaviorDao.java @@ -6,18 +6,15 @@ import cz.cvut.kbss.analysis.resources.ResourceUtils; import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.EntityManager; -import cz.cvut.kbss.jopa.model.IRI; -import org.eclipse.rdf4j.common.io.ResourceUtil; -import org.springframework.web.client.ResourceAccessException; import java.io.IOException; import java.net.URI; -import java.util.List; import java.util.Set; import java.util.stream.Collectors; public abstract class BehaviorDao extends NamedEntityDao{ + public static URI P_IS_IMPAIRING = URI.create(Vocabulary.s_p_is_impairing); public BehaviorDao(Class type, EntityManager em, PersistenceConf config) { super(type, em, config); } @@ -31,7 +28,7 @@ public Set getTransitiveBehaviorParts(URI behaviorURI){ } public Set getTransitiveImpairingBehaviors(URI behaviorURI){ - return getTransitiveClosure(ResourceUtils.IMPAIRING_BEHAVIORS, URI.create(Vocabulary.s_p_impairs)); + return getTransitiveClosure(ResourceUtils.IMPAIRING_BEHAVIORS, P_IS_IMPAIRING); } /** @@ -59,7 +56,7 @@ public Set getIndirectBehaviorParts(URI behaviorURI){ * @return */ public Set getIndirectImpairingBehaviors(URI behaviorURI){ - return getTransitiveClosure(ResourceUtils.INDIRECT_IMPAIRING_BEHAVIORS, URI.create(Vocabulary.s_p_impairs)); + return getTransitiveClosure(ResourceUtils.INDIRECT_IMPAIRING_BEHAVIORS, P_IS_IMPAIRING); } public Set getTransitiveClosure(String queryName, URI behaviorURI) { diff --git a/src/main/java/cz/cvut/kbss/analysis/dao/FaultEventDao.java b/src/main/java/cz/cvut/kbss/analysis/dao/FaultEventDao.java index 06fe37a7..f19b9648 100755 --- a/src/main/java/cz/cvut/kbss/analysis/dao/FaultEventDao.java +++ b/src/main/java/cz/cvut/kbss/analysis/dao/FaultEventDao.java @@ -20,7 +20,7 @@ public boolean isChild(URI faultEventIri) { return em .createNativeQuery("ASK WHERE { ?x a ?type ; ?hasChildren ?eventUri . }", Boolean.class) .setParameter("type", typeUri) - .setParameter("hasChildren", URI.create(Vocabulary.s_p_hasChildren)) + .setParameter("hasChildren", URI.create(Vocabulary.s_p_has_child)) .setParameter("eventUri", faultEventIri) .getSingleResult(); } diff --git a/src/main/java/cz/cvut/kbss/analysis/dao/FaultTreeDao.java b/src/main/java/cz/cvut/kbss/analysis/dao/FaultTreeDao.java index 9fe9f2a3..ab0e1309 100755 --- a/src/main/java/cz/cvut/kbss/analysis/dao/FaultTreeDao.java +++ b/src/main/java/cz/cvut/kbss/analysis/dao/FaultTreeDao.java @@ -21,7 +21,7 @@ public boolean isRootEvent(URI faultEventIri) { return em .createNativeQuery("ASK WHERE { ?x a ?type ; ?isManifestedBy ?eventUri . }", Boolean.class) .setParameter("type", typeUri) - .setParameter("isManifestedBy", URI.create(Vocabulary.s_p_isManifestedBy)) + .setParameter("isManifestedBy", URI.create(Vocabulary.s_p_is_manifested_by)) .setParameter("eventUri", faultEventIri) .getSingleResult(); } diff --git a/src/main/java/cz/cvut/kbss/analysis/dao/FunctionDao.java b/src/main/java/cz/cvut/kbss/analysis/dao/FunctionDao.java index 1db4186e..22f327a4 100755 --- a/src/main/java/cz/cvut/kbss/analysis/dao/FunctionDao.java +++ b/src/main/java/cz/cvut/kbss/analysis/dao/FunctionDao.java @@ -3,7 +3,6 @@ import cz.cvut.kbss.analysis.config.conf.PersistenceConf; import cz.cvut.kbss.analysis.model.Behavior; import cz.cvut.kbss.analysis.model.Component; -import cz.cvut.kbss.analysis.model.FailureMode; import cz.cvut.kbss.analysis.model.Function; import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.EntityManager; @@ -15,6 +14,7 @@ @Repository public class FunctionDao extends BehaviorDao { + public static URI P_HAS_FUNCTION = URI.create(Vocabulary.s_p_has_function); @Autowired protected FunctionDao(EntityManager em, PersistenceConf config) { @@ -24,7 +24,7 @@ protected FunctionDao(EntityManager em, PersistenceConf config) { public Component getComponent(URI functionUri) { return em .createNativeQuery("SELECT ?component WHERE { ?component ?hasFunction ?function }", Component.class) - .setParameter("hasFunction", URI.create(Vocabulary.s_p_hasFunction)) + .setParameter("hasFunction", P_HAS_FUNCTION) .setParameter("function", functionUri) .getResultList().stream().findFirst().orElse(null); } @@ -33,7 +33,7 @@ public Component getComponent(URI functionUri) { public List getImpairingBehaviors(URI functionUri){ return em .createNativeQuery("SELECT ?failureMode WHERE { ?failureMode ?impairs ?function }", Behavior.class) - .setParameter("impairs", URI.create(Vocabulary.s_p_impairs)) + .setParameter("impairs", P_IS_IMPAIRING) .setParameter("function", functionUri) .getResultList(); } diff --git a/src/main/java/cz/cvut/kbss/analysis/dao/NamedEntityDao.java b/src/main/java/cz/cvut/kbss/analysis/dao/NamedEntityDao.java index 0dce0421..2adbc4e6 100644 --- a/src/main/java/cz/cvut/kbss/analysis/dao/NamedEntityDao.java +++ b/src/main/java/cz/cvut/kbss/analysis/dao/NamedEntityDao.java @@ -12,8 +12,8 @@ public class NamedEntityDao extends BaseDao { - public static URI P_HAS_NAME = URI.create(Vocabulary.s_p_hasName); - public static URI P_HAS_DESCRIPTION = URI.create(Vocabulary.s_p_hasDescription); + public static URI P_HAS_NAME = URI.create(Vocabulary.s_p_name); + public static URI P_HAS_DESCRIPTION = URI.create(Vocabulary.s_p_description); protected NamedEntityDao(Class type, EntityManager em, PersistenceConf config) { super(type, em, config); } diff --git a/src/main/java/cz/cvut/kbss/analysis/dao/UserDao.java b/src/main/java/cz/cvut/kbss/analysis/dao/UserDao.java index e127b8f6..57db184d 100755 --- a/src/main/java/cz/cvut/kbss/analysis/dao/UserDao.java +++ b/src/main/java/cz/cvut/kbss/analysis/dao/UserDao.java @@ -35,7 +35,7 @@ public Optional findByUsername(String username) { .createNativeQuery("SELECT ?x WHERE { ?x a ?type ; ?hasUsername ?username . }", type) .setParameter("type", typeUri) - .setParameter("hasUsername", URI.create(Vocabulary.s_p_hasUsername)) + .setParameter("hasUsername", URI.create(Vocabulary.s_p_username)) .setParameter("username", username, config.getLanguage()) .getSingleResult()); } catch (NoResultException e) { @@ -56,7 +56,7 @@ public boolean existsWithUsername(String username) { return em .createNativeQuery("ASK WHERE { ?x a ?type ; ?hasUsername ?username . }", Boolean.class) .setParameter("type", typeUri) - .setParameter("hasUsername", URI.create(Vocabulary.s_p_hasUsername)) + .setParameter("hasUsername", URI.create(Vocabulary.s_p_username)) .setParameter("username", username, config.getLanguage()) .getSingleResult(); } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/AnalysisEvent.java b/src/main/java/cz/cvut/kbss/analysis/model/AnalysisEvent.java index 8451d896..ecf844ab 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/AnalysisEvent.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/AnalysisEvent.java @@ -14,18 +14,18 @@ @Setter public class AnalysisEvent extends AbstractEntity{ - @OWLObjectProperty(iri = Vocabulary.s_p_performed_by) + @OWLObjectProperty(iri = Vocabulary.s_p_is_performed_by) private User agent; - @OWLObjectProperty(iri = Vocabulary.s_p_based_on) + @OWLObjectProperty(iri = Vocabulary.s_p_is_based_on) private NamedEntity analysisMethod; - @OWLDataProperty(iri = Vocabulary.s_p_has_start) + @OWLDataProperty(iri = Vocabulary.s_p_start) private Date startTime; - @OWLDataProperty(iri = Vocabulary.s_p_has_end) + @OWLDataProperty(iri = Vocabulary.s_p_end) private Date endTime; - @OWLObjectProperty(iri = Vocabulary.s_p_creates) + @OWLObjectProperty(iri = Vocabulary.s_p_has_created) private T product; } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/AnalysisProduct.java b/src/main/java/cz/cvut/kbss/analysis/model/AnalysisProduct.java index 04a2fafb..1412f952 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/AnalysisProduct.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/AnalysisProduct.java @@ -10,7 +10,7 @@ @Getter @Setter public class AnalysisProduct extends AbstractEntity{ - @OWLObjectProperty(iri = Vocabulary.s_p_creates) + @OWLObjectProperty(iri = Vocabulary.s_p_is_created_by) private AnalysisEvent creationEvent; } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Behavior.java b/src/main/java/cz/cvut/kbss/analysis/model/Behavior.java index d0c4c2e4..7d90d4df 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Behavior.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Behavior.java @@ -9,34 +9,34 @@ import java.util.HashSet; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_Behavior) +@OWLClass(iri = Vocabulary.s_c_behavior) @Getter @Setter public abstract class Behavior extends DomainEntity { - @OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_is_derived_from, fetch = FetchType.EAGER) protected Set supertypes; - @OWLDataProperty(iri = Vocabulary.s_p_hasBehaviorType) + @OWLDataProperty(iri = Vocabulary.s_p_behavior_type) private BehaviorType behaviorType = BehaviorType.AtomicBehavior; - @OWLObjectProperty(iri = Vocabulary.s_p_requires, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_required, fetch = FetchType.EAGER) private Set requiredBehaviors = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_impairs, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_is_impairing, fetch = FetchType.EAGER) private Set impairedBehaviors = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_hasChildBehavior, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_child_behavior, fetch = FetchType.EAGER) private Set childBehaviors = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_manifested_by) + @OWLObjectProperty(iri = Vocabulary.s_p_is_manifested_by) private Set manifestations = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_hasComponent, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_component, fetch = FetchType.EAGER) private Item item; - @OWLObjectProperty(iri = Vocabulary.s_p_activatedBy) + @OWLObjectProperty(iri = Vocabulary.s_p_is_activated_by) private Set activatedBySituations = new HashSet<>(); public boolean isFailureModeCause() { diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Component.java b/src/main/java/cz/cvut/kbss/analysis/model/Component.java index c2d18059..dc18d9d3 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Component.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Component.java @@ -1,23 +1,18 @@ package cz.cvut.kbss.analysis.model; import cz.cvut.kbss.analysis.util.Vocabulary; -import cz.cvut.kbss.jopa.model.annotations.*; -import lombok.Builder; +import cz.cvut.kbss.jopa.model.annotations.CascadeType; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; import lombok.Getter; import lombok.Setter; -import jakarta.validation.constraints.NotEmpty; -import java.net.URI; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - -@OWLClass(iri = Vocabulary.s_c_Component) +@OWLClass(iri = Vocabulary.s_c_component) @Getter @Setter public class Component extends Item { - @OWLObjectProperty(iri = Vocabulary.s_p_isPartOf, cascade = {CascadeType.MERGE, CascadeType.REFRESH})// TODO - how to load parent components, e.g. simulate fetch EAGER + @OWLObjectProperty(iri = Vocabulary.s_p_is_part_of, cascade = {CascadeType.MERGE, CascadeType.REFRESH})// TODO - how to load parent components, e.g. simulate fetch EAGER private Item parentComponent; @Override diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Document.java b/src/main/java/cz/cvut/kbss/analysis/model/Document.java index fdb164d1..1995c5bd 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/Document.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Document.java @@ -2,9 +2,8 @@ import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.OWLClass; -import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; -@OWLClass(iri = Vocabulary.s_c_Document) +@OWLClass(iri = Vocabulary.s_c_document) public class Document extends NamedEntity{ } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Event.java b/src/main/java/cz/cvut/kbss/analysis/model/Event.java index 1a4563a2..11157c9a 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Event.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Event.java @@ -11,24 +11,24 @@ import java.util.HashSet; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_Event) +@OWLClass(iri = Vocabulary.s_c_event) @Getter @Setter public class Event extends DomainEntity { - @OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_is_derived_from, fetch = FetchType.EAGER) protected Set supertypes; - @OWLObjectProperty(iri = Vocabulary.s_p_isPartOf, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_is_part_of, fetch = FetchType.EAGER) protected Set contextEvents; - @OWLObjectProperty(iri = Vocabulary.s_p_manifestationOf, cascade = CascadeType.ALL) + @OWLObjectProperty(iri = Vocabulary.s_p_is_manifestation_of, cascade = CascadeType.ALL) private Behavior behavior; - @OWLObjectProperty(iri = Vocabulary.s_p_bringsAbout) + @OWLObjectProperty(iri = Vocabulary.s_p_is_bringing_about) private Set bringsAboutSituations = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_triggeredBy) + @OWLObjectProperty(iri = Vocabulary.s_p_is_triggered_by) private Set triggeredBySituations = new HashSet<>(); public void setBehavior(Behavior behavior){ diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java index ebbf2656..034f7aba 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java @@ -5,14 +5,12 @@ import lombok.Getter; import lombok.Setter; -import java.util.Objects; - -@OWLClass(iri = Vocabulary.s_c_FailureMode) +@OWLClass(iri = Vocabulary.s_c_failure_mode) @Getter @Setter public class FailureMode extends Behavior { - @OWLDataProperty(iri = Vocabulary.s_p_hasFailureModeType) + @OWLDataProperty(iri = Vocabulary.s_p_failure_mode_type) private FailureModeType failureModeType = FailureModeType.FailureMode; @Override diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java index fb60cec3..4331edf3 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java @@ -2,16 +2,14 @@ import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.*; -import lombok.Data; +import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; -import jakarta.validation.constraints.NotNull; import java.net.URI; -import java.util.Objects; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_FailureModesRow) +@OWLClass(iri = Vocabulary.s_c_failure_modes_row) @Getter @Setter public class FailureModesRow extends AbstractEntity { @@ -29,21 +27,21 @@ public FailureModesRow(FailureModesRow failureModesRow) { @NotNull(message = "Final Effect must be chosen") @ParticipationConstraints(nonEmpty = true) - @OWLObjectProperty(iri = Vocabulary.s_p_hasFinalEffect, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_final_effect, fetch = FetchType.EAGER) private URI finalEffect; @NotNull(message = "Local Effect must be chosen") @ParticipationConstraints(nonEmpty = true) - @OWLObjectProperty(iri = Vocabulary.s_p_hasLocalEffect, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_local_effect, fetch = FetchType.EAGER) private URI localEffect; - @OWLObjectProperty(iri = Vocabulary.s_p_hasEffect, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_effect, fetch = FetchType.EAGER) private Set effects; - @OWLObjectProperty(iri = Vocabulary.s_p_hasRPN, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_rpn, cascade = CascadeType.ALL, fetch = FetchType.EAGER) private RiskPriorityNumber riskPriorityNumber; - @OWLObjectProperty(iri = Vocabulary.s_p_hasMitigation, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_mitigation, cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Mitigation mitigation; @Override diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java index 2c5f3c06..9dc2c016 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java @@ -1,26 +1,26 @@ package cz.cvut.kbss.analysis.model; import cz.cvut.kbss.analysis.util.Vocabulary; -import cz.cvut.kbss.jopa.model.annotations.*; -import lombok.Data; +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; import lombok.Setter; -import jakarta.validation.constraints.NotEmpty; import java.util.HashSet; -import java.util.Objects; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_FailureModesTable) +@OWLClass(iri = Vocabulary.s_c_failure_modes_table) @Getter @Setter public class FailureModesTable extends NamedEntity { - @OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.LAZY) + @OWLObjectProperty(iri = Vocabulary.s_p_is_derived_from, fetch = FetchType.LAZY) private FaultTree faultTree; - @OWLObjectProperty(iri = Vocabulary.s_p_hasRow, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @OWLObjectProperty(iri = Vocabulary.s_p_has_row, cascade = CascadeType.ALL, fetch = FetchType.LAZY) private Set rows = new HashSet<>(); @Override diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureRateEstimate.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureRateEstimate.java index ca99d387..86c966e7 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureRateEstimate.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureRateEstimate.java @@ -14,13 +14,13 @@ @Setter public class FailureRateEstimate extends AnalysisProduct{ - @OWLDataProperty(iri = Vocabulary.s_p_has_value) + @OWLDataProperty(iri = Vocabulary.s_p_value) protected Double value; /** * The estimation method */ - @OWLObjectProperty(iri = Vocabulary.s_p_based_on, cascade = CascadeType.ALL) + @OWLObjectProperty(iri = Vocabulary.s_p_is_based_on, cascade = CascadeType.ALL) protected EstimationMethod estimationMethod; } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java b/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java index a0c03d70..6b9fce2f 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java @@ -11,7 +11,7 @@ import java.net.URI; import java.util.*; -@OWLClass(iri = Vocabulary.s_c_FaultEvent) +@OWLClass(iri = Vocabulary.s_c_fault_event) @Getter @Setter public class FaultEvent extends Event { @@ -31,32 +31,32 @@ public static FaultEvent create(){ @NotNull(message = "EventType must be defined") @ParticipationConstraints(nonEmpty = true) - @OWLDataProperty(iri = Vocabulary.s_p_hasFaultEventType) + @OWLDataProperty(iri = Vocabulary.s_p_fault_event_type) private FtaEventType eventType; - @OWLDataProperty(iri = Vocabulary.s_p_hasGateType) + @OWLDataProperty(iri = Vocabulary.s_p_gate_type) private GateType gateType; @OWLObjectProperty(iri = Vocabulary.s_p_has_rectangle, fetch = FetchType.EAGER, cascade = CascadeType.ALL) private Rectangle rectangle; - @OWLDataProperty(iri = Vocabulary.s_p_hasProbability) + @OWLDataProperty(iri = Vocabulary.s_p_probability) private Double probability; @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) + @OWLObjectProperty(iri = Vocabulary.s_p_has_child, cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Set children = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_hasFailureMode, cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}) + @OWLObjectProperty(iri = Vocabulary.s_p_has_failure_mode, cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}) private FailureMode failureMode; - @OWLDataProperty(iri = Vocabulary.s_p_hasSequenceProbability) + @OWLDataProperty(iri = Vocabulary.s_p_sequence_probability) private Double sequenceProbability; @Sequence - @OWLObjectProperty(iri = Vocabulary.s_p_hasChildrenSequence, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_child_sequence, fetch = FetchType.EAGER) private List childrenSequence = new ArrayList<>(); public FailureMode getFailureMode(){ return getBehavior() instanceof FailureMode ? (FailureMode) getBehavior() : null; diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FaultEventScenario.java b/src/main/java/cz/cvut/kbss/analysis/model/FaultEventScenario.java index 7bd000c5..950ee3b0 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/FaultEventScenario.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FaultEventScenario.java @@ -18,7 +18,7 @@ public class FaultEventScenario extends AnalysisProduct { @OWLObjectProperty(iri = Vocabulary.s_p_has_part, fetch = FetchType.EAGER) private Set scenarioParts; - @OWLDataProperty(iri = Vocabulary.s_p_hasProbability) + @OWLDataProperty(iri = Vocabulary.s_p_probability) private Double probability; diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FaultTree.java b/src/main/java/cz/cvut/kbss/analysis/model/FaultTree.java index 0033f240..a15342be 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FaultTree.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FaultTree.java @@ -2,27 +2,24 @@ import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.*; -import lombok.Data; +import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import java.util.HashSet; import java.util.Objects; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_FaultTree) +@OWLClass(iri = Vocabulary.s_c_fault_tree) @Getter @Setter public class FaultTree extends NamedEntity { @NotNull(message = "Manifesting event must be chosen") @ParticipationConstraints(nonEmpty = true) - @OWLObjectProperty(iri = Vocabulary.s_p_isManifestedBy, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_is_manifested_by, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.EAGER) private FaultEvent manifestingEvent; - @OWLObjectProperty(iri = Vocabulary.s_p_hasFailureModesTable, cascade = CascadeType.ALL) + @OWLObjectProperty(iri = Vocabulary.s_p_has_failure_modes_table, cascade = CascadeType.ALL) private FailureModesTable failureModesTable; @OWLObjectProperty(iri = Vocabulary.s_p_has_scenario, fetch = FetchType.EAGER) diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Function.java b/src/main/java/cz/cvut/kbss/analysis/model/Function.java index 9fba4008..a9f37dcd 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Function.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Function.java @@ -1,13 +1,11 @@ package cz.cvut.kbss.analysis.model; import cz.cvut.kbss.analysis.util.Vocabulary; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; import lombok.Getter; import lombok.Setter; -import java.util.Objects; - -@OWLClass(iri = Vocabulary.s_c_Function) +@OWLClass(iri = Vocabulary.s_c_function) @Getter @Setter public class Function extends Behavior { diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FunctionEvent.java b/src/main/java/cz/cvut/kbss/analysis/model/FunctionEvent.java index acb78202..407f64d3 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FunctionEvent.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FunctionEvent.java @@ -9,12 +9,12 @@ import java.util.HashSet; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_FunctionEvent) +@OWLClass(iri = Vocabulary.s_c_function_event) @Getter @Setter public class FunctionEvent extends Event{ - @OWLObjectProperty(iri = Vocabulary.s_p_manifestationOf) + @OWLObjectProperty(iri = Vocabulary.s_p_is_manifestation_of) private Set functions = new HashSet<>(); public void addFunction(Function function){ diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Item.java b/src/main/java/cz/cvut/kbss/analysis/model/Item.java index f16735ad..260fa4b9 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/Item.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Item.java @@ -13,13 +13,13 @@ @Setter public class Item extends DomainEntity { - @OWLObjectProperty(iri = Vocabulary.s_p_isDerivedFrom, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_is_derived_from, fetch = FetchType.EAGER) protected Set supertypes; - @OWLObjectProperty(iri = Vocabulary.s_p_documented_in) + @OWLObjectProperty(iri = Vocabulary.s_p_is_documented_in) private Set documents; - @OWLObjectProperty(iri = Vocabulary.s_p_hasPartComponent, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_part_component, cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Set components = new HashSet<>(); public void addComponent(Component component) { @@ -27,9 +27,9 @@ public void addComponent(Component component) { component.setParentComponent(this); } - @OWLObjectProperty(iri = Vocabulary.s_p_hasFunction, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_function, cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Set functions = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_hasFailureMode, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_has_failure_mode, cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Set failureModes = new HashSet<>(); diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java b/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java index c616cc95..3aae288f 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java @@ -2,17 +2,10 @@ import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.OWLClass; -import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; -import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; -import lombok.Data; -import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import jakarta.validation.constraints.NotEmpty; -import java.util.Objects; - -@OWLClass(iri = Vocabulary.s_c_Mitigation) +@OWLClass(iri = Vocabulary.s_c_mitigation) @Getter @Setter public class Mitigation extends Behavior { diff --git a/src/main/java/cz/cvut/kbss/analysis/model/NamedEntity.java b/src/main/java/cz/cvut/kbss/analysis/model/NamedEntity.java index 980e0ea8..bec24f2a 100644 --- a/src/main/java/cz/cvut/kbss/analysis/model/NamedEntity.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/NamedEntity.java @@ -13,11 +13,11 @@ public class NamedEntity extends AbstractEntity{ @NotEmpty(message = "Name must not be empty") @ParticipationConstraints(nonEmpty = true) - @OWLDataProperty(iri = Vocabulary.s_p_hasName) + @OWLDataProperty(iri = Vocabulary.s_p_name) private String name; - @OWLDataProperty(iri = Vocabulary.s_p_hasDescription) + @OWLDataProperty(iri = Vocabulary.s_p_description) private String description; } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java b/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java index d09537af..d62d70bf 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java @@ -3,35 +3,29 @@ import cz.cvut.kbss.analysis.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.OWLClass; import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; -import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; -import lombok.Data; -import lombok.Getter; -import lombok.Setter; - import jakarta.validation.constraints.Max; import jakarta.validation.constraints.Min; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Objects; +import lombok.Getter; +import lombok.Setter; -@OWLClass(iri = Vocabulary.s_c_RiskPriorityNumber) +@OWLClass(iri = Vocabulary.s_c_risk_priority_number) @Getter @Setter public class RiskPriorityNumber extends AbstractEntity { @Min(value = 1, message = "Severity must not be lower than 1") @Max(value = 10, message = "Severity must not be greater than 10") - @OWLDataProperty(iri = Vocabulary.s_p_hasSeverity) + @OWLDataProperty(iri = Vocabulary.s_p_severity) private Integer severity; @Min(value = 1, message = "Occurrence must not be lower than 1") @Max(value = 10, message = "Occurrence must not be greater than 10") - @OWLDataProperty(iri = Vocabulary.s_p_hasOccurrence) + @OWLDataProperty(iri = Vocabulary.s_p_occurrence) private Integer occurrence; @Min(value = 1, message = "Detection must not be lower than 1") @Max(value = 10, message = "Detection must not be greater than 10") - @OWLDataProperty(iri = Vocabulary.s_p_hasDetection) + @OWLDataProperty(iri = Vocabulary.s_p_detection) private Integer detection; @Override diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Situation.java b/src/main/java/cz/cvut/kbss/analysis/model/Situation.java index 3e082c88..b559e4dc 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Situation.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Situation.java @@ -9,17 +9,17 @@ import java.util.HashSet; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_Situation) +@OWLClass(iri = Vocabulary.s_c_situation) @Getter @Setter public class Situation extends AbstractEntity { - @OWLObjectProperty(iri = Vocabulary.s_p_broughtAboutBy) + @OWLObjectProperty(iri = Vocabulary.s_p_is_brought_about_by) private Set broughtAboutByEvents = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_triggers) + @OWLObjectProperty(iri = Vocabulary.s_p_has_trigger) private Set triggersEvents = new HashSet<>(); - @OWLObjectProperty(iri = Vocabulary.s_p_activates) + @OWLObjectProperty(iri = Vocabulary.s_p_is_activating) private Set behaviors = new HashSet<>(); } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/System.java b/src/main/java/cz/cvut/kbss/analysis/model/System.java index 51ec3faf..e7377bc9 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/System.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/System.java @@ -1,17 +1,11 @@ package cz.cvut.kbss.analysis.model; import cz.cvut.kbss.analysis.util.Vocabulary; -import cz.cvut.kbss.jopa.model.annotations.*; -import lombok.Builder; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; import lombok.Getter; import lombok.Setter; -import jakarta.validation.constraints.NotEmpty; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - -@OWLClass(iri = Vocabulary.s_c_System) +@OWLClass(iri = Vocabulary.s_c_system) @Getter @Setter public class System extends Item { diff --git a/src/main/java/cz/cvut/kbss/analysis/model/User.java b/src/main/java/cz/cvut/kbss/analysis/model/User.java index 8278335c..4c3f5c54 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/User.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/User.java @@ -2,34 +2,37 @@ import com.fasterxml.jackson.annotation.JsonProperty; import cz.cvut.kbss.analysis.util.Vocabulary; -import cz.cvut.kbss.jopa.model.annotations.*; -import lombok.Data; -import lombok.EqualsAndHashCode; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; +import cz.cvut.kbss.jopa.model.annotations.Transient; +import jakarta.validation.constraints.NotEmpty; import lombok.Getter; import lombok.Setter; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; -import jakarta.validation.constraints.NotEmpty; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import static java.util.stream.Collectors.toList; -@OWLClass(iri = Vocabulary.s_c_User) +@OWLClass(iri = Vocabulary.s_c_user) @Getter @Setter public class User extends AbstractEntity implements UserDetails { @NotEmpty(message = "Username must not be empty") @ParticipationConstraints(nonEmpty = true) - @OWLDataProperty(iri = Vocabulary.s_p_hasUsername) + @OWLDataProperty(iri = Vocabulary.s_p_username) private String username; @NotEmpty(message = "Password must not be empty") @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) @ParticipationConstraints(nonEmpty = true) - @OWLDataProperty(iri = Vocabulary.s_p_hasPassword) + @OWLDataProperty(iri = Vocabulary.s_p_password) private String password; @Transient diff --git a/src/main/java/cz/cvut/kbss/analysis/service/FaultTreeRepositoryService.java b/src/main/java/cz/cvut/kbss/analysis/service/FaultTreeRepositoryService.java index 7b18d147..c33d260b 100755 --- a/src/main/java/cz/cvut/kbss/analysis/service/FaultTreeRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/analysis/service/FaultTreeRepositoryService.java @@ -259,11 +259,11 @@ private FaultEvent transferBehaviorToFaultEvent(Behavior behavior, FaultEvent pa private URI createUri(Behavior behavior, FaultEvent parentEvent, String type) throws URISyntaxException { String behaviorUri = behavior.getUri().toString(); if(parentEvent == null){ - return new URI(identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent + return new URI(identifierService.composeIdentifier(Vocabulary.s_c_fault_event , behaviorUri.substring(behaviorUri.lastIndexOf("/") + 1)) + type); }else{ String parentBehaviorUri = parentEvent.getUri().toString(); - return new URI(identifierService.composeIdentifier(Vocabulary.s_c_FaultEvent + return new URI(identifierService.composeIdentifier(Vocabulary.s_c_fault_event , behaviorUri.substring(behaviorUri.lastIndexOf("/") + 1)) + parentBehaviorUri.split("instance")[1] + type); } } diff --git a/src/main/java/cz/cvut/kbss/analysis/service/validation/ComponentValidator.java b/src/main/java/cz/cvut/kbss/analysis/service/validation/ComponentValidator.java index c5da77c5..ff3ae24e 100755 --- a/src/main/java/cz/cvut/kbss/analysis/service/validation/ComponentValidator.java +++ b/src/main/java/cz/cvut/kbss/analysis/service/validation/ComponentValidator.java @@ -31,7 +31,7 @@ public void validate(Object target, Errors errors) { Component instance = (Component) target; - boolean duplicate = componentDao.existsWithPredicate(Vocabulary.s_p_hasName, instance.getName()); + boolean duplicate = componentDao.existsWithPredicate(Vocabulary.s_p_name, instance.getName()); if(instance.getUri() == null && duplicate) { errors.rejectValue("name", "name.duplicate", "Duplicate component name"); } diff --git a/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidator.java b/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidator.java index aa2b63ef..170cfe88 100755 --- a/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidator.java +++ b/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidator.java @@ -34,7 +34,7 @@ public void validate(Object target, Errors errors) { FaultEvent instance = (FaultEvent) target; - boolean duplicate = faultEventDao.existsWithPredicate(Vocabulary.s_p_hasName, instance.getName()); + boolean duplicate = faultEventDao.existsWithPredicate(Vocabulary.s_p_name, instance.getName()); if(instance.getUri() == null && duplicate) { errors.rejectValue("name", "name.duplicate"); } diff --git a/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultTreeValidator.java b/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultTreeValidator.java index 959fb43a..cb84b51d 100755 --- a/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultTreeValidator.java +++ b/src/main/java/cz/cvut/kbss/analysis/service/validation/FaultTreeValidator.java @@ -34,7 +34,7 @@ public void validate(Object target, Errors errors) { FaultEvent instance = (FaultEvent) target; - boolean duplicate = faultEventDao.existsWithPredicate(Vocabulary.s_p_hasName, instance.getName()); + boolean duplicate = faultEventDao.existsWithPredicate(Vocabulary.s_p_name, instance.getName()); if(instance.getUri() == null && duplicate) { errors.rejectValue("name", "name.duplicate"); } diff --git a/src/main/java/cz/cvut/kbss/analysis/service/validation/FunctionValidator.java b/src/main/java/cz/cvut/kbss/analysis/service/validation/FunctionValidator.java index 56af1ea0..6614c0bf 100755 --- a/src/main/java/cz/cvut/kbss/analysis/service/validation/FunctionValidator.java +++ b/src/main/java/cz/cvut/kbss/analysis/service/validation/FunctionValidator.java @@ -31,7 +31,7 @@ public void validate(Object target, Errors errors) { Function instance = (Function) target; - boolean duplicate = functionDao.existsWithPredicate(Vocabulary.s_p_hasName, instance.getName()); + boolean duplicate = functionDao.existsWithPredicate(Vocabulary.s_p_name, instance.getName()); if(instance.getUri() == null && duplicate) { errors.rejectValue("name", "name.duplicate", "Duplicate component name"); } diff --git a/src/test/java/cz/cvut/kbss/analysis/service/validation/ComponentValidatorTest.java b/src/test/java/cz/cvut/kbss/analysis/service/validation/ComponentValidatorTest.java index 4b1d1de9..c6713c52 100755 --- a/src/test/java/cz/cvut/kbss/analysis/service/validation/ComponentValidatorTest.java +++ b/src/test/java/cz/cvut/kbss/analysis/service/validation/ComponentValidatorTest.java @@ -1,8 +1,6 @@ package cz.cvut.kbss.analysis.service.validation; import cz.cvut.kbss.analysis.dao.ComponentDao; -import cz.cvut.kbss.analysis.environment.Generator; -import cz.cvut.kbss.analysis.exception.ValidationException; import cz.cvut.kbss.analysis.model.Component; import cz.cvut.kbss.analysis.util.Vocabulary; import org.junit.jupiter.api.Assertions; @@ -15,8 +13,6 @@ import org.springframework.validation.BindingResult; import org.springframework.validation.beanvalidation.SpringValidatorAdapter; -import static org.junit.jupiter.api.Assertions.assertThrows; - class ComponentValidatorTest { @Mock @@ -36,7 +32,7 @@ void validateDuplicates_duplicateExists_shouldThrowException() { Component component = new Component(); component.setName("Duplicate Name"); - Mockito.when(componentDao.existsWithPredicate(Vocabulary.s_p_hasName, component.getName())).thenReturn(true); + Mockito.when(componentDao.existsWithPredicate(Vocabulary.s_p_name, component.getName())).thenReturn(true); BindingResult bindingResult = ValidationTestUtils.createBinding(component, componentValidator); @@ -51,7 +47,7 @@ void validateDuplicates_noDuplicate_shouldJustRun() { Component component = new Component(); component.setName("Valid Name"); - Mockito.when(componentDao.existsWithPredicate(Vocabulary.s_p_hasName, component.getName())).thenReturn(false); + Mockito.when(componentDao.existsWithPredicate(Vocabulary.s_p_name, component.getName())).thenReturn(false); BindingResult bindingResult = ValidationTestUtils.createBinding(component, componentValidator); componentValidator.validate(component, bindingResult); diff --git a/src/test/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidatorTest.java b/src/test/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidatorTest.java index 35b54ef7..ef876b35 100755 --- a/src/test/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidatorTest.java +++ b/src/test/java/cz/cvut/kbss/analysis/service/validation/FaultEventValidatorTest.java @@ -36,7 +36,7 @@ void validateDuplicates_duplicateExists_shouldReturnError() { FaultEvent event = new FaultEvent(); event.setName("Duplicate Name"); - Mockito.when(faultEventDao.existsWithPredicate(Vocabulary.s_p_hasName, event.getName())).thenReturn(true); + Mockito.when(faultEventDao.existsWithPredicate(Vocabulary.s_p_name, event.getName())).thenReturn(true); BindingResult bindingResult = ValidationTestUtils.createBinding(event, faultEventValidator); faultEventValidator.validate(event, bindingResult); @@ -51,7 +51,7 @@ void validateDuplicates_noDuplicate_shouldJustRun() { event.setEventType(FtaEventType.BASIC); event.setName("Valid Name"); - Mockito.when(faultEventDao.existsWithPredicate(Vocabulary.s_p_hasName, event.getName())).thenReturn(false); + Mockito.when(faultEventDao.existsWithPredicate(Vocabulary.s_p_name, event.getName())).thenReturn(false); BindingResult bindingResult = ValidationTestUtils.createBinding(event, faultEventValidator); faultEventValidator.validate(event, bindingResult);