SPARQLthon60/DDBJ

提供:TogoWiki

(版間での差分)
移動: 案内, 検索
(Taxonomy ID: 1148の配列エントリーの’リスト)
71行: 71行:
   ?entry insdc:sequence_version ?sequence_version.
   ?entry insdc:sequence_version ?sequence_version.
}
}
-
</pre>
 
-
 
-
== AP011615.1 エントリーに含まれるlocus_tag, feature_type product, gene_symbolのリスト ==
 
-
 
-
<pre>
 
-
# 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/>
 
-
 
-
select
 
-
  ?locus_tag ?feature_type ?product ?gene_symbol
 
-
where
 
-
{
 
-
  values ?entry {<http://identifiers.org/insdc/AP011615.1>}.
 
-
  ?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 .}
 
-
}
 
-
ORDER BY ?locus_tag
 
</pre>
</pre>
128行: 101行:
</pre>
</pre>
-
== GTF ==
+
== AP011615.1 エントリーに含まれるlocus_tag, feature_type product, gene_symbolのリスト ==
 +
 
<pre>
<pre>
 +
# Find features containing locus_tag qualifier in DDBJ entry "AP011615.1"
 +
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-
PREFIX dc:<http://purl.org/dc/elements/1.1/>
 
-
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
 
-
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
 
-
PREFIX sio:<http://semanticscience.org/resource/>
 
PREFIX obo:<http://purl.obolibrary.org/obo/>
PREFIX obo:<http://purl.obolibrary.org/obo/>
-
PREFIX faldo:<http://biohackathon.org/resource/faldo#>
 
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>
PREFIX insdc:<http://ddbj.nig.ac.jp/ontologies/nucleotide/>
-
PREFIX insdcdiv:<http://ddbj.nig.ac.jp/ontologies/nucleotide/Division#>
 
-
PREFIX insdcref:<http://ddbj.nig.ac.jp/ontologies/nucleotide/reference#>
 
-
SELECT
+
select
-
distinct ?seqid ?source replace(str(?type),"http://purl.obolibrary.org/obo/","") as ?feature_type ?start ?end ?score ?strand_type ?strand ?phase ?frame ?gene_id
+
  ?locus_tag ?feature_type ?product ?gene_symbol
-
#distinct ?idorg
+
where
-
WHERE
+
{  
-
{
+
  values ?entry {<http://identifiers.org/insdc/AP011615.1>}.
-
#VALUES ?idorg    {<http://identifiers.org/bioproject/PRJDA42161>}
+
  ?entry  insdc:sequence ?sequence .
-
VALUES ?idorg { <http://identifiers.org/bioproject/PRJNA13415> }
+
  ?feature obo:so_part_of+ ?sequence .
-
#VALUES ?idorg { <http://identifiers.org/bioproject/PRJNA244> }
+
  ?sequence rdfs:subClassOf obo:SO_0000001 .
-
#VALUES ?seq_type  { obo:SO_0000340 obo:SO_0000155 }
+
  ?feature rdf:type ?type .
-
#VALUES ?type { obo:SO_0000704 obo:SO_0000252 obo:SO_0000253 }
+
  ?type rdfs:label ?feature_type .
-
#VALUES ?insdc_type { insdc:Coding_Sequence insdc:Gene insdc:Transfer_RNA insdc:Ribosomal_RNA}
+
  ?feature insdc:locus_tag ?locus_tag.
-
#VALUES ?insdc_type { insdc:Gene insdc:Transfer_RNA insdc:Ribosomal_RNA}
+
  ?feature insdc:product ?product .
-
VALUES ?strand_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition }
+
  OPTIONAL { ?feature insdc:gene ?gene_symbol .}
-
VALUES ?source {'DDBJ'}
+
-
VALUES ?score {'.'}
+
-
VALUES ?frame {'.'}
+
-
VALUES ?phase {0}
+
-
VALUES ?strand {'.'} # default
+
-
?gene rdfs:subClassOf ?type.
+
-
?gene insdc:locus_tag ?locus_tag ;
+
-
    a ?insdc_type ;
+
-
    obo:so_part_of ?seq ;
+
-
    faldo:location ?location.
+
-
?location faldo:begin ?faldo_begin ;
+
-
    faldo:end ?faldo_end.
+
-
?faldo_begin rdf:type ?strand_type ;
+
-
    faldo:position ?start.
+
-
?faldo_end faldo:position ?end.
+
-
?entry insdc:sequence ?seq.
+
-
?entry insdc:sequence_version ?seqid .
+
-
?entry insdc:dblink ?idorg.
+
-
?seq rdfs:subClassOf ?seq_type. #only obo:SO_0000001
+
-
BIND(?seqid as ?seqname) # for GTF2.2
+
-
BIND(?insdc_type as ?feature)  # for GTF2.2
+
-
BIND(?phase as ?frame)  # for GTF2.2
+
-
BIND(?locus_tag as ?gene_id)
+
}
}
-
ORDER BY ?seqid ?start
+
ORDER BY ?locus_tag
-
limit 100
+
</pre>
</pre>

2017年10月2日 (月) 07:50時点における版

目次

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のリスト

# 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/>

select
  ?locus_tag ?feature_type ?product ?gene_symbol
where
{ 
  values ?entry {<http://identifiers.org/insdc/AP011615.1>}.
  ?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 .}
}
ORDER BY ?locus_tag
個人用ツール