ノート:BH12.12/SPARQLthon2/MDBuse

提供:TogoWiki

移動: 案内, 検索

MGDBにFederate検索

PREFIX mbgd: <http://mbgd.genome.ad.jp:8036/rdf/rdf-schema#>

SELECT ?protId
WHERE
{
  SERVICE <http://mbgd.genome.ad.jp:8047/sparql>
  {
    select ?protId
    where {
      ?cluster mbgd:gene "rpoB".
      ?cluster mbgd:member ?domain.
      ?domain mbgd:domainOf ?gene.
      ?gene mbgd:protId ?protId.
    }
  }
}


rpoBからTaxonomyのランクでグループカウント

DEFINE input:inference <http://localhost:8890/DAV/ncbi_taxonomy_owl>
prefix	obo:	 <http://purl.obolibrary.org/obo/>
prefix	dcterms: <http://purl.org/dc/terms/>
prefix  ds:      <http://identifiers.org/dataset/>
prefix  taxon:   <http://purl.org/obo/owl/NCBITaxon> 

select ?label2 count(*)
from<http://localhost:8890/DAV/refseqv2>
from <http://localhost:8890/DAV/sample_bridge>
from <http://localhost:8890/DAV/taxonomy_id>
from <http://localhost:8890/DAV/ncbi_taxonomy_owl>
where
{
 ?gene rdf:type obo:SO_0000704.
 ?gene ?p ?text.
 ?text bif:contains '"rpoB"'.
 ?gene dcterms:isPartOf ?genomeid.
 ?genomeid rdfs:label ?label.
 ?genomeid rdfs:seeAlso ?taxonid.
 ?taxonid a ds:Taxonomy.
 ?taxonid a ?type.
 ?type rdfs:label ?label2.
 ?type <has_rank> <http://purl.org/obo/owl/NCBITaxon#superkingdom>.
} group by ?label2
ORDER BY DESC(?label2)


MEO_0000004からTaxonomyのランクでグループカウント

DEFINE input:inference <http://localhost:8890/DAV/sample_owl>
DEFINE sql:select-option "order" 

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix meo: <http://purl.jp/bio/11/meo/>
prefix ds: <http://identifiers.org/dataset/> 

select ?label2 count(*)
from <http://localhost:8890/DAV/sample>
from <http://localhost:8890/DAV/sample_bridge>
from <http://localhost:8890/DAV/taxonomy_id>
from <http://localhost:8890/DAV/ncbi_taxonomy_owl>
where
{
  {
    select distinct(?goldid) as ?gold
    where
    {
      ?goldid a meo:MEO_0000004 .
      ?goldid meo:environmentalDescribed ?meo.
    }
  }
  ?oriProjectId rdfs:seeAlso ?gold.
  ?refseqProjectId rdfs:seeAlso ?oriProjectId.
  ?refseqProjectId rdfs:label ?dataType
  FILTER regex(?dataType, "RefSeq Genome", "i" ).
  ?refseqProjectId rdfs:seeAlso ?taxsonomy.
  ?taxsonomy  rdf:type ds:Taxonomy.
  ?taxsonomy  a ?type.
  ?type rdfs:label ?label2.
  ?type <has_rank> <http://purl.org/obo/owl/NCBITaxon#family>. 
} GROUP by ?label2