SPARQLthon60/DDBJ

提供:TogoWiki

移動: 案内, 検索

目次

DDBJ RDFサンプルSPARQL

CP002459.1エントリーのメタデータ取得

#  Search for a DDBJ entry "CP002459.1" and the metadata.

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>

SELECT
  ?predicate ?object
WHERE
{
  VALUES ?entry { <http://identifiers.org/insdc/CP002459.1> }
  VALUES ?predicate { 
    insdc:comment
    insdc:definition
    insdc:division
    insdc:organism
    insdc:sequence_date
    insdc:sequence_version
    insdc:source
    insdc:taxonomy
    insdc:dblink
  }                      
  ?entry rdf:type insdc:Entry. 
  ?entry ?predicate ?object.
}

BioProject ID: PRJNA244038 の配列エントリーのリスト

#  Search for a BioProject entry "PRJNA244038.1" and the anntated sequence enties. 

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>

SELECT
  ?sequence_version ?definition replace(str(?topology), "http://ddbj.nig.ac.jp/ontologies/nucleotide/","") as ?topology
WHERE
{
  VALUES ?project { <http://identifiers.org/bioproject/PRJNA244038> }
  ?entry insdc:dblink ?project.
  ?entry rdf:type insdc:Entry. 
  ?project rdf:type insdc:BioProject.
  ?entry insdc:sequence_version ?sequence_version.
  ?entry insdc:definition ?definition.
  ?entry insdc:sequence ?sequence.
  ?sequence insdc:topology ?topology.
}

PubMed ID: 21441521関連の配列エントリーのリスト

#  Search for a PubMed ID "21441521" and the related DDBJ enties. 

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>

SELECT
  ?sequence_version
WHERE
{
  VALUES ?pubmed { <http://identifiers.org/pubmed/21441521> }
  ?entry rdfs:seeAlso ?pubmed.
  ?entry rdf:type insdc:Entry.  
  ?pubmed rdf:type insdc:PubMed.
  ?entry insdc:sequence_version ?sequence_version.
}

Taxonomy ID: 1148の配列エントリーの’リスト

# Search for a Taxonomy ID "1148" and the anntated sequence enties.

PREFIX owl: <http://www.w3.org/2002/07/owl#> 
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo:<http://purl.obolibrary.org/obo/>
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>
PREFIX tax: <http://ddbj.nig.ac.jp/ontologies/taxonomy/>

SELECT
  ?organism ?sequence_version ?definition  ?sequence_date
WHERE
{
  values ?tax_id {tax:1148} 
  ?entry insdc:sequence ?sequence.
  ?sequence obo:RO_0002162 ?taxon.
  ?taxon owl:sameAs ?tax_id.
  ?entry insdc:definition ?definition .
  ?entry insdc:division ?division .
  ?entry insdc:organism ?organism .
  ?entry insdc:sequence_date ?sequence_date .
  ?entry insdc:sequence_version ?sequence_version .
}
ORDER BY ?sequence_date

AP011615.1 エントリーに含まれるlocus_tag, feature_type product, gene_symbol, start, end, strandのリスト

# Find features containing locus_tag qualifier in DDBJ entry "AP011615.1"

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo:<http://purl.obolibrary.org/obo/>
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>
PREFIX faldo:  <http://biohackathon.org/resource/faldo#>

select
 ?locus_tag ?feature_type ?product ?gene_symbol 
 IF(?fstart < ?fend , ?fstart, ?fend) as ?start 
 IF(?fstart < ?fend , ?fend, ?fstart) as ?end
 IF( ?faldo_type = faldo:ForwardStrandPosition,"+", IF( ?faldo_type = faldo:ReverseStrandPosition,"-",".")) as ?strand
#*
where
{ 
  values ?entry {<http://identifiers.org/insdc/AP011615.1>}.
  values ?faldo_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition }
  ?entry   insdc:sequence ?sequence .
  ?feature obo:so_part_of+ ?sequence .
  ?sequence rdfs:subClassOf obo:SO_0000001 .
  ?feature rdf:type ?type .
  ?type rdfs:label ?feature_type .
  ?feature insdc:locus_tag ?locus_tag.
  ?feature insdc:product ?product .
  OPTIONAL { ?feature insdc:gene ?gene_symbol .}
  ?feature faldo:location ?faldo .
  ?faldo faldo:begin/rdf:type ?faldo_type .
  ?faldo faldo:begin/faldo:position ?fstart .
  ?faldo faldo:end/faldo:position ?fend .
  ?feature obo:so_part_of ?parent .
}
ORDER BY ?locus_tag
個人用ツール