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

Test for only top level ontology tags --> Expert Curation #16

Open
DeniseSl22 opened this issue Oct 12, 2020 · 1 comment
Open

Test for only top level ontology tags --> Expert Curation #16

DeniseSl22 opened this issue Oct 12, 2020 · 1 comment
Assignees

Comments

@DeniseSl22
Copy link
Contributor

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.

SELECT DISTINCT ?pathway (GROUP_CONCAT(DISTINCT ?tag;separator=", ") AS ?results) 
WHERE {
?pathway a wp:Pathway ; 
         wp:ontologyTag cur:Reactome_Approved . 
OPTIONAL{?pathway wp:ontologyTag ?tag } . 

  FILTER (cur:Reactome_Approved != ?tag)
} GROUP BY ?pathway

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.

@DeniseSl22 DeniseSl22 changed the title Query for only top level ontology tags Test for only top level ontology tags --> Expert Curation Oct 12, 2020
@egonw
Copy link
Member

egonw commented Oct 19, 2020

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

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

2 participants