SPARQLthon60/DDBJ

提供:TogoWiki

(版間での差分)
移動: 案内, 検索
(CP002459.1エントリーのメタデータ取得)
1行: 1行:
== CP002459.1エントリーのメタデータ取得 ==
== CP002459.1エントリーのメタデータ取得 ==
<pre>
<pre>
 +
#  Search for a DDBJ entry "CP002459.1" and the metadata.
 +
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 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
-
?predicate ?object
+
  ?predicate ?object
WHERE
WHERE
{
{
-
VALUES ?entry { <http://identifiers.org/insdc/CP002459.1> }
+
  VALUES ?entry { <http://identifiers.org/insdc/CP002459.1> }
-
VALUES ?predicate {  
+
  VALUES ?predicate {  
-
insdc:comment
+
    insdc:comment
-
insdc:definition
+
    insdc:definition
-
insdc:division
+
    insdc:division
-
insdc:organism
+
    insdc:organism
-
insdc:sequence_date
+
    insdc:sequence_date
-
insdc:sequence_version
+
    insdc:sequence_version
-
insdc:source
+
    insdc:source
-
insdc:taxonomy
+
    insdc:taxonomy
-
insdc:dblink
+
    insdc:dblink
-
}                       
+
  }                       
-
?entry rdf:type insdc:Entry.  
+
  ?entry rdf:type insdc:Entry.  
-
?entry ?predicate ?object.
+
  ?entry ?predicate ?object.
}
}
</pre>
</pre>

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

目次

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 の配列エントリーのリスト

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 faldo:<http://biohackathon.org/resource/faldo#>
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
?sequence_version ?definition
WHERE
{
VALUES ?project { <http://identifiers.org/bioproject/PRJNA244038> }
?entry insdc:dblink ?project.
?entry rdf:type insdc:Entry. 
?project rdf:type ?type.
?project rdf:type insdc:BioProject.
?entry insdc:sequence_version ?sequence_version.
?entry insdc:definition ?definition.
}


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

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 faldo:<http://biohackathon.org/resource/faldo#>
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
?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.
}

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

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 faldo:<http://biohackathon.org/resource/faldo#>
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
?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


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

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 faldo:<http://biohackathon.org/resource/faldo#>
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#>
PREFIX tax: <http://ddbj.nig.ac.jp/ontologies/taxonomy/>
SELECT
?organism ?sequence_version ?definition  ?sequence_date
WHERE
{
values ?tax_id {tax:1148} 
#values ?taxon_root {tax:1148} 
#?taxon_root a tax:Taxon .
#?taxon rdfs:subClassOf* ?taxon_root.
?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 .
}
#limit 100
ORDER BY ?sequence_date


GTF

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 faldo:<http://biohackathon.org/resource/faldo#>
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
distinct ?seqid ?source replace(str(?type),"http://purl.obolibrary.org/obo/","") as ?feature_type ?start ?end ?score ?strand_type ?strand ?phase ?frame ?gene_id
#distinct ?idorg
WHERE
{
#VALUES ?idorg    {<http://identifiers.org/bioproject/PRJDA42161>}
VALUES ?idorg { <http://identifiers.org/bioproject/PRJNA13415> }
#VALUES ?idorg { <http://identifiers.org/bioproject/PRJNA244> }
#VALUES ?seq_type  { obo:SO_0000340 obo:SO_0000155 }
#VALUES ?type { obo:SO_0000704 obo:SO_0000252 obo:SO_0000253 }
#VALUES ?insdc_type { insdc:Coding_Sequence insdc:Gene insdc:Transfer_RNA insdc:Ribosomal_RNA}
#VALUES ?insdc_type { insdc:Gene insdc:Transfer_RNA insdc:Ribosomal_RNA}
VALUES ?strand_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition }
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
limit 100
個人用ツール