Skip to content
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

Some finding individuals have multiple :WO-text properties #220

Open
2 of 3 tasks
kostobog opened this issue May 23, 2023 · 1 comment
Open
2 of 3 tasks

Some finding individuals have multiple :WO-text properties #220

kostobog opened this issue May 23, 2023 · 1 comment
Assignees

Comments

@kostobog
Copy link
Collaborator

kostobog commented May 23, 2023

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:

<span about="_:27b1-0" property="ddo:je-výskytem-termu" ...

_: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 script enhance-wo-text idempotent.

A/C:

  • write a query to delete :WO_text values leaving just one of the values. Add a query to aircraft-maintenance-planning-model\data\text-analysis\.
  • execute the query on csat-data repository
  • make script enhance-wo-text idempotent
@kostobog kostobog self-assigned this May 23, 2023
@kostobog
Copy link
Collaborator Author

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)
    }
} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant