-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] Add feature - visualization of text analaysis results and wo steps #209
Open
kostobog
wants to merge
5
commits into
main
Choose a base branch
from
feature/show-text-analysis-results
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6490dc9
[ADD] Add feature - visualization of text analaysis results and wo steps
kostobog 445b83d
[ADD] Add missing model entity classes.
kostobog 0f326ad
[FIX] Add missing DAOs
kostobog 65c70d4
[UPD] Update loading task step wo-text analysis data
kostobog 6e6143d
[FIX] Delete commented lines
kostobog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...ft-maintenance-planning-model/data/text-analysis/construct-component-failure-class.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# create component failure classes from ordered steps and associate them with task executions | ||
PREFIX cm: <http://onto.fel.cvut.cz/ontologies/csat-maintenance/> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX termit: <http://onto.fel.cvut.cz/ontologies/application/termit/pojem/> | ||
PREFIX : <http://onto.fel.cvut.cz/ontologies/csat/enhance-wo-text-0.1/> | ||
|
||
DELETE{} | ||
INSERT { | ||
GRAPH cm:text-analysis-work-order-classes { | ||
?taskExecutionIRI a ?componentFailureClass. | ||
?componentFailureClass rdfs:subClassOf cm:component-failure--task . | ||
} | ||
} WHERE { | ||
#SELECT ?taskExecutionIRI ?componentFailureClass { | ||
{ | ||
SELECT ?taskExecutionIRI (GROUP_CONCAT(?componentFailureStep; separator=";") as ?componentFailureClassDiscrimitaor) { | ||
{ | ||
SELECT ?taskExecutionIRI ?index ?componentFailureStep { | ||
?taskExecutionIRI a cm:complex-execution; | ||
rdf:type/rdfs:subClassOf cm:maintenance-work-order ; | ||
# cm:is-part-of-workpackage ?workpackageIRI ; | ||
cm:has-work-order-step ?taskStepExecutionIRI . | ||
|
||
?taskStepExecutionIRI cm:described-finding ?finding . | ||
?finding cm:has-failure-occurrence ?failureOccurrence . | ||
?failureOccurrence termit:je-přiřazením-relace ?failureInstance. | ||
|
||
?failureInstance :has-argument1 ?componentURI . | ||
?failureInstance :has-argument2 ?failureURI . | ||
|
||
FILTER (str(?componentURI) != "" && str(?failureURI) != "") | ||
|
||
OPTIONAL{ ?taskStepExecutionIRI cm:step-index ?i . } | ||
BIND(COALESCE(?i, "NO_INDEX") as ?index) | ||
BIND(concat(str(?index), "-", str(?componentURI), str(?failureURI)) as ?componentFailureStep) | ||
} ORDER BY ?taskExecutionIRI ?index | ||
} | ||
} GROUP BY ?taskExecutionIRI | ||
} | ||
BIND(IRI(concat( | ||
"http://onto.fel.cvut.cz/ontologies/csat-maintenance/component-failure-class--", | ||
MD5(?componentFailureClassDiscrimitaor) | ||
)) as ?componentFailureClass | ||
) | ||
} |
48 changes: 48 additions & 0 deletions
48
...model/data/text-analysis/construct-execution-statistics-of-component-failure-class.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# execution statistics of component failure classes extracted using text analysis | ||
PREFIX cm: <http://onto.fel.cvut.cz/ontologies/csat-maintenance/> | ||
PREFIX spif: <http://spinrdf.org/spif#> | ||
PREFIX ofn: <http://www.ontotext.com/sparql/functions/> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
|
||
DELETE{} | ||
INSERT{ | ||
GRAPH cm:text-analysis-work-order-classes { | ||
?componentFailureClass cm:min-work-time ?minWorkTime . | ||
?componentFailureClass cm:max-work-time ?maxWorkTime . | ||
?componentFailureClass cm:avg-work-time ?avgWorkTime . | ||
?componentFailureClass cm:min-duration ?minDuration . | ||
?componentFailureClass cm:max-duration ?maxDuration . | ||
?componentFailureClass cm:avg-duration ?avgDuration . | ||
} | ||
}WHERE{ | ||
SELECT ?componentFailureClass (COUNT(*) as ?executionCount) | ||
(MIN(?derivedWorkTime) as ?minWorkTime) (MAX(?derivedWorkTime) as ?maxWorkTime) (AVG(?derivedWorkTime) as ?avgWorkTime) | ||
(MIN(?derivedDuration) as ?minDuration) (MAX(?derivedDuration) as ?maxDuration) (AVG(?derivedDuration) as ?avgDuration) | ||
{ | ||
|
||
# query csat-data to get all annotated steps for a particular workpackage | ||
{ | ||
SELECT ?taskExecutionIRI ?componentFailureClass | ||
(MIN(?st) as ?derivedStart) (MAX(?et) as ?derivedEnd) (SUM(ofn:asMillis(?et - ?st))/1000.0/60.0/60.0 as ?derivedWorkTime) (ofn:asMillis(?derivedEnd - ?derivedStart)/1000.0/60.0/60.0 as ?derivedDuration) | ||
{ | ||
?taskExecutionIRI a ?componentFailureClass. | ||
?componentFailureClass rdfs:subClassOf cm:component-failure--task. | ||
|
||
?session cm:is-part-of-maintenance-task ?taskExecutionIRI . | ||
|
||
?session cm:start-date ?sDate. | ||
?session cm:start-time ?sTime. | ||
BIND(CONCAT(str(?sDate),"T", str(?sTime), IF(!contains(str(?sTime), "+"), "+02:00", "")) as ?start) | ||
|
||
BIND(spif:parseDate(?start, "yyyy-MM-dd'T'HH:mm") as ?st) | ||
|
||
?session cm:end-date ?eDate. | ||
?session cm:end-time ?eTime. | ||
BIND(CONCAT(str(?eDate),"T", str(?eTime), IF(!contains(str(?sTime), "+"), "+02:00", "")) as ?end) | ||
BIND(spif:parseDate(?end, "yyyy-MM-dd'T'HH:mm") as ?et) | ||
|
||
} GROUP BY ?taskExecutionIRI ?componentFailureClass | ||
} | ||
} GROUP BY ?componentFailureClass | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing irrelevant lines like this one.