OpenBEL / bel.rb

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

Error bel2rdf #130

Open berenicew opened 7 years ago

berenicew commented 7 years ago

Dear,

I am running the bel2rdf tool. I tried first the tool with small corpus and it proceed the file very well, but when using another BEL file, I get an error. Please find below the stack trace of the error

Best regards,

bel2rdf.rb --bel all.bel --format turtle > all.ttl /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/syntax/undefined_annotation_value.rb:46:in map': undefined methodidentifier' for nil:NilClass (NoMethodError) from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:33:in block (3 levels) in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:32:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:32:in flat_map' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:32:inblock (2 levels) in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/parsers/ast/node.rb:107:in traverse' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:31:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:31:in flat_map' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:31:inblock in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/state_aggregator.rb:25:in block in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/first_node.rb:13:inblock in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_filter.rb:15:in block in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:63:inblock in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in yield' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:ineach_line' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_filter.rb:13:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/filter.rb:28:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/first_node.rb:12:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/state_aggregator.rb:19:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:30:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:26:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel/translator/plugins/bel_script/reader.rb:34:ineach' from /gitrep/bel.rb/lib/bel/translator/plugins/rdf2/translator.rb:30:in write' from /gitrep/bel.rb/lib/bel/translate.rb:53:intranslate' from /gitrep/bel.rb/bin/bel2rdf.rb:108:in `

'

A similar issue happened when converting large_corpus.bel file

/gitrep/bel.rb/bin/bel2rdf.rb --bel /gitrep/bel.rb/spec/unit/bel/large_corpus.bel --format turtle > large_corpus.ttl /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:130:in domain_value': undefined methodidentifier' for nil:NilClass (NoMethodError) from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:114:in block in references' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:110:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:110:in map' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:110:inreferences' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:52:in nanopub' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:39:inblock in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:39:in block in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/state_aggregator.rb:25:inblock in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/first_node.rb:13:in block in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_filter.rb:15:inblock in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:63:in block in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:inyield' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in each_line' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_generator.rb:52:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/ast_filter.rb:13:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/filter.rb:28:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/first_node.rb:12:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/state_aggregator.rb:19:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/validator.rb:30:in each' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel_parser/script/nanopub_mapper.rb:26:ineach' from /.rvm/gems/ruby-2.2.6/gems/bel_parser-1.0.8/lib/bel/translator/plugins/bel_script/reader.rb:34:in each' from /gitrep/bel.rb/lib/bel/translator/plugins/rdf2/translator.rb:30:inwrite' from /gitrep/bel.rb/lib/bel/translate.rb:53:in translate' from /gitrep/bel.rb/bin/bel2rdf.rb:108:in

'

berenicew commented 7 years ago

Hi,

Please find more information, with a simple example. The problem happened when referencing openBEL annotation files. Please find below a simple bel file that generate the error

##################################################################################
# Document Properties Section
###############################################################################
# Definitions Section
DEFINE ANNOTATION Species AS URL "https://resources.openbel.org/belframework/20131211/annotation/species-taxonomy-id.belanno"
##################################################################################
# Statements Section
SET Species = "9606"

And the command line bel2rdf.rb --bel sample.bel --format turtle > sample.ttl