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

Question: is there a collection of pre-crafted queries against some NIDM graphs instances #275

Open
yarikoptic opened this issue Jul 1, 2021 · 1 comment

Comments

@yarikoptic
Copy link
Member

e.g. against reprolake.
I am thinking about something as simple as some json/yaml of a type

- description: Return known "sexes" of participants
  sameAs:
     datalad: datalad search --show-keys short sex
  sparql: |
    SELECT DISTINCT ?open_neuro_id ?de ?label ?description ?diag_val
    WHERE {
        ?de nidm:isAbout <http://uri.interlex.org/ilx_0497879>;
          rdfs:label ?label ;
          dct:description ?description .
    
        ?acq_o ?de ?diag_val;
          prov:wasGeneratedBy ?acq.
    
        ?acq prov:qualifiedAssociation/prov:agent ?subject_iri;
            dct:isPartOf+ ?project .
    
        ?subject_iri ndar:src_subject_id ?subject_id .
        ?project a nidm:Project;
            dctypes:title ?projectname;
            prov:Location ?project_location .
        
        BIND( strafter(?project_location,"openneuro/") AS ?open_neuro_id ) .
    }
- description: Return known to the graph diagnosis
  sparql: |
    SELECT DISTINCT ?de ?label ?description ?concept
    WHERE {
        ?de rdfs:label ?label ;
            dct:description ?description;
            nidm:source_variable ?source .
    
        OPTIONAL {
          ?de nidm:isAbout ?concept .
        }
    
        FILTER  (
                  regex(?label, "diag", "i" ) ||
                  regex(?description, "diag", "i" ) ||
                  regex(?source, "diag", "i")  ||
    
                  regex(?label, "disease", "i") ||
                  regex(?description, "disease", "i") ||
                  regex(?source, "disease", "i")  ||
    
                  regex(?label, "disorder", "i") ||
                  regex(?description, "disorder", "i") ||
                  regex(?source, "disorder", "i") 
    
                    )
    }

with then cmdline helper like nidm-queries supporting commands like

  • list: list known queries
  • run [--server ENDPOINT] NAME [PARAMS]
    ?
@dbkeator
Copy link
Contributor

Hi,
Well, there are several places they exist but we don't have a registry or a YAML representation as you suggest.
Places to find queries:

I think ultimately we'd like to keep a registry somewhere, probably with PyNIDM of text files containing SPARQL queries. Our query utility pynidm query allows one to use a text-file based SPARQL query. We could update that feature to use a YAML-based SPARQL query...

Dave

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