Open DeniseSl22 opened 4 years ago
Not figured out the right query yet, but getting closer:
SELECT DISTINCT ?page ?count
WHERE {
{
SELECT DISTINCT ?pathway (COUNT(?ontology) AS ?count) WHERE {
?pathway wp:ontologyTag ?ontology .
FILTER ( ?ontology != <http://purl.obolibrary.org/obo/PW_0000002> )
FILTER ( ?ontology != <http://purl.obolibrary.org/obo/PW_0000003> )
FILTER ( ?ontology != <http://purl.obolibrary.org/obo/PW_0000004> )
FILTER ( ?ontology != <http://purl.obolibrary.org/obo/PW_0000013> )
FILTER ( ?ontology != <http://purl.obolibrary.org/obo/PW_0000754> )
FILTER ( regex(str(?ontology), "^http://purl.obolibrary.org/obo/PW_.+") )
} GROUP BY ?pathway
}
?pathway foaf:page ?page .
FILTER ( ?count = 0 )
}
Previously, we wanted to add at least one top level PW ontology tag (PW_0000002, PW_0000003, PW_0000004, PW_0000013 and PW_0000754) for each PW. However, since we now have the PW ontology in our endpoint, we could add the best fitting child term, remove the top level terms and obtain those top level terms through a SPARQL query.
The query below obtains all ontology tags for Reactome PWs (excluding the cur:Reactome_Approved), and creates a list of these.
A new test should check the items in that list for each PW (maybe starting with "Approved for Data Analysis" and "Human" ? @egonw ), and then compare for each item if is equal to the IDs mentioned above. If yes, then the test fails and should show up in the expert curation panel. We could then check if there's only 1 parent term (which we should then replace with a more appropriate child term), or remove the parent term if a term deeper down the tree is also present.