BH12.12/SPARQLthon14/TogoStanza
提供:TogoWiki
TogoStanza の作り方
- Ruby 2.0 をインストールする (Mac OS X 10.9 Mavericks では標準添付されています)
- RubyGems で gem install togostanza を実行
<!DOCTYPE html> <head> <title>TogoStanza example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script src="http://togogenome.org/stanza/assets/stanza.js" type="text/javascript"></script> </head> <body> < div data-stanza="http://togogenome.org/stanza/protein_names" data-stanza-tax-id="103690" data-stanza-gene-id="alr4977"></div> </body>
class MyAwesomeStanza < TogoStanza::Stanza::Base property :features do |gene_id| query("http://ep.dbcls.jp/sparql7dev", <<-SPARQL.strip_heredoc) PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX insdc: <http://insdc.org/owl/> SELECT DISTINCT ?feature_product ?feature_gene WHERE { ?s rdfs:label "#{gene_id}" . ?s insdc:feature_product ?feature_product . ?s insdc:feature_gene ?feature_gene . } SPARQL end end