-
Notifications
You must be signed in to change notification settings - Fork 6
Issue92: map annotation/namespace definitions from external yml file #118
Conversation
It looks like we have duplicate options between Maybe a better name is |
then to avoid duplicates we could define 1 common yml file with structure below: prefixes: |
This is looking good. Nice work! 🎉 The tests all pass, but I noticed one issue when I try to translate BEL Script to Turtle when using an RDF prefix file. I ran this test from the root of the project using the BEL Script file ./test/resources/small_corpus.bel and the rdf prefix file examples/resource-mapping.yml. # Using bel2rdf.rb
bin/bel2rdf.rb --bel ./test/resources/small_corpus.bel --format turtle --rdf-prefix-file examples/resource-mapping.yml
# Using "bel translate"
bel translate --input-file ./test/resources/small_corpus.bel --to-option rdf_prefix_file=examples/resource-mapping.yml bel turtle The turtle includes @prefix annotations: <[{"remap"=>{"from"=>{"keyword"=>"Anatomy", "type"=>"url", "domain"=>"http://resource.belframework.org/belframework/20150611/annotation/anatomy.belanno"}, "to"=>{"keyword"=>"Anatomy", "type"=>"url", "domain"=>"http://resource.belframework.org/belframework/20150611/annotation/anatomy.belanno", "rdf_uri"=>"http://identifiers.org/anatomy/"}}}, {"remap"=>{"from"=>{"keyword"=>"TextLocation", "type"=>"list", "domain"=>["Abstract", "Results", "Legend", "Review"]}, "to"=>{"keyword"=>"TextLocation", "type"=>"pattern", "domain"=>"Value[0-9]+", "rdf_uri"=>"http://identifiers.org/text-location/"}}}]> .
@prefix namespaces: <[{"remap"=>{"from"=>{"prefix"=>"HGNC", "url"=>"http://resource.belframework.org/belframework/20150611/namespace/hgnc-human-genes.belns"}, "to"=>{"prefix"=>"HGNC", "url"=>"http://resource.belframework.org/belframework/20150611/namespace/hgnc-human-genes.belns", "rdf_uri"=>"http://identifiers.org/hgnc/"}}}, {"remap"=>{"from"=>{"prefix"=>"EGID", "url"=>"http://resource.belframework.org/belframework/20150611/namespace/entrez-gene-ids.belns"}, "to"=>{"prefix"=>"EGID", "url"=>"http://resource.belframework.org/belframework/20150611/namespace/entrez-gene-ids.belns", "rdf_uri"=>"http://identifiers.org/ncbigene/"}}}, {"remap"=>{"from"=>{"prefix"=>"MESHD", "url"=>"http://resource.belframework.org/belframework/20150611/namespace/mesh-diseases.belns"}, "to"=>{"prefix"=>"MESHD", "url"=>"http://resource.belframework.org/belframework/20150611/namespace/mesh-diseases.belns", "rdf_uri"=>"http://identifiers.org/meshd/"}}}]> . This error looks like the wrong object type is being set as an RDF prefix. |
Actually, I was sending a resource override file and not an RDF prefix file. I think that is why I got this behavior. When I run the following bin/bel translate --input-file test/resources/small_corpus.bel -t rdf_prefix_file=test/resources/prefix_file.yml bel turtle |
It looks like we are missing a |
IMO, the name "remap-file" seems to indicate the format and intented usage of this file. updated references throughout the usage. expanded on option documentation and made consistent across *bel* and *bel2rdf.rb* files. refs #118
The remapfile subcommand has been added to *bel* to give the user an example document to start from. Otherwise users who install the gem will not know how to structure a remap file. refs #118
No description provided.