Open kostobog opened 1 year ago
Use this query to find inconsistent :WO_text
values :
# find findings with multiple :WO_text values
PREFIX cm: <http://onto.fel.cvut.cz/ontologies/csat-maintenance/>
PREFIX : <http://onto.fel.cvut.cz/ontologies/csat/enhance-wo-text-0.1/>
SELECT ?finding (COUNT(*) as ?c) (SAMPLE(?annotatedTextVersion) as ?annotatedText) {
?finding a cm:finding-individual .
?finding :WO_text ?annotatedTextVersion .
}
GROUP BY ?finding
HAVING (?c > 1)
ORDER BY DESC(?c)
Use this query to remove extra :WO_text
values :
# remove extra :WO_text values
PREFIX cm: <http://onto.fel.cvut.cz/ontologies/csat-maintenance/>
PREFIX : <http://onto.fel.cvut.cz/ontologies/csat/enhance-wo-text-0.1/>
DELETE{
GRAPH <http://onto.fel.cvut.cz/ontologies/csat/enhance-wo-text-0.1-annotated-data> {
?finding :WO_text ?annotatedTextVersion2 .
}
}INSERT{}
WHERE {
GRAPH <http://onto.fel.cvut.cz/ontologies/csat/enhance-wo-text-0.1-annotated-data> {
?finding a cm:finding-individual .
?finding :WO_text ?annotatedTextVersion1 .
?finding :WO_text ?annotatedTextVersion2 .
FILTER(?annotatedTextVersion1 != ?annotatedTextVersion2)
}
}
Examples findings:
cm:finding-individual--41a7b35d90ef4e32afc24bbe7a4f3afe
cm:finding-individual--ca54fce5eb6b839708f8d32f21db6f59
The issue is most likely due to how the text-analysis script works and how it was executed. If we use the script to compute it on only unprocessed findings, the problem should not manifest. If we want to recompute all findings that this problem occurs and it is due to change in annotated text. The annotated text looks like this:
_:27b1-0
is, however blank node that will change when we execute text analysis again. To fix this, we would have to normalize all the blank nodes in those texts, e.g., by replacing it with :1, :2, _:3 ... and thus the output of scriptenhance-wo-text
idempotent.A/C:
:WO_text
values leaving just one of the values. Add a query toaircraft-maintenance-planning-model\data\text-analysis\
.enhance-wo-text
idempotent