OpenBEL / bel.rb

Process BEL (Biological Expression Language) with ruby.
Apache License 2.0
8 stars 6 forks source link

Unable to use jgf translator #127

Open nbargnesi opened 8 years ago

nbargnesi commented 8 years ago
~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:14:in `block in read': uninitialized constant BEL::Translator::Plugins::Jgf::JgfTranslator::ResourceIndex (NameError)
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:13:in `fetch'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:13:in `read'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translate.rb:52:in `translate'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/bin/bel:345:in `run'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/bin/bel:583:in `<top (required)>'
    from ~/.gem/ruby/2.2.0/bin/bel:23:in `load'
    from ~/.gem/ruby/2.2.0/bin/bel:23:in `<main>'  

Using the recently published version of bel and bel_parser:

$ gem list

*** LOCAL GEMS ***

bel (1.0.1)
bel_parser (1.0.5)
nbargnesi commented 8 years ago

New issue now.

~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/script.rb:54141:in `each': uninitialized constant BEL::Nanopub::Statement (NameError)
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `first'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `block in unwrap'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:76:in `map'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:76:in `unwrap' 
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:21:in `block in read' 
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:78:in `yield'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:78:in `call'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:78:in `hash_end'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:27:in `sc_parse'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:27:in `read'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `to_a'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `combine_references'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:42:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel_parser-1.0.5/lib/bel/translator/plugins/bel_script/writer.rb:78:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel_parser-1.0.5/lib/bel/translator/plugins/bel_script/translator.rb:25:in `write'
nbargnesi commented 8 years ago

Assuming I have a sane ragel incantation to create lib/bel/script.rb (see #128) , new issue is:

~/.gem/ruby/2.2.0/gems/bel_parser-1.0.5/lib/bel_parser/expression/model/statement.rb:30:in `initialize': subject: expected Term, actual NilClass (ArgumentError)
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/script.rb:121043:in `new'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/script.rb:121043:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `each'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `first'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:91:in `block in unwrap'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:76:in `map'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:76:in `unwrap'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/translator/plugins/jgf/translator.rb:21:in `block in read'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:78:in `yield'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:78:in `call'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:78:in `hash_end'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:27:in `sc_parse'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/json/adapter/oj.rb:27:in `read'
    from ~/.gem/ruby/2.2.0/gems/bel-1.0.1/lib/bel/nanopub/buffering_nanopub_combiner.rb:79:in `each'

This starts highlighting the current disconnect between bel and the BELParser::Expression::Model objects.

abargnesi commented 8 years ago

Opened #129 to handle the disconnect between the parsers. My plan is to replace calls to BEL::Script.parse with BELParser::Expression.parse.

Should have something by today in a PR for you @nbargnesi.