OpenBEL / bel.rb

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

Null pointer exception #123

Closed juliakozlovsky closed 8 years ago

juliakozlovsky commented 8 years ago

/usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:16:in to_rdf_vocabulary': undefined methodend_with?' for nil:NilClass (NoMethodError) from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:35:in to_uri' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:59:into_rdf' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:172:in block in to_rdf' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:171:ineach' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:171:in to_rdf' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:236:into_rdf' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/monkey_patch.rb:354:in to_rdf' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/translator.rb:83:inblock (2 levels) in write_rdf_to_io' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/bel_script/evidence_yielder.rb:29:in block in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/script.rb:65381:inblock in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/nonblocking_io_wrapper.rb:25:in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/script.rb:63742:ineach' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/bel_script/evidence_yielder.rb:24:in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/bel_script/evidence_yielder.rb:24:ineach' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/translator.rb:72:in block in write_rdf_to_io' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/translator.rb:111:ineach' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/translator.rb:111:in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/translator.rb:111:inwrite_rdf_to_io' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translator/plugins/rdf/translator.rb:33:in write' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/lib/bel/translate.rb:53:intranslate' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/bin/bel2rdf.rb:108:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/bin/bel:103:inrequire_relative' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/bin/bel:103:in run' from /usr/local/rvm/gems/ruby-2.3.0/gems/bel-0.7.0/bin/bel:583:in<top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/bin/bel:23:in load' from /usr/local/rvm/gems/ruby-2.3.0/bin/bel:23:in

' from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval' from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in
'bv

abargnesi commented 8 years ago

Thanks for the report. It is helpful to the community to supply a short, self contained, correct example for the issue.

abargnesi commented 8 years ago

It is helpful to supply context around how the error arose.

juliakozlovsky commented 8 years ago

Yes - currently waiting for the example from the colleagues who found the error..

abargnesi commented 8 years ago

Thanks!

abargnesi commented 8 years ago

@sanea's fix was merged into next. Let me know if the fix addresses the original issue.

If so we can merge to master and release a 0.7.1.

sanea commented 8 years ago

The issue is reproduced when the prefix of parameter inside bel term contains wrong value. The prefix of the namespace is case sensetive.

125 is fixing this issue and conversion is working with wrong namepsace prefixes.

small_corpus_updated.zip

##################################################################################
# Document Properties Section

SET DOCUMENT Name = "BEL Framework Small Corpus Document (updated)"
SET DOCUMENT Description = "Approximately 2000 hand curated statements drawn from 57 PubMeds."
SET DOCUMENT Version = 20131211
SET DOCUMENT Copyright = "Copyright (c) 2011-2012, Selventa. All Rights Reserved."
SET DOCUMENT Authors = Selventa
SET DOCUMENT Licenses = "Creative Commons Attribution-Non-Commercial-ShareAlike 3.0 Unported License"
SET DOCUMENT ContactInfo = "support@belframework.org"

##################################################################################
# Definitions Section

DEFINE NAMESPACE GOBP AS URL "http://resource.belframework.org/belframework/20131211/namespace/go-biological-process.belns"
DEFINE NAMESPACE MESHD AS URL "http://resource.belframework.org/belframework/20131211/namespace/mesh-diseases.belns"

DEFINE ANNOTATION Anatomy AS URL "http://resource.belframework.org/belframework/20131211/annotation/anatomy.belanno"
DEFINE ANNOTATION Disease AS URL "http://resource.belframework.org/belframework/20131211/annotation/disease.belanno"
DEFINE ANNOTATION TextLocation AS LIST {"Abstract","Results","Legend","Review"}

##################################################################################
# Statements Section

SET STATEMENT_GROUP = "Group 1"

SET Disease = atherosclerosis
SET Anatomy = artery
SET TextLocation = Review
SET Evidence = "Oxidation and nitration of macromolecules, such as proteins, DNA and lipids, are prominent
in atherosclerotic arteries."
SET Citation = {"PubMed","Trends in molecular medicine","12928037","","de Nigris F|Lerman A|Ignarro LJ|Williams-Ignarro S|Sica V|Baker AH|Lerman LO|Geng YJ|Napoli C",""}

pathology(meshd:Atherosclerosis) positiveCorrelation biologicalProcess(gobp:"lipid oxidation")
pathology(meshd:Atherosclerosis) positiveCorrelation biologicalProcess(gobp:"protein oxidation")

UNSET STATEMENT_GROUP