geneontology/noctua-models

Apply SPARQL update to add missing providedBy annotations

balhoff opened this issue · 2 comments

To support issues identified in geneontology/noctua#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.

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)

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