User Tools

Site Tools


development:from_sysmodb_wiki:example_sparql

Example SPARQL queries

These are example SPARQL queries that were produced from our 20 Questions, and provided as part of our ISWC publication: Semantic Data and Models Sharing in Systems Biology: The Just Enough Results Model and the SEEK Platform DOI:10.1007/978-3-642-41338-4_14

The following example queries can be run on a triple store generated from the SEEK demo server instance, which can be found at: http://sparql-demo.seek4science.org/sparql

Which experiments were carried out on E-coli?

SELECT ?title ?assay ?organism WHERE
{
  GRAPH <seek-demo:public>
  {
    ?organism jerm:NCBI_ID <http://purl.obolibrary.org/obo/NCBITaxon_562> .
    ?organism a jerm:organism .
    ?assay jerm:investigates ?organism .
    ?assay a jerm:Assay .
    ?assay dcterms:title ?title .
  }
}

What metabolomics data is available?

SELECT ?data ?title WHERE
{
  {
    ?types rdfs:subClassOf jerm:Metabolomics .
  }
  GRAPH<seek-demo:public>
  {
    {
      ?assay jerm:hasType jerm:Metabolomics.
    }
    UNION
    {
      ?assay jerm:hasType ?types.
    }
    ?data jerm:isPartOf ?assay;
    a jerm:Data.
    ?data dcterms:title ?title
  }
}
GROUP BY ?data

Are there any models on yeast, and what data is associated with those models?

SELECT ?model ?model_title ?assay ?assay_title ?data ?data_title WHERE
{
  GRAPH<seek-demo:public>
{
  ?organism jerm:NCBI_ID <http://purl.obolibrary.org/obo/NCBITaxon_4932>;
  a jerm:organism .
  ?model jerm:investigates ?organism;
  a jerm:Model .
  ?assay jerm:hasPart ?model;
  jerm:hasPart ?data.
  ?data dcterms:title ?data_title .
  ?assay dcterms:title ?assay_title .
  ?model dcterms:title ?model_title .
  }
}

Find all strains that have had samples derived from them during the second quarter of 2012

SELECT ?specimen ?strain ?strain_title ?ncbi ?sample ?sampling_date
WHERE
{
  GRAPH<seek-demo:public>
{
  ?specimen a jerm:specimen.
  ?specimen jerm:isDerivedFrom ?strain.
  ?strain dcterms:title ?strain_title.
  ?strain jerm:NCBI_ID ?ncbi.
  ?sample ?isDerivedFrom ?specimen.
  ?sample jerm:sampling_date ?sampling_date
FILTER (
  xsd:dateTime(?sampling_date)> "2012-04-01"^^xsd:date &&
  xsd:dateTime(?sampling_date) <"2012-08-31"^^xsd:date )
  }
}
development/from_sysmodb_wiki/example_sparql.txt · Last modified: 2016/10/25 14:24 by quyen