BH12.12/TogoStanzaQuery
提供:TogoWiki
グラフ構成
このページのSPARQLは以下のグラフ構成で動作する。
TogoStanzaエンドポイントグラフ構成
Gene Report
Protein names
スタンザファイル名:protein_names 旧スタンザファイル名:protein_names_and_origin
JBrowse
Gene単位
表示範囲を取得するクエリ。引数gene_id:"slr0473"
DEFINE sql:select-option "order" 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 DISTINCT REPLACE(STR(?refseq),"http://identifiers.org/refseq/","") AS ?seq_label ?start ?end ?seq_length FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> WHERE { VALUES ?locus_tag { "slr0473" } VALUES ?seq_type { obo:SO_0000340 obo:SO_0000155 } VALUES ?gene_type { obo:SO_0000704 obo:SO_0000252 obo:SO_0000253 } VALUES ?faldo_stand_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition } #gene ?gene insdc:feature_locus_tag ?locus_tag ; a ?gene_type ; obo:so_part_of ?seq . #position ?gene faldo:location ?faldo . ?faldo faldo:begin/faldo:position ?start . ?faldo faldo:end/faldo:position ?end . #sequence ?seq rdfs:seeAlso ?refseq ; a ?seq_type ; insdc:sequence_length ?seq_length. ?refseq a idorg:RefSeq . }
JBrowseで発行するクエリ
DEFINE sql:select-option "order" PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX seqo: <http://ddbj.nig.ac.jp/ontologies/sequence#> PREFIX insdc: <http://insdc.org/owl/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX faldo: <http://biohackathon.org/resource/faldo#> PREFIX obo: <http://purl.obolibrary.org/obo/> SELECT ?start ?end IF( ?faldo_type = faldo:ForwardStrandPosition, 1, IF( ?faldo_type = faldo:ReverseStrandPosition, -1, 0 ) ) as ?strand str(?obj_type_name) as ?type str(?label) as ?name str(?obj_name) as ?description ?obj as ?uniqueID ?parent as ?parentUniqueID FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> WHERE { { SELECT DISTINCT ?obj ?start ?end ?faldo_type ?obj_type_name ?parent { VALUES ?faldo_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition faldo:BothStrandsPosition } VALUES ?refseq_label { "{ref}" } ?seq insdc:sequence_version ?refseq_label . ?obj obo:so_part_of+ ?seq . FILTER ( !(?start > {end} || ?end < {start}) ) ?obj faldo:location ?faldo . ?faldo faldo:begin/faldo:position ?start . ?faldo faldo:end/faldo:position ?end . ?faldo faldo:begin/rdf:type ?faldo_type . ?obj rdf:type ?obj_type . ?obj_type rdfs:label ?obj_type_name . ?obj obo:so_part_of ?parent . FILTER ( ?obj_type = obo:SO_0000704 || ?parent != ?seq ) } } optional { ?obj insdc:feature_locus_tag ?label . } optional { ?obj insdc:feature_product ?obj_name . } }
Organism単位
CDS
DEFINE sql:select-option "order" 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 taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX seqo: <http://ddbj.nig.ac.jp/ontologies/sequence#> PREFIX insdc: <http://insdc.org/owl/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX obo: <http://purl.obolibrary.org/obo/> SELECT DISTINCT ?start ?end ?strand ?type ?name ?description ?uniqueID ?parentUniqueID FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> WHERE { { SELECT ?start ?end ?strand ?type ?uniqueID ?parentUniqueID WHERE { ?seq_id ?p ?seq_version FILTER (?seq_version = STR(REPLACE("{ref}","RefSeq:",""))) . ?uniqueID obo:so_part_of+ ?seq_id . FILTER ( !(?start > {end} || ?end < {start}) ) ?uniqueID faldo:location ?loc . ?loc faldo:begin/faldo:position ?start . ?loc faldo:end/faldo:position ?end . ?loc faldo:begin/rdf:type ?faldo_type FILTER (?faldo_type IN (faldo:ForwardStrandPosition, faldo:ReverseStrandPosition, faldo:BothStrandsPosition)). BIND ( if(?faldo_type = faldo:ForwardStrandPosition, 1, if(?faldo_type = faldo:ReverseStrandPosition, -1, 0)) as ?strand ) ?uniqueID rdf:type ?uniqueID_type FILTER (?uniqueID_type IN(obo:SO_0000704, obo:SO_0000316, obo:SO_0000147)). ?uniqueID_type rdfs:label ?uniqueID_type_label . BIND ( str(?uniqueID_type_label) as ?type ) . ?uniqueID obo:so_part_of ?parentUniqueID FILTER ( ?uniqueID_type = obo:SO_0000704 || ?parentUniqueID != ?seq_id ) . } } OPTIONAL { ?uniqueID insdc:feature_locus_tag ?name . } OPTIONAL { ?uniqueID insdc:feature_product ?description . } }
tRNA,rRNA 252,253を入れ替える
DEFINE sql:select-option "order" 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 taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX seqo: <http://ddbj.nig.ac.jp/ontologies/sequence#> PREFIX insdc: <http://insdc.org/owl/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX obo: <http://purl.obolibrary.org/obo/> SELECT DISTINCT ?start ?end ?strand ?type ?name ?description ?uniqueID ?parentUniqueID FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> WHERE { { SELECT ?start ?end ?strand ?type ?uniqueID ?parentUniqueID WHERE { ?seq_id ?p ?seq_version FILTER (?seq_version = STR(REPLACE("{ref}","RefSeq:",""))) . ?uniqueID obo:so_part_of+ ?seq_id . FILTER ( !(?start > {end} || ?end < {start}) ) ?uniqueID faldo:location ?loc . ?loc faldo:begin/faldo:position ?start . ?loc faldo:end/faldo:position ?end . ?loc faldo:begin/rdf:type ?faldo_type FILTER (?faldo_type IN (faldo:ForwardStrandPosition, faldo:ReverseStrandPosition, faldo:BothStrandsPosition)). BIND ( if(?faldo_type = faldo:ForwardStrandPosition, 1, if(?faldo_type = faldo:ReverseStrandPosition, -1, 0)) as ?strand ) ?uniqueID rdf:type ?uniqueID_type FILTER (?uniqueID_type = obo:SO_0000252). ?uniqueID_type rdfs:label ?uniqueID_type_label . BIND ( str(?uniqueID_type_label) as ?type ) . ?uniqueID obo:so_part_of ?parentUniqueID . } } OPTIONAL { ?uniqueID insdc:feature_locus_tag ?name . } OPTIONAL { ?uniqueID insdc:feature_product ?description . } }
Genomic context
スタンザファイル名:genome_genomic_contex
旧スタンザファイル名:gene_view
元のクエリー
prefix idorg: <http://rdf.identifiers.org/database/> prefix insdc: <http://insdc.org/owl/> select * from <http://togogenome.org/graph/refseq/> from <http://togogenome.org/graph/so/> from <http://togogenome.org/graph/faldo/> where { values ?locus_tag { "all1455" } # param "slr0473" #values ?ncbi_taxid {"" } # param "taxon:1148" values ?seq_type { obo:SO_0000340 obo:SO_0000155 } # chromosome, plasmid values ?gene_type { obo:SO_0000316 obo:SO_0000252 obo:SO_0000253 } # CDS, rRNA, tRNA values ?faldo_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition } values ?offset { 2000 } # gene ?gene insdc:feature_locus_tag ?locus_tag. ?gene a ?gene_type. # seq ?gene obo:so_part_of+ ?seq. ?seq a ?seq_type. # faldo ?gene faldo:location ?gene_loc. ?gene_loc faldo:begin/faldo:position ?gene_begin. ?gene_loc faldo:end/faldo:position ?gene_end. # taxonomy ncbi ?seq rdfs:seeAlso ?taxonomy . ?taxonomy a idorg:Taxonomy . ?taxonomy rdfs:label ?ncbi_taxid . # objects around the gene ?obj obo:so_part_of+ ?seq . ?obj faldo:location ?faldo . ?faldo faldo:begin/rdf:type ?faldo_type . ?faldo_type rdfs:label ?strand . ?faldo faldo:begin/faldo:position ?b . ?faldo faldo:end/faldo:position ?e . #bind ((xsd:integer(?gene_begin) - ?offset) as ?f) #bind ((xsd:integer(?gene_end) + ?offset) as ?t) #filter (!(?b > ?t || ?e < ?f)) filter (!(?b > ?gene_end + ?offset || ?e < ?gene_begin - ?offset)) ?obj rdf:type ?obj_type . ?obj_type rdfs:label ?obj_label . filter (?obj_type != obo:SO_0000704) # gene optional { ?obj insdc:feature_locus_tag ?label . } optional { ?obj insdc:feature_product ?obj_name . #?obj insdc:feature_product|insdc:feature_gene ?obj_name . } #optional { # ?obj rdfs:seeAlso ?obj_seealso . #} optional { ?obj obo:so_has_part/rdf:rest*/rdf:first ?part . ?part faldo:begin/faldo:position ?pb . ?part faldo:end/faldo:position ?pe . } } order by ?b
改良版クエリ
OPTIONALがボトルネックになっていた。DEFINE sql:select-option "order"が効いていないのか、?objを全トリプルから探している動きに見えた
OPTIONALの前のクエリを全てサブクエリにすることで、上からクエリ実行を強要した(つもり)
使用する項目 :obj, :label, :obj_label, :b, :e, :strand, :pb, :pe, :gene_begin, :offset, :gene_end
DEFINE sql:select-option "order" 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 ?gene ?gene_type ?seq ?seq_type ?gene_loc ?gene_begin ?gene_end ?ncbi_taxid ?obj ?b ?e ?strand ?obj_label ?label ?obj_name ?pb ?pe FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> WHERE { { SELECT ?gene ?gene_type ?seq ?seq_type ?gene_loc ?gene_begin ?gene_end ?ncbi_taxid ?obj ?b ?e ?strand ?obj_label WHERE { VALUES ?locus_tag { "all1455" } # param "slr0473" VALUES ?seq_type { obo:SO_0000340 obo:SO_0000155 } # chromosome, plasmid VALUES ?gene_type { obo:SO_0000316 obo:SO_0000252 obo:SO_0000253 } # CDS, rRNA, tRNA VALUES ?faldo_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition } VALUES ?offset { 2000 } # gene ?gene insdc:feature_locus_tag ?locus_tag. ?gene a ?gene_type. # seq ?gene obo:so_part_of+ ?seq. ?seq a ?seq_type. # faldo ?gene faldo:location ?gene_loc. ?gene_loc faldo:begin/faldo:position ?gene_begin. ?gene_loc faldo:end/faldo:position ?gene_end. # taxonomy ncbi ?seq rdfs:seeAlso ?taxonomy . ?taxonomy a idorg:Taxonomy . ?taxonomy rdfs:label ?ncbi_taxid . # objects around the gene ?obj obo:so_part_of+ ?seq . ?obj faldo:location ?faldo . ?faldo faldo:begin/rdf:type ?faldo_type . ?faldo_type rdfs:label ?strand . ?faldo faldo:begin/faldo:position ?b . ?faldo faldo:end/faldo:position ?e . FILTER (!(?b > ?gene_end + ?offset || ?e < ?gene_begin - ?offset)) ?obj rdf:type ?obj_type . ?obj_type rdfs:label ?obj_label . FILTER (?obj_type != obo:SO_0000704) # gene } } OPTIONAL { ?obj insdc:feature_locus_tag ?label . } OPTIONAL { ?obj insdc:feature_product ?obj_name . } OPTIONAL { ?obj obo:so_has_part/rdf:rest*/rdf:first ?part . ?part faldo:begin/faldo:position ?pb . ?part faldo:end/faldo:position ?pe . } } ORDER BY ?b
Gene attributes
スタンザファイル名:gene_attributes 旧スタンザファイル名:gene_attributes
DEFINE sql:select-option "order" 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 distinct ?locus_tag ?gene_type_label ?gene_symbol ?seq_label ?seq_type_label REPLACE(?refseq_label,"RefSeq:","") AS ?refseq_label ?organism ?taxid ?faldo_begin_position ?faldo_end_position ?stand ?insdc_location CONCAT("http://togows.dbcls.jp/entry/nucleotide/", REPLACE(?refseq_label,"RefSeq:",""),"/seq/", ?insdc_location) AS ?seqence FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> WHERE { values ?locus_tag { "slr0473" } values ?seq_type { obo:SO_0000340 obo:SO_0000155 } values ?gene_type { obo:SO_0000704 obo:SO_0000252 obo:SO_0000253 } values ?faldo_stand_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition } ?gene insdc:feature_locus_tag ?locus_tag ; a ?gene_type ; obo:so_part_of ?seq . OPTIONAL { ?gene insdc:feature_gene ?gene_symbol. } ?gene_type rdfs:label ?gene_type_label . #sequence ?seq rdfs:label ?seq_label ; a ?seq_type ; rdfs:seeAlso ?refseq ; insdc:source_organism ?organism ; rdfs:seeAlso ?taxonomy . ?seq_type rdfs:label ?seq_type_label . ?refseq a idorg:RefSeq ; rdfs:label ?refseq_label . ?taxonomy a idorg:Taxonomy ; rdfs:label ?taxid . #faldo ?gene faldo:location ?faldo . ?faldo insdc:location ?insdc_location ; faldo:begin ?faldo_begin ; faldo:end ?faldo_end . ?faldo_begin faldo:position ?faldo_begin_position ; rdf:type ?faldo_stand_type . ?faldo_end faldo:position ?faldo_end_position . ?faldo_stand_type rdfs:label ?stand . }
改良版
Genomic contextと同様にOPTIONALを最後に追加して、それ以前のクエリを副問い合わせに変更。
DEFINE sql:select-option "order" 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 DISTINCT ?locus_tag ?gene_type_label ?seq_label ?seq_type_label ?gene_symbol REPLACE(?refseq_label,"RefSeq:","") AS ?refseq_label ?organism ?taxid ?faldo_begin_position ?faldo_end_position ?stand ?insdc_location CONCAT("http://togows.dbcls.jp/entry/nucleotide/", REPLACE(?refseq_label,"RefSeq:",""),"/seq/", ?insdc_location) AS ?seqence FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> FROM <http://togogenome.org/graph/faldo/> { { SELECT DISTINCT ?gene ?locus_tag ?gene_type_label ?seq_label ?seq_type_label ?refseq_label ?organism ?taxid ?faldo_begin_position ?faldo_end_position ?stand ?insdc_location WHERE { VALUES ?locus_tag { "all1455" } #{ "all1455" } #{ "slr0473" } VALUES ?seq_type { obo:SO_0000340 obo:SO_0000155 } VALUES ?gene_type { obo:SO_0000704 obo:SO_0000252 obo:SO_0000253 } VALUES ?faldo_stand_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition } ?gene ?p ?locus_tag ; a ?gene_type ; obo:so_part_of ?seq . ?gene_type rdfs:label ?gene_type_label . #sequence ?seq rdfs:label ?seq_label ; a ?seq_type ; rdfs:seeAlso ?refseq ; insdc:source_organism ?organism ; rdfs:seeAlso ?taxonomy . ?seq_type rdfs:label ?seq_type_label . ?refseq a idorg:RefSeq ; rdfs:label ?refseq_label . ?taxonomy a idorg:Taxonomy ; rdfs:label ?taxid . #faldo ?gene faldo:location ?faldo . ?faldo insdc:location ?insdc_location ; faldo:begin ?faldo_begin ; faldo:end ?faldo_end . ?faldo_begin faldo:position ?faldo_begin_position ; rdf:type ?faldo_stand_type . ?faldo_end faldo:position ?faldo_end_position . ?faldo_stand_type rdfs:label ?stand . } } OPTIONAL { ?gene insdc:feature_gene ?gene_symbol. } }
Nucleotide sequence
スタンザファイル名:nucleotide_sequences 旧スタンザファイル名:nucleotide_sequences
DEFINE sql:select-option "order" 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 DISTINCT ?locus_tag CONCAT("http://togows.dbcls.jp/entry/nucleotide/", replace(?refseq_label,"RefSeq:",""),"/seq/", ?insdc_location) as ?nuc_seq_pos FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> WHERE { values ?locus_tag { "all1455" } values ?seq_type { obo:SO_0000340 obo:SO_0000155 } values ?gene_type { obo:SO_0000704 obo:SO_0000252 obo:SO_0000253 } ?gene ?p ?locus_tag ; a ?gene_type ; obo:so_part_of ?seq . ?seq a ?seq_type ; rdfs:seeAlso ?refseq . ?refseq a idorg:RefSeq ; rdfs:label ?refseq_label . ?gene faldo:location ?faldo . ?faldo insdc:location ?insdc_location . }
Protein attributes
スタンザファイル名:protein_attributes 旧スタンザファイル名:protein_attributes
Protein sequence
スタンザファイル名:protein_sequences 旧スタンザファイル名:protein_sequences
Protein general annotation
スタンザファイル名:protein_general_annotation 旧スタンザファイル名:protein_general_annotation
Protein ontologies
スタンザファイル名:protein_ontologies 旧スタンザファイル名:protein_ontologies
Protein sequence annotation
スタンザファイル名:protein_sequence_annotation 旧スタンザファイル名:protein_sequence_annotation
Pfam plot
スタンザファイル名:protein_pfam_plot
旧スタンザファイル名:pfam_plot
- Genomeの情報を取得
Genomeの情報はGenome plotの3クエリをそのまま使用する
クエリ
- locusタグからUniprotのproteinIDを取得
これはスタンザフレームワークで関数化されており、#{uniprot_url_from_togogenome(gene_id)}で取得が可能クエリ
- 指定されたProteinに含まれるPfam名一覧を取得
DEFINE sql:select-option "order" PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxonomy: <http://purl.uniprot.org/taxonomy/> PREFIX dct: <http://purl.org/dc/terms/> SELECT DISTINCT REPLACE(STR(?ref), "http://purl.uniprot.org/pfam/","") AS ?pfam_id FROM <http://togogenome.org/graph/uniprot/> WHERE { ?protein rdfs:seeAlso <http://purl.uniprot.org/refseq/NP_487471.1> ; up:organism taxonomy:103690 . ?protein rdfs:seeAlso ?ref . ?ref up:database ?database . ?database up:abbreviation ?abbr FILTER (?abbr ='Pfam'). }
- 生物種毎に指定したPfamIDの数と種類数を取得
DEFINE sql:select-option "order" PREFIX up: <http://purl.uniprot.org/core/> PREFIX tax: <http://purl.uniprot.org/taxonomy/> PREFIX pfam: <http://purl.uniprot.org/pfam/> SELECT REPLACE(STR(?tax), "http://purl.uniprot.org/taxonomy/", "http://identifiers.org/taxonomy/") AS ?tax_id (SUM(?hits) as ?num_pfam) (COUNT(DISTINCT(?prot_id)) AS ?num_pfam_protein) FROM <http://togogenome.org/graph/uniprot/> WHERE { ?prot_id rdfs:seeAlso pfam:PF00400 . ?prot_id up:organism ?tax . ?id rdf:subject ?prot_id . ?id rdf:object pfam:PF00400 . ?id up:hits ?hits . } GROUP BY ?tax
Orthologs
スタンザファイル名:
旧スタンザファイル名:
- locusタグからUniprotのproteinIDを取得
これはスタンザフレームワークで関数化されており、#{uniprot_url_from_togogenome(gene_id)}で取得が可能クエリ
- UniProtIDを取得
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxonomy: <http://purl.uniprot.org/taxonomy/> SELECT DISTINCT ?upid FROM <http://togogenome.org/graph/uniprot/> WHERE { ?upid up:organism taxonomy:103690 ; rdfs:seeAlso <http://purl.uniprot.org/refseq/NP_485497.1> . }
- Proteinのオーソログリストを取得
※このクエリはmbgdのエンドポイントへ投げる
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX mbgd: <http://mbgd.genome.ad.jp/owl/mbgd.owl#> PREFIX orth: <http://mbgd.genome.ad.jp/owl/ortholog.owl#> PREFIX uniprot: <http://purl.uniprot.org/uniprot/> PREFIX uniprotCore: <http://purl.uniprot.org/core/> SELECT ?protein WHERE { ?group a orth:OrthologGroup ; orth:member/mbgd:gene/mbgd:uniprot <http://purl.uniprot.org/uniprot/P00457> ; orth:member/mbgd:gene/mbgd:uniprot ?protein . }
Protein references
スタンザファイル名:protein_references 旧スタンザファイル名:protein_references
Protein reaction fgc list
スタンザファイル名:protein_reaction_fgc_list
- locus_tagからuniprotIDを取得
- uniprotIDからEC_numberを取得
PREFIX up: <http://purl.uniprot.org/core/> PREFIX taxonomy: <http://purl.uniprot.org/taxonomy/> SELECT DISTINCT ?ec_name FROM <http://togogenome.org/graph/uniprot/> WHERE { ?protein up:organism taxonomy:103690 ; rdfs:seeAlso <http://purl.uniprot.org/refseq/NP_485497.1> ; up:recommendedName ?recommended_name_node . ?recommended_name_node up:ecName ?ec_name . }
- EC_numberからReactionを取得
※このクエリはreactionontologyのエンドポイントへ投げる ※reactionのデータは整備中
PREFIX piero: <http://reactionontology.org/ontology/piero#> PREFIX entry: <http://www.kegg.jp/entry/> SELECT ?fgc COUNT(?fgc) AS ?cnt FROM <http://reactionontology> WHERE { entry:1.18.6.1 piero:catalyzes ?reaction. ?reaction piero:has_rclass ?rclass . ?rclass rdf:instanceOf ?fgc . } GROUP BY ?fgc ORDER BY DESC (?cnt)
Organism Report
Organism names
スタンザファイル名:organism_names 旧スタンザファイル名:organism_name
PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX taxid: <http://identifiers.org/taxonomy/> SELECT ?name_type ?name_type_label ?name FROM <http://togogenome.org/graph/taxonomy/> WHERE { VALUES ?name_type { taxo:scientificName taxo:synonym taxo:preferredSynonym taxo:acronym taxo:preferredAcronym taxo:anamorph taxo:teleomorph taxo:misnomer taxo:commonName taxo:preferredCommonName taxo:inPart taxo:includes taxo:equivalentName taxo:genbankSynonym taxo:genbankCommonName taxo:authority taxo:misspelling } taxid:1148 ?name_type ?name . ?name_type rdfs:label ?name_type_label . }
Genome information
スタンザファイル名:genome_information 旧スタンザファイル名:genome_information
DEFINE sql:select-option "order" PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX insdc: <http://insdc.org/owl/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX idtax: <http://identifiers.org/taxonomy/> SELECT ?bioproject ?bioproject_id ?refseq_version ?desc ?replicon_type ?sequence_length count(?gene_locus_tag) as ?gene_cnt count(?trna_locus_tag) as ?trna_cnt count(?rrna_locus_tag) as ?rrna_cnt count(?other_locus_tag) as ?other_cnt FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/so/> WHERE { ?seq rdfs:seeAlso idtax:1148 ; rdfs:label ?desc ; rdfs:seeAlso ?bioproject ; insdc:sequence_version ?refseq_version ; insdc:sequence_length ?sequence_length ; rdfs:seeAlso ?refseq_link ; a ?so FILTER (?so = obo:SO_0000340 || ?so = obo:SO_0000155) . ?so rdfs:label ?replicon_type . ?bioproject a idorg:BioProject ; rdfs:label ?bioproject_id . ?refseq_link a idorg:RefSeq . { ?gene obo:so_part_of ?seq ; a obo:SO_0000704 ; insdc:feature_locus_tag ?gene_locus_tag . } UNION { ?trna obo:so_part_of ?seq ; a obo:SO_0000253 ; insdc:feature_locus_tag ?trna_locus_tag . } UNION { ?rrna obo:so_part_of ?seq ; a obo:SO_0000252 ; insdc:feature_locus_tag ?rrna_locus_tag . } UNION { ?other obo:so_part_of ?seq ; a ?obotype ; insdc:feature_locus_tag ?other_locus_tag FILTER (?obotype != obo:SO_0000704 && ?obotype != obo:SO_0000253 && ?obotype != obo:SO_0000252) . } }
Ortholog profile
スタンザファイル名:
旧スタンザファイル名:
※このクエリはmbgdのエンドポイントへ投げる
DEFINE sql:select-option "order" PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX mbgd: <http://mbgd.genome.ad.jp/owl/mbgd.owl#> PREFIX orth: <http://mbgd.genome.ad.jp/owl/ortholog.owl#> PREFIX uniprot: <http://purl.uniprot.org/uniprot/> PREFIX uniprotCore: <http://purl.uniprot.org/core/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> SELECT ?group ?comment COUNT(?member) AS ?count WHERE { ?tax rdfs:subClassOf+ taxon:562 . ?organism orth:taxon ?tax . ?member mbgd:organism ?organism . ?group orth:member ?member ; mbgd:description ?comment ; a orth:OrthologGroup . } ORDER BY DESC (?count) limit 10
Taxonomic information
スタンザファイル名:lineage_information
旧スタンザファイル名:lineage_information
上位層
PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX taxid: <http://identifiers.org/taxonomy/> SELECT REPLACE(STR(?tax), "http://identifiers.org/taxonomy/", "") AS ?tax_no ?tax AS ?tax_link ?tax_label REPLACE(STR(?rank), "http://ddbj.nig.ac.jp/ontologies/taxonomy#", "") AS ?rank FROM <http://togogenome.org/graph/taxonomy/> WHERE { ?search_tax rdfs:label ?o FILTER (?search_tax = taxid:1148 ) . ?search_tax rdfs:subClassOf ?tax OPTION (transitive, t_direction 1, t_min(0), t_step("step_no") as ?step) . ?tax rdfs:label ?tax_label . OPTIONAL { ?tax taxo:rank ?rank . } FILTER(?tax != taxid:1) } ORDER BY DESC(?step)
下位層
PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX taxid: <http://identifiers.org/taxonomy/> SELECT REPLACE(STR(?tax) ,"http://identifiers.org/taxonomy/" ,"" ) AS ?tax_no ?tax AS ?tax_link ?tax_label REPLACE(STR(?rank) ,"http://ddbj.nig.ac.jp/ontologies/taxonomy#" ,"" ) AS ?rank FROM <http://togogenome.org/graph/taxonomy/> WHERE { ?search_tax rdfs:label ?label FILTER (?search_tax = taxid:1148 ) . ?tax rdfs:subClassOf ?search_tax . ?tax rdfs:label ?tax_label . OPTIONAL { ?tax taxo:rank ?rank . } }
Taxonomic linage
スタンザファイル名:taxonomy_linage 旧スタンザファイル名:taxonomy_tree
PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX taxid: <http://identifiers.org/taxonomy/> SELECT ?tax ?parent ?tax_label ?rank FROM <http://togogenome.org/graph/taxonomy/> WHERE { { ?search_tax rdfs:label ?label FILTER (?search_tax = taxid:1148 ) . ?search_tax rdfs:subClassOf* ?tax. ?tax rdfs:label ?tax_label . OPTIONAL { ?tax rdfs:subClassOf ?parent . } OPTIONAL { ?tax taxo:rank ?rank . } } UNION { ?search_tax rdfs:label ?label FILTER (?search_tax = taxid:1148) . ?tax rdfs:subClassOf ?search_tax . ?tax rdfs:label ?tax_label . OPTIONAL { ?tax rdfs:subClassOf ?parent . } OPTIONAL { ?tax taxo:rank ?rank . } } }
Culture collections
スタンザファイル名:organism_culture_collections
旧スタンザファイル名:brc_metadata
何を出力するかはT.B.D
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX taxid: <http://identifiers.org/taxonomy/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?strain_id ?strain_number ?strain_name ?typeStrain ?isolated_from ?opt_temp ?min_temp ?max_temp ?history ?application ?taxid_a ?tax_label_a ?taxid_b1 ?tax_label_b1 ?taxid_b2 ?tax_label_b2 ?taxid_c ?tax_label_c (sql:GROUP_DIGEST(?other_link, ', ', 1000, 1)) AS ?other_links (sql:GROUP_DIGEST(?ref_link, ', ', 1000, 1)) AS ?ref_links FROM <http://togogenome.org/graph/taxonomy/> FROM <http://togogenome.org/graph/brc/> WHERE { { SELECT DISTINCT ?strain_id { VALUES ?related_type { mccv:MCCV_000056 mccv:MCCV_000022 mccv:MCCV_000057 mccv:MCCV_000023} ?strain_id ?related_type taxid:228599 . } } OPTIONAL { ?strain_id mccv:MCCV_000010 ?strain_number . } OPTIONAL { ?strain_id mccv:MCCV_000012 ?strain_name . } OPTIONAL { ?strain_id mccv:MCCV_000017 ?typeStrain . } OPTIONAL { ?strain_id mccv:MCCV_000030 ?isolated_from . } OPTIONAL { ?strain_id mccv:MCCV_000014 ?opt_temp . } OPTIONAL { ?strain_id mccv:MCCV_000015 ?min_temp . } OPTIONAL { ?strain_id mccv:MCCV_000016 ?max_temp . } OPTIONAL { ?strain_id mccv:MCCV_000027 ?history . } OPTIONAL { ?strain_id mccv:MCCV_000033 ?application . } OPTIONAL { ?strain_id mccv:MCCV_000056 ?taxid_a FILTER (STRSTARTS(STR(?taxid_a), "http://identifiers.org")) . ?taxid_a taxo:scientificName ?tax_label_a . } OPTIONAL { ?strain_id mccv:MCCV_000022 ?taxid_b1 FILTER (STRSTARTS(STR(?taxid_b1), "http://identifiers.org")) . ?taxid_b1 taxo:scientificName ?tax_label_b1 . } OPTIONAL { ?strain_id mccv:MCCV_000057 ?taxid_b2 FILTER (STRSTARTS(STR(?taxid_b2), "http://identifiers.org")) . ?taxid_b2 taxo:scientificName ?tax_label_b2 . } OPTIONAL { ?strain_id mccv:MCCV_000023 ?taxid_c FILTER (STRSTARTS(STR(?taxid_c), "http://identifiers.org")) . ?taxid_c taxo:scientificName ?tax_label_c . } OPTIONAL { ?strain_id mccv:MCCV_000024/mccv:MCCV_000026 ?other_link . } OPTIONAL { ?strain_id dcterms:references/mccv:MCCV_000047 ?ref_id . ?strain_id mccv:MCCV_000010 ?strain_no . BIND (IF(STRSTARTS(?strain_no, "JCM"), CONCAT("http://www.jcm.riken.go.jp/cgi-bin/jcm/jcm_ref?REF=", ?ref_id), IF(STRSTARTS(?strain_no, "NBRC"), CONCAT("http://www.nbrc.nite.go.jp/NBRC2/NBRCReferenceDetailServlet?NO=", ?ref_id), "")) AS ?ref_link) . } } GROUP BY ?strain_id ?strain_number ?strain_name ?typeStrain ?isolated_from ?opt_temp ?min_temp ?max_temp ?history ?application ?taxid_a ?tax_label_a ?taxid_b1 ?tax_label_b1 ?taxid_b2 ?tax_label_b2 ?taxid_c ?tax_label_c
出力項目縮小版
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX taxid: <http://identifiers.org/taxonomy/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?strain_id ?strain_number ?strain_name ?isolated_from ?history ?application (sql:GROUP_DIGEST(?other_link, ', ', 1000, 1)) AS ?other_collections FROM <http://togogenome.org/graph/taxonomy/> FROM <http://togogenome.org/graph/brc/> WHERE { { SELECT DISTINCT ?strain_id { VALUES ?related_type { mccv:MCCV_000056 mccv:MCCV_000022 mccv:MCCV_000057 mccv:MCCV_000023} ?strain_id ?related_type taxid:228599 . } } OPTIONAL { ?strain_id mccv:MCCV_000010 ?strain_number . } OPTIONAL { ?strain_id mccv:MCCV_000012 ?strain_name . } OPTIONAL { ?strain_id mccv:MCCV_000030 ?isolated_from . } OPTIONAL { ?strain_id mccv:MCCV_000027 ?history . } OPTIONAL { ?strain_id mccv:MCCV_000033 ?application . } OPTIONAL { ?strain_id mccv:MCCV_000024/mccv:MCCV_000026 ?other_link . } } GROUP BY ?strain_id ?strain_number ?strain_name ?isolated_from ?history ?application
出力項目変更版
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX taxid: <http://identifiers.org/taxonomy/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?strain_id ?strain_number ?strain_name AS ?organism_name ?isolation (sql:GROUP_DIGEST(?env, '|| ', 1000, 1)) AS ?env_links ?type_strain_label ?application (sql:GROUP_DIGEST(?other_link, ', ', 1000, 1)) AS ?other_collections FROM <http://togogenome.org/graph/taxonomy/> FROM <http://togogenome.org/graph/brc/> FROM <http://togogenome.org/graph/meo/> WHERE { { SELECT DISTINCT ?strain_id { VALUES ?related_type { mccv:MCCV_000056 mccv:MCCV_000022 mccv:MCCV_000057 } ?strain_id ?related_type taxid:43687 . } } OPTIONAL { ?strain_id mccv:MCCV_000010 ?strain_number . } OPTIONAL { ?strain_id mccv:MCCV_000012 ?strain_name . } OPTIONAL { ?strain_id mccv:MCCV_000030 ?isolation . } OPTIONAL { ?strain_id mccv:MCCV_000059|mccv:MCCV_000060 ?meo_id . ?meo_id rdfs:label ?meo_label . BIND (CONCAT(REPLACE(STR(?meo_id),"http://purl.jp/bio/11/meo/",""), ":", ?meo_label) AS ?env ) } OPTIONAL { ?strain_id mccv:MCCV_000017 ?type_strain . BIND (IF(?type_strain = 1, "yes","no") AS ?type_strain_label)} OPTIONAL { ?strain_id mccv:MCCV_000033 ?application . } OPTIONAL { ?strain_id mccv:MCCV_000024/mccv:MCCV_000026 ?other_link . } } GROUP BY ?strain_id ?strain_number ?strain_name ?type_strain_label ?isolation ?application
Medium
Taxonomyに対するMedium一覧を表示する(調査用)
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX taxid: <http://identifiers.org/taxonomy/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?tax_id ?label (sql:GROUP_DIGEST(?strain_number, ',', 1000, 1)) AS ?strain_numbers (sql:GROUP_DIGEST(?medium_id, ',', 1000, 1)) AS ?mediums COUNT(DISTINCT ?medium) AS ?cnt FROM <http://togogenome.org/graph/brc/> FROM <http://togogenome.org/graph/taxonomy/> WHERE { { SELECT DISTINCT ?strain_id ?tax_id { ?strain_id mccv:MCCV_000056 ?tax_id FILTER (STRSTARTS(STR(?tax_id),"http://identifiers.org/taxonomy/")). } } ?strain_id mccv:MCCV_000010 ?strain_number . ?strain_id mccv:MCCV_000018 ?medium . BIND (REPLACE(REPLACE(STR(?medium),"http://www.jcm.riken.go.jp/cgi-bin/jcm/jcm_grmd\\?GRMD=","JCM:"),"http://www.nbrc.nite.go.jp/NBRC2/NBRCMediumDetailServlet\\?NO=","NBRC:") AS ?medium_id) ?tax_id rdfs:label ?label } GROUP BY ?tax_id ?label ORDER BY DESC 5
taxid「1351」のMedium情報
培地の基本情報を取得
DEFINE sql:select-option "order" PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX gmo: <http://purl.jp/bio/11/gmo#> SELECT DISTINCT ?medium_id ?medium_type_label ?medium_name FROM <http://togogenome.org/graph/brc/> FROM <http://togogenome.org/graph/gmo/> WHERE { VALUES ?classification { gmo:GMO_000015 gmo:GMO_000016 gmo:GMO_000008 gmo:GMO_000009 } { SELECT DISTINCT ?medium { ?strain_id mccv:MCCV_000056 <http://identifiers.org/taxonomy/1351>. ?strain_id mccv:MCCV_000018 ?medium . } } ?medium gmo:GMO_000101 ?medium_id . ?medium gmo:GMO_000111 ?medium_type . ?medium_type rdfs:label ?medium_type_label . OPTIONAL { ?medium gmo:GMO_000102 ?medium_name }. }
medium classification
DEFINE sql:select-option "order" PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX gmo: <http://purl.jp/bio/11/gmo#> SELECT ?medium ?classification ?class_label (sql:GROUP_DIGEST(?ingredient_label , ', ', 1000, 1)) AS ?ingredients FROM <http://togogenome.org/graph/brc/> FROM <http://togogenome.org/graph/gmo/> WHERE { VALUES ?classification { gmo:GMO_000015 gmo:GMO_000016 gmo:GMO_000008 gmo:GMO_000009 } { SELECT DISTINCT ?medium { ?strain_id mccv:MCCV_000056 <http://identifiers.org/taxonomy/1351>. ?strain_id mccv:MCCV_000018 ?medium . } } ?medium gmo:GMO_000104 ?ingredient . ?ingredient rdfs:subClassOf* ?classification . ?ingredient rdfs:label ?ingredient_label FILTER (lang(?ingredient_label) = "en") . ?classification rdfs:label ?class_label . } GROUP BY ?medium ?classification ?class_label
Phenotype information
スタンザファイル名:organism_phyenotype 旧スタンザファイル名:phenotype_information
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX up: <http://purl.uniprot.org/core/> PREFIX idtax: <http://purl.uniprot.org/taxonomy/> SELECT ?mpo ?phenotype (GROUP_CONCAT(?value; SEPARATOR = ", ") AS ?value) FROM <http://togogenome.org/graph/mpo/> FROM <http://togogenome.org/graph/gold/> WHERE { idtax:383372 ?mpo ?o . ?mpo rdfs:label ?phenotype . FILTER (lang(?phenotype) = "en") . OPTIONAL { ?o rdfs:label ?o2 . FILTER (lang(?o2) = "en") . } BIND( IF(bound(?o2) ,?o2 , ?o) as ?value ) } GROUP BY ?mpo ?phenotype ORDER BY ?mpo
Organism habitat
DEFINE sql:select-option "order" PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT DISTINCT ?linage_meo_id ?label ?parent_meo_id ?is_sampled_meo FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/meo/> WHERE { { SELECT DISTINCT ?meo_id WHERE { VALUES ?p_env { meo:MEO_0000437 meo:MEO_0000440 } ?seq rdfs:seeAlso ?tax_id FILTER (?tax_id = <http://identifiers.org/taxonomy/103690>) . ?tax_id a idorg:Taxonomy . ?gold_id mccv:MCCV_000020 ?tax_id . ?gold_id ?p_env ?meo_id . } } GRAPH <http://togogenome.org/graph/meo/> { ?meo_id rdfs:subClassOf* ?linage_meo_id . OPTIONAL { ?linage_meo_id rdfs:label ?label . } OPTIONAL { ?linage_meo_id rdfs:subClassOf ?parent_meo_id .} BIND ( IF(?meo_id = ?linage_meo_id, "TRUE","FALSE") AS ?is_sampled_meo) . } }
Genomic plot
スタンザファイル名:genome_plot
旧スタンザファイル名:taxonomy_plot
genomeサイズ + Organism Name + Phenotype
DEFINE sql:select-option "order" PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX mpo:<http://purl.jp/bio/01/mpo#> PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX insdc: <http://insdc.org/owl/> PREFIX idorg:<http://rdf.identifiers.org/database/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?tax ?organism_name ?bioProject ?genome_length (sql:GROUP_DIGEST (?cell_shape_label, ', ', 1000, 1)) AS ?cell_shape_label (sql:GROUP_DIGEST (?temp_range_label, ', ', 1000, 1)) AS ?temp_range_label (sql:GROUP_DIGEST (?oxy_req_label, ', ', 1000, 1)) AS ?oxy_req_label ?opt_temp ?min_temp ?max_temp ?opt_ph ?min_ph ?max_ph FROM <http://togogenome.org/graph/refseq/> FROM <http://togogenome.org/graph/mpo/> FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/taxonomy/> { { SELECT ?tax ?bioProject SUM(?seq_len) AS ?genome_length { ?tax rdf:type idorg:Taxonomy . ?seq rdfs:seeAlso ?tax ; rdf:type ?obo_type FILTER(?obo_type IN (obo:SO_0000340, obo:SO_0000155 )) . ?seq insdc:sequence_length ?seq_len ; rdfs:seeAlso ?bioProject . ?bioProject rdf:type idorg:BioProject . } GROUP BY ?tax ?bioProject } OPTIONAL { ?tax mpo:MPO_10001/rdfs:label ?cell_shape_label FILTER (lang(?cell_shape_label) = "en") . } OPTIONAL { ?tax mpo:MPO_10003/rdfs:label ?temp_range_label FILTER (lang(?temp_range_label) = "en") . } OPTIONAL { ?tax mpo:MPO_10002/rdfs:label ?oxy_req_label FILTER (lang(?oxy_req_label) = "en") . } OPTIONAL { ?tax mpo:MPO_10009 ?opt_temp . } OPTIONAL { ?tax mpo:MPO_10010 ?min_temp . } OPTIONAL { ?tax mpo:MPO_10011 ?max_temp . } OPTIONAL { ?tax mpo:MPO_10005 ?opt_ph . } OPTIONAL { ?tax mpo:MPO_10006 ?min_ph . } OPTIONAL { ?tax mpo:MPO_10007 ?max_ph . } ?tax taxo:scientificName ?organism_name } GROUP BY ?tax ?organism_name ?genome_length ?bioProject ?opt_temp ?min_temp ?max_temp ?opt_ph ?min_ph ?max_ph
環境名(第一階層のみを取得)
PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX mccv: <http://purl.jp/bio/01/mccv#> SELECT ?tax (sql:GROUP_DIGEST (?label, ', ', 1000, 1)) as ?habitat FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/meo/> WHERE { VALUES ?p_env { meo:MEO_0000437 meo:MEO_0000440 } ?gold mccv:MCCV_000020 ?tax FILTER regex(?tax, "^http://identifiers.org/") . ?gold ?p_env ?meo . ?meo a owl:Class ; rdfs:subClassOf* ?parent . ?parent rdfs:label ?label . ?parent meo:MEO_0000442 "1" . } GROUP BY ?tax
Gene,rRNA,tRNA数の取得
このクエリを発行する前に、集計結果トリプルを生成してインポートしておく必要がある。集計クエリ
PREFIX togo: <http://togogenome.org/stats/> SELECT ?tax ?project_id ?num_gene ?num_rrna ?num_trna FROM <http://togogenome.org/graph/stats/> WHERE { ?tax togo:genome_stats ?blank . ?blank rdfs:seeAlso ?project_id . ?blank togo:gene_number ?num_gene . ?blank togo:rrna_number ?num_rrna . ?blank togo:trna_number ?num_trna . }
Pathogen information
スタンザファイル名:organism_pathogen_information 旧スタンザファイル名:pathogen_info
DEFINE sql:select-option "order" PREFIX pdo: <http://purl.jp/bio/11/pdo/> PREFIX taxid: <http://identifiers.org/taxonomy/> SELECT REPLACE(STR(?tax_id),"http://identifiers.org/taxonomy/","") AS ?tax_no ?bacterialName (GROUP_CONCAT(?diseaseName; SEPARATOR = ", ") AS ?diseaseNameSet) ?infectiousType ?strainType FROM <http://togogenome.org/graph/pdo/> FROM <http://togogenome.org/graph/pdo_mapping/> FROM <http://togogenome.org/graph/taxonomy/> WHERE { ?tax_id rdfs:subClassOf* taxid:1763 ; rdfs:label ?bacterialName ; pdo:isAssociatedTo ?blank . ?blank ?p ?disease FILTER (?p IN(pdo:mayCaused, pdo:isRelatedTo)) . ?disease rdfs:label ?diseaseName . OPTIONAL { ?tax_id pdo:isAssociatedTo/pdo:infectiousType ?infectiousType . } OPTIONAL { ?tax_id pdo:isAssociatedTo/pdo:strainType ?strainType . } }
Organism cross references
スタンザファイル名:organism_cross_references 旧スタンザファイル名:taxonomy_cross_references
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX insdc: <http://insdc.org/owl/> PREFIX idtax: <http://identifiers.org/taxonomy/> SELECT ?label ?link FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/refseq/> WHERE { { SELECT REPLACE(str(?gold),"http://www.genomesonline.org/cgi-bin/GOLD/GOLDCards.cgi\\?goldstamp=", "GOLD:" ) as ?label ?gold as ?link FROM <http://togogenome.org/gold/> WHERE { ?gold mccv:MCCV_000020 idtax:1148 . } } UNION { SELECT DISTINCT ?label ?xref as ?link FROM <http://togogenome.org/graph/refseq/> WHERE { values ?tax_id { idtax:1148 } values ?so { obo:SO_0000340 obo:SO_0000155 } ?seq rdfs:seeAlso ?tax_id . ?seq a ?so . ?seq rdfs:seeAlso ?xref . ?xref rdfs:label ?label . } ORDER BY ?label } }
Genome cross references
スタンザファイル名:genome_cross_references 旧スタンザファイル名:genome_cross_references
Environment Report
Environment attributes
スタンザファイル名:environment_attributes 旧スタンザファイル名:
DEFINE sql:select-option "order" PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT REPLACE(STR(?meo_id),"http://purl.jp/bio/11/meo/","") AS ?meo_no ?meo_label ?meo_definition AS ?description (sql:GROUP_DIGEST(?exact_synonym, ', ', 1000, 1)) AS ?exact_synonyms FROM <http://togogenome.org/graph/meo/> WHERE { meo:MEO_0000029 rdfs:label ?meo_label . ?meo_id rdfs:label ?meo_label . OPTIONAL { ?meo_id meo:MEO_0000443 ?meo_definition . } OPTIONAL { ?meo_id meo:MEO_0000776 ?exact_synonym . } } GROUP BY ?meo_id ?meo_label ?meo_definition
Environmental linage
上位層
PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT REPLACE(STR(?meo), "http://purl.jp/bio/11/meo/", "") AS ?meo_no ?meo_label FROM <http://togogenome.org/graph/meo/> WHERE { ?search_meo rdfs:label ?o FILTER (?search_meo = meo:MEO_0000029 ) . ?search_meo rdfs:subClassOf ?meo OPTION (transitive, t_direction 1, t_min(0), t_step("step_no") as ?step) . ?meo rdfs:label ?meo_label . } ORDER BY DESC(?step)
下位層
PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT REPLACE(STR(?meo), "http://purl.jp/bio/11/meo/", "") AS ?meo_no ?meo_label FROM <http://togogenome.org/graph/meo/> WHERE { ?search_meo rdfs:label ?o FILTER (?search_meo = meo:MEO_0000029 ) . ?meo rdfs:subClassOf ?search_meo . ?meo rdfs:label ?meo_label . }
Inhabitants statistics
DEFINE sql:select-option "order" PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT ?type ?cnt FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/meo/> FROM <http://togogenome.org/graph/brc/> WHERE { { SELECT ?type COUNT(DISTINCT ?gold) AS ?cnt { VALUES ?meo_mapping { meo:MEO_0000437 meo:MEO_0000440 } ?gold_meo_id rdfs:subClassOf* meo:MEO_0000004 . ?gold ?meo_mapping ?gold_meo_id . BIND ("GOLD" AS ?type ). } } UNION { SELECT ?type COUNT(DISTINCT ?strain) AS ?cnt { VALUES ?meo_strain_mapping { mccv:MCCV_000059 mccv:MCCV_000060 } ?strain_meo_id rdfs:subClassOf* meo:MEO_0000004 . ?strain ?meo_strain_mapping ?strain_meo_id . BIND (IF(STRSTARTS(STR(?strain), "http://www.nbrc.nite.go.jp/"), "NBRC",IF(STRSTARTS(STR(?strain), "http://www.jcm.riken.go.jp/"),"JCM","")) AS ?type) . } GROUP BY ?type } }
Inhabitants
GOLD samples
DEFINE sql:select-option "order" PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?gold AS ?source_link REPLACE(STR(?gold) ,"http://www.genomesonline.org/cgi-bin/GOLD/GOLDCards.cgi\\?goldstamp=" ,"" ) AS ?source_id ?organism_name REPLACE(STR(?tax_id) ,"http://identifiers.org/taxonomy/" ,"" ) AS ?tax_no "" AS ?isolation (sql:GROUP_DIGEST(?env, '||', 1000, 1)) AS ?env_links FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/meo/> FROM <http://togogenome.org/graph/taxonomy/> { VALUES ?meo_mapping { meo:MEO_0000437 meo:MEO_0000440 } ?meo_id rdfs:subClassOf* meo:MEO_0000004 . ?gold ?meo_mapping ?meo_id . ?meo_id rdfs:label ?meo_label . BIND (CONCAT(REPLACE(STR(?meo_id),"http://purl.jp/bio/11/meo/",""), ?meo_label) AS ?env ) OPTIONAL { ?gold mccv:MCCV_000020 ?tax_id . ?tax_id taxo:scientificName ?organism_name } } GROUP BY ?gold ?tax_id ?organism_name
Culture collections
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT ?strain_id AS ?source_link ?strain_number AS ?source_id ?strain_name AS ?organism_name (sql:GROUP_DIGEST(?tax_no, ', ', 1000, 1)) AS ?tax_no ?isolation (sql:GROUP_DIGEST(?env, '||', 1000, 1)) AS ?env_links FROM <http://togogenome.org/graph/taxonomy/> FROM <http://togogenome.org/graph/brc/> FROM <http://togogenome.org/graph/meo/> WHERE { VALUES ?related_type { mccv:MCCV_000056 mccv:MCCV_000022 mccv:MCCV_000057 } { SELECT DISTINCT ?strain_id { VALUES ?meo_mapping { mccv:MCCV_000059 mccv:MCCV_000060 } ?meo_id rdfs:subClassOf* meo:MEO_0000029 . ?strain_id ?meo_mapping ?meo_id . ?strain_id rdf:type mccv:MCCV_000001 . } } OPTIONAL { ?strain_id mccv:MCCV_000010 ?strain_number . } OPTIONAL { ?strain_id mccv:MCCV_000012 ?strain_name . } OPTIONAL { ?strain_id mccv:MCCV_000030 ?isolation . } OPTIONAL { ?strain_id mccv:MCCV_000059|mccv:MCCV_000060 ?meo_id . ?meo_id rdfs:label ?meo_label . BIND (CONCAT(REPLACE(STR(?meo_id),"http://purl.jp/bio/11/meo/",""), ?meo_label) AS ?env ) } OPTIONAL { ?strain_id ?related_type ?tax_id FILTER (STRSTARTS(STR(?tax_id),"http://identifiers.org/")) . BIND (REPLACE(STR(?tax_id),"http://identifiers.org/taxonomy/","") AS ?tax_no) . } } GROUP BY ?strain_id ?strain_number ?strain_name ?isolation
Sampling places
スタンザファイル名:gold_sampling_places 旧スタンザファイル名:
PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX msv: <http://purl.jp/bio/11/msv/> SELECT ?gold REPLACE(STR(?gold),"http://www.genomesonline.org/cgi-bin/GOLD/GOLDCards.cgi\\?goldstamp=","") AS ?gold_id ?gaz ?place_name ?latitude ?longitude FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/meo/> FROM <http://togogenome.org/graph/gazetteer/> { ?meo_id rdfs:subClassOf* meo:MEO_0000029 . ?gold meo:MEO_0000437 ?meo_id . ?gold meo:MEO_0000438 ?gaz . ?gaz rdfs:label ?place_name . ?gaz msv:latitude ?latitude . ?gaz msv:longitude ?longitude . }
Sample collections
スタンザファイル名:gold_sampling_collections 旧スタンザファイル名:
DEFINE sql:select-option "order" PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?gold REPLACE(STR(?gold) ,"http://www.genomesonline.org/cgi-bin/GOLD/GOLDCards.cgi\\?goldstamp=" ,"" ) AS ?gold_no ?organism_name REPLACE(STR(?tax_id) ,"http://identifiers.org/taxonomy/" ,"" ) AS ?tax_no (sql:GROUP_DIGEST(?env, '||', 1000, 1)) AS ?env_links FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/meo/> FROM <http://togogenome.org/graph/taxonomy/> { VALUES ?meo_mapping { meo:MEO_0000437 meo:MEO_0000440 } ?meo_id rdfs:subClassOf* meo:MEO_0000004 . ?gold ?meo_mapping ?meo_id . ?meo_id rdfs:label ?meo_label . BIND (CONCAT(REPLACE(STR(?meo_id),"http://purl.jp/bio/11/meo/",""), ?meo_label) AS ?env ) OPTIONAL { ?gold mccv:MCCV_000020 ?tax_id . ?tax_id taxo:scientificName ?organism_name } } GROUP BY ?gold ?tax_id ?organism_name
Taxonomic composition
スタンザファイル名:gold_taxonomic_composition 旧スタンザファイル名:
DEFINE sql:select-option "order" PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX taxid: <http://identifiers.org/taxonomy/> SELECT ?tax ?organism_name ?parent ?rank FROM <http://togogenome.org/graph/meo/> FROM <http://togogenome.org/graph/gold/> FROM <http://togogenome.org/graph/taxonomy/> WHERE { { SELECT ?tax { VALUES ?meo_mapping { meo:MEO_0000437 meo:MEO_0000440 } ?meo_id rdfs:subClassOf* meo:MEO_0000004 . ?gold ?meo_mapping ?meo_id . ?gold mccv:MCCV_000020 ?hit_tax FILTER (STRSTARTS(STR(?hit_tax), "http://identifiers.org/taxonomy" )) . ?hit_tax rdfs:subClassOf* ?tax . } GROUP BY ?tax } ?tax taxo:scientificName ?organism_name . OPTIONAL { ?tax rdfs:subClassOf ?parent . } OPTIONAL { ?tax taxo:rank ?rank . } }
Culture collections
スタンザファイル名:environment_culture_collections
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX meo: <http://purl.jp/bio/11/meo/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> SELECT ?strain_id ?strain_number ?strain_name ?typeStrain ?isolated_from ?opt_temp ?min_temp ?max_temp ?history ?application ?taxid_a ?tax_label_a ?taxid_b1 ?tax_label_b1 ?taxid_b2 ?tax_label_b2 ?taxid_c ?tax_label_c (sql:GROUP_DIGEST(?other_link, ', ', 1000, 1)) AS ?other_links (sql:GROUP_DIGEST(?ref_link, ', ', 1000, 1)) AS ?ref_links FROM <http://togogenome.org/graph/taxonomy/> FROM <http://togogenome.org/graph/brc/> FROM <http://microbedb.jp/meo/> WHERE { { SELECT DISTINCT ?strain_id { VALUES ?meo_mapping { mccv:MCCV_000059 mccv:MCCV_000060 } ?meo_id rdfs:subClassOf* meo:MEO_0000029 . ?strain_id ?meo_mapping ?meo_id . ?strain_id rdf:type mccv:MCCV_000001 . } } OPTIONAL { ?strain_id mccv:MCCV_000010 ?strain_number . } OPTIONAL { ?strain_id mccv:MCCV_000012 ?strain_name . } OPTIONAL { ?strain_id mccv:MCCV_000017 ?typeStrain . } OPTIONAL { ?strain_id mccv:MCCV_000030 ?isolated_from . } OPTIONAL { ?strain_id mccv:MCCV_000014 ?opt_temp . } OPTIONAL { ?strain_id mccv:MCCV_000015 ?min_temp . } OPTIONAL { ?strain_id mccv:MCCV_000016 ?max_temp . } OPTIONAL { ?strain_id mccv:MCCV_000027 ?history . } OPTIONAL { ?strain_id mccv:MCCV_000033 ?application . } OPTIONAL { ?strain_id mccv:MCCV_000056 ?taxid_a FILTER (STRSTARTS(STR(?taxid_a), "http://identifiers.org")) . ?taxid_a taxo:scientificName ?tax_label_a . } OPTIONAL { ?strain_id mccv:MCCV_000022 ?taxid_b1 FILTER (STRSTARTS(STR(?taxid_b1), "http://identifiers.org")) . ?taxid_b1 taxo:scientificName ?tax_label_b1 . } OPTIONAL { ?strain_id mccv:MCCV_000057 ?taxid_b2 FILTER (STRSTARTS(STR(?taxid_b2), "http://identifiers.org")) . ?taxid_b2 taxo:scientificName ?tax_label_b2 . } OPTIONAL { ?strain_id mccv:MCCV_000023 ?taxid_c FILTER (STRSTARTS(STR(?taxid_c), "http://identifiers.org")) . ?taxid_c taxo:scientificName ?tax_label_c . } OPTIONAL { ?strain_id mccv:MCCV_000024/mccv:MCCV_000026 ?other_link . } OPTIONAL { ?strain_id dcterms:references/mccv:MCCV_000047 ?ref_id . ?strain_id mccv:MCCV_000010 ?strain_no . BIND (IF(STRSTARTS(?strain_no, "JCM"), CONCAT("http://www.jcm.riken.go.jp/cgi-bin/jcm/jcm_ref?REF=", ?ref_id), IF(STRSTARTS(?strain_no, "NBRC"), CONCAT("http://www.nbrc.nite.go.jp/NBRC2/NBRCReferenceDetailServlet?NO=", ?ref_id), "")) AS ?ref_link) . } } GROUP BY ?strain_id ?strain_number ?strain_name ?typeStrain ?isolated_from ?opt_temp ?min_temp ?max_temp ?history ?application ?taxid_a ?tax_label_a ?taxid_b1 ?tax_label_b1 ?taxid_b2 ?tax_label_b2 ?taxid_c ?tax_label_c
項目縮小版
PREFIX mccv: <http://purl.jp/bio/01/mccv#> PREFIX taxid: <http://identifiers.org/taxonomy/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX taxo: <http://ddbj.nig.ac.jp/ontologies/taxonomy#> PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT ?strain_id ?strain_number ?strain_name AS ?organism_name ?isolation (sql:GROUP_DIGEST(?env, '|| ', 1000, 1)) AS ?env_links ?type_strain_label ?application (sql:GROUP_DIGEST(?other_link, ', ', 1000, 1)) AS ?other_collections FROM <http://togogenome.org/graph/taxonomy/> FROM <http://togogenome.org/graph/brc/> FROM <http://togogenome.org/graph/meo/> WHERE { { SELECT DISTINCT ?strain_id { VALUES ?meo_mapping { mccv:MCCV_000059 mccv:MCCV_000060 } ?meo_id rdfs:subClassOf* meo:MEO_0000029 . ?strain_id ?meo_mapping ?meo_id . ?strain_id rdf:type mccv:MCCV_000001 . } } OPTIONAL { ?strain_id mccv:MCCV_000010 ?strain_number . } OPTIONAL { ?strain_id mccv:MCCV_000012 ?strain_name . } OPTIONAL { ?strain_id mccv:MCCV_000030 ?isolation . } OPTIONAL { ?strain_id mccv:MCCV_000059|mccv:MCCV_000060 ?meo_id . ?meo_id rdfs:label ?meo_label . BIND (CONCAT(REPLACE(STR(?meo_id),"http://purl.jp/bio/11/meo/",""), ?meo_label) AS ?env ) } OPTIONAL { ?strain_id mccv:MCCV_000017 ?type_strain . BIND (IF(?type_strain = 1, "yes","no") AS ?type_strain_label)} OPTIONAL { ?strain_id mccv:MCCV_000033 ?application . } OPTIONAL { ?strain_id mccv:MCCV_000024/mccv:MCCV_000026 ?other_link . } } GROUP BY ?strain_id ?strain_number ?strain_name ?type_strain_label ?isolation ?application
Environment ontology
スタンザファイル名:environment_ontology
PREFIX meo: <http://purl.jp/bio/11/meo/> SELECT ?meo_id ?label ?definition ?parent FROM <http://togogenome.org/graph/meo/> WHERE { ?meo_id a owl:Class . OPTIONAL { ?meo_id rdfs:label ?label . } OPTIONAL { ?meo_id meo:MEO_0000443 ?definition . } OPTIONAL { ?meo_id rdfs:subClassOf ?parent . } }
共通クエリ
uniprot_url_from_togogenome(gene_id)
RefSeqのLocusTagからUniProtのProteinID(refseq)を返すクエリ。
PREFIX insdc: <http://insdc.org/owl/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX dct: <http://purl.org/dc/terms/> SELECT DISTINCT ?up FROM <http://togogenome.org/graph/refseq/> WHERE { ?s insdc:feature_locus_tag "alr3431" . ?s rdfs:seeAlso ?np . ?s rdfs:seeAlso ?xref . ?np rdf:type idorg:Protein . BIND (STRAFTER(STR(?np), "ncbiprotein/") AS ?npid) BIND (IRI(CONCAT("http://purl.uniprot.org/refseq/", ?npid)) AS ?up) }
計算用クエリ
Genomic plot用集計結果
Genomic plot, Pfam plotで表示する、各ゲノムのgene, trna, rrna数の集計クエリは遅いため、予め集計した数値をトリプルとして持って置く
Taxonomy,BioProjectリスト取得
Taxonomy及びBioProjectのリストを取得。ひとつのTaonomyに複数のBioProjectが紐づいているケースもあるため、2つをグルーピングのキーにする。
PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX idorg:<http://rdf.identifiers.org/database/> SELECT DISTINCT ?tax ?bioProject FROM <http://togogenome.org/graph/refseq/> WHERE { ?tax rdf:type idorg:Taxonomy . ?seq rdfs:seeAlso ?tax ; rdf:type ?obo_type FILTER(?obo_type IN (obo:SO_0000340, obo:SO_0000155 )). ?seq rdfs:seeAlso ?bioProject. ?bioProject rdf:type idorg:BioProject . }
Gene数集計取得
taxonomy"1148", bioproject"57659"の集計結果を出力するクエリ
DEFINE sql:select-option "order" PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX togo: <http://togogenome.org/stats/> CONSTRUCT { ?tax togo:genome_stats [ rdfs:seeAlso ?bioProject ; togo:gene_number ?num_gene ; togo:rrna_number ?num_rrna ; togo:trna_number ?num_trna ; ]. } FROM <http://togogenome.org/graph/refseq/> WHERE { SELECT ?tax ?bioProject COUNT(?gene) as ?num_gene COUNT(?rrna) AS ?num_rrna COUNT(?trna) AS ?num_trna FROM <http://togogenome.org/graph/refseq/> WHERE { ?seq rdfs:seeAlso ?tax FILTER (?tax = <http://identifiers.org/taxonomy/1148>) . ?seq rdf:type ?obo_type FILTER (?obo_type IN (obo:SO_0000340, obo:SO_0000155 )). ?seq rdfs:seeAlso ?bioProject FILTER (?bioProject = <http://identifiers.org/bioproject/57659>). { ?gene obo:so_part_of ?seq ; rdf:type obo:SO_0000704 . } UNION { ?rrna obo:so_part_of ?seq ; rdf:type obo:SO_0000252 . } UNION { ?trna obo:so_part_of ?seq ; rdf:type obo:SO_0000253 . } } }
一括でGene数集計取得
- virtuoso.iniの設定変更
生成するttlが10000行を超えると結果が途中で切れてしまうため、virtuoso.iniで以下の値を設定する。現在(RefSeq v60)では13000件程度の結果。
ResultSetMaxRows = 20000
- CONSTRUCT文の作成
genome_gene_number_stats.rq
SPARQL DEFINE output:format "NT" DEFINE sql:select-option "order" PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX idorg: <http://rdf.identifiers.org/database/> PREFIX togo: <http://togogenome.org/stats/> CONSTRUCT { ?tax togo:genome_stats [ rdfs:seeAlso ?bioProject ; togo:gene_number ?num_gene ; togo:rrna_number ?num_rrna ; togo:trna_number ?num_trna ; ]. } FROM <http://togogenome.org/graph/refseq/> WHERE { SELECT ?tax ?bioProject COUNT(?gene) as ?num_gene COUNT(?rrna) AS ?num_rrna COUNT(?trna) AS ?num_trna FROM <http://togogenome.org/graph/refseq/> WHERE { ?tax rdf:type idorg:Taxonomy . ?seq rdfs:seeAlso ?tax ; rdf:type ?obo_type FILTER(?obo_type IN (obo:SO_0000340, obo:SO_0000155 )). ?seq rdfs:seeAlso ?bioProject. ?bioProject rdf:type idorg:BioProject . { ?gene obo:so_part_of ?seq ; rdf:type obo:SO_0000704 . } UNION { ?rrna obo:so_part_of ?seq ; rdf:type obo:SO_0000252 . } UNION { ?trna obo:so_part_of ?seq ; rdf:type obo:SO_0000253 . } } GROUP BY ?tax ?bioProject } ;
検索がタイムアウトしないようであれば、下のCONSTRUCT文をそのままエンドポイントに投げても良い。その場合は冒頭"SPARQL"と最後のセミコロンを削除する
- isqlでクエリ実行&ttl生成
isqlで実行する(ポートとユーザ・パスワードは適宜読み替える)
$isql 1111 dba dba VERBOSE=OFF BANNER=OFF PROMPT=OFF ECHO=OFF BLOBS=ON ERRORS=stdout < genome_gene_number_stats.rq > genome_gene_number_stats.ttl