geneontology / noctua-models

This is the data repository for the models created and edited with the Noctua tool stack for GO.
http://noctua.geneontology.org/
Creative Commons Attribution 4.0 International
10 stars 3 forks source link

Apply SPARQL update to add missing providedBy annotations #84

Closed balhoff closed 6 years ago

balhoff commented 6 years ago

To support issues identified in https://github.com/geneontology/noctua/issues/458, we need to apply a SPARQL update to add model-level providedBy annotations to production models created before the groups feature was added to Noctua.

I sent an update file by email to @kltm to apply on the Minerva database when it's convenient. Adding a ticket here to track completion.

lpalbou commented 6 years ago

Note: the SPARQL query to get the list of models without providedBy:

    PREFIX metago: <http://model.geneontology.org/>
    PREFIX dc: <http://purl.org/dc/elements/1.1/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
    PREFIX obo: <http://www.geneontology.org/formats/oboInOwl#>
    PREFIX providedBy: <http://purl.org/pav/providedBy>

        SELECT  ?cam ?date ?title     (GROUP_CONCAT(?orcid;separator=",") as ?orcids)
                                    (GROUP_CONCAT(?providedBy;separator=",") as ?groups)
        WHERE 
        {
              GRAPH ?cam {                            
                ?cam metago:graphType metago:noctuaCam .
                ?cam dc:title ?title ;
                     dc:date ?date ;
                     dc:contributor ?orcid .
                optional {
                    ?cam providedBy: ?providedBy
                }
          }          
          filter (!BOUND(?providedBy)) .
        }   
    GROUP BY ?id ?date ?title ?cam
    ORDER BY DESC(?date)
cmungall commented 6 years ago

I modified to check for non-development models that lack providedBy:

PREFIX metago: <http://model.geneontology.org/>
    PREFIX dc: <http://purl.org/dc/elements/1.1/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
    PREFIX obo: <http://www.geneontology.org/formats/oboInOwl#>
    PREFIX providedBy: <http://purl.org/pav/providedBy>

        SELECT  ?cam ?date ?title ?state    (GROUP_CONCAT(?orcid;separator=",") as ?orcids)
                                    (GROUP_CONCAT(?providedBy;separator=",") as ?groups)
        WHERE 
        {
              GRAPH ?cam {                            
                ?cam metago:graphType metago:noctuaCam .
                ?cam dc:title ?title ;
                     dc:date ?date ;
                     dc:contributor ?orcid ;
                     <http://geneontology.org/lego/modelstate> ?state

                optional {
                    ?cam providedBy: ?providedBy
                }
          }          
          filter (!BOUND(?providedBy)) .
          filter (?state != "development")
        }   
    GROUP BY ?id ?date ?title ?state ?cam
    ORDER BY DESC(?date)

no production ones there, so calling this done