BH12.12/SPARQLthon11/DDBJ

提供:TogoWiki

移動: 案内, 検索

DDBJエントリーRDF利用

DDBJ/RDFを利用してBCT divisionの全エントリーからproduct をSPARQLで取得する

モデル微生物毎のproduct
モデル微生物taxルートtaxサブクラス数BCT/product数
Escherichia coli562 2004 118968
Bacillus subtilis1423 53 57625
Cyanobacteria1117 10179 120242
Actinobacteria (high G+C Gram-positive bacteria)1760 41866 406314
参考
モデル微生物taxルートtaxサブクラス数
Bacillus subtilis group 653685 164
Actinobacteria 201174 41865

tax idルート以下の全productを取得するSPARQL

  • 例)大腸菌 taxid = 562
PREFIX taxon: <http://purl.obolibrary.org/obo/NCBITaxon_>
prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd:    <http://www.w3.org/2001/XMLSchema#>
prefix obo:    <http://purl.obolibrary.org/obo/>
prefix faldo:  <http://biohackathon.org/resource/faldo#>
prefix idorg:  <http://rdf.identifiers.org/database/>
prefix insdc:  <http://insdc.org/owl/>


SELECT
 #count(*) 
 ?seq ?feature ?feature_type ?product ?tax_root ?taxon ?tax_label ?step
 #?feature_type count(?feature_type)
WHERE
{
 ?seq rdfs:seeAlso ?idorg.
 ?seq insdc:source_mol_type "genomic DNA".
 ?idorg rdf:type idorg:Taxonomy.
 ?feature obo:so_part_of ?seq.
 ?feature rdf:type ?feature_type.
 ?feature insdc:feature_product ?product.
 {
     SELECT
         #?tax_root ?step str(?label) as ?label str(?tax_label) as ?tax_label ?tax ?rank
         ?tax_root IRI(replace(str(?tax),'http://purl.obolibrary.org/obo/NCBITaxon_','http://identifiers.org/taxonomy/')) as ?taxon str(?tax_label) as ?tax_label ?step
         #?tax_root ?step str(?label) as ?label str(?tax_label) as ?tax_label
     #FROM
     #   <http://insdc.org/ncbitaxon/>
     WHERE
       {
         ?tax_root rdfs:label ?label FILTER (?tax_root = <http://purl.obolibrary.org/obo/NCBITaxon_562> ) .
         ?tax rdfs:subClassOf ?tax_root OPTION (transitive, t_direction 1, t_min(0), t_step("step_no") as ?step).
         ?tax rdfs:label ?tax_label .
       }
      #order by desc(?step)

  }
  FILTER($idorg = ?taxon).
  #FILTER(?seq = <urn:uuid:944306d3-5e50-4fc8-845f-537612008e1a>)
  #FILTER(?idorg = <http://identifiers.org/taxonomy/511145>).
}
#group by ?feature_type
#limit 10000