{"action":"created","issue":{"url":"https://api.github.com/repos/OpenBEL/bel.rb/issues/92","repository_url":"https://api.github.com/repos/OpenBEL/bel.rb","labels_url":"https://api.github.com/repos/OpenBEL/bel.rb/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/OpenBEL/bel.rb/issues/92/comments","events_url":"https://api.github.com/repos/OpenBEL/bel.rb/issues/92/events","html_url":"https://github.com/OpenBEL/bel.rb/issues/92","id":127968192,"number":92,"title":"Configure annotation/namespace definitions","user":{"login":"abargnesi","id":149445,"avatar_url":"https://avatars.githubusercontent.com/u/149445?v=3","gravatar_id":"","url":"https://api.github.com/users/abargnesi","html_url":"https://github.com/abargnesi","followers_url":"https://api.github.com/users/abargnesi/followers","following_url":"https://api.github.com/users/abargnesi/following{/other_user}","gists_url":"https://api.github.com/users/abargnesi/gists{/gist_id}","starred_url":"https://api.github.com/users/abargnesi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abargnesi/subscriptions","organizations_url":"https://api.github.com/users/abargnesi/orgs","repos_url":"https://api.github.com/users/abargnesi/repos","events_url":"https://api.github.com/users/abargnesi/events{/privacy}","received_events_url":"https://api.github.com/users/abargnesi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenBEL/bel.rb/labels/1%20-%20Ready","name":"1 - Ready","color":"CCCCCC"},{"url":"https://api.github.com/repos/OpenBEL/bel.rb/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/OpenBEL/bel.rb/labels/RDF","name":"RDF","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-21T16:50:54Z","updated_at":"2016-03-09T16:43:10Z","closed_at":null,"body":"**Background**\r\n\r\nAnnotations and namespaces are catalogs for biological entities. They are generally modeled one-to-one with life science databases ([Entrez Gene](http://www.ncbi.nlm.nih.gov/gene), [HGNC](http://www.genenames.org/), [GO](http://geneontology.org/), [NCBI Taxonomy](http://www.ncbi.nlm.nih.gov/taxonomy), etc.). When you express knowledge in BEL you will want to use standard names to increase connectedness within your BKN (BEL Knowledge Network). Annotations and namespaces are defined in the header of BEL script (or XBEL) files. A document-local keyword is provided to refer to the namespace within BEL terms. The namespace values can be retrieved by downloading the provided URL. Here is an example definition:\r\n\r\n```text\r\nDEFINE ANNOTATION Anatomy AS URL \"http://host/anatomy.belanno\"\r\nDEFINE NAMESPACE EGID AS URL \"http://host/entrez-gene-ids.belns\"\r\n```\r\n\r\nOr for a full example, see the [small corpus](https://github.com/OpenBEL/openbel-framework-resources/blob/latest/knowledge/small_corpus.bel).\r\n\r\nOpenBEL is moving to RDF representations for biological entities and BEL nanopubs. With RDF we are encouraged to use well-known URIs and for biological entities those are likely from [identifiers.org](http://identifiers.org/). See #65 for more information on identifiers.org. Defining URLs for annotations and namespaces makes this transition difficult.\r\n\r\n**Proposal**\r\n\r\nIn a discussion ([notes](http://wiki.openbel.org/pages/viewpage.action?pageId=13729866)) with @juliakozlovsky and @sanea we discussed an intermediate solution that will allow configuration of annotations and namespaces including both a URL, for [OpenBEL framework](https://github.com/OpenBEL/openbel-framework) compatibility, and RDF URI.\r\n\r\nThis is a general solution to #65.\r\n\r\nWe proposed the following:\r\n\r\n- Support configurable annotations when creating a [BEL::Script::Parser](https://github.com/OpenBEL/bel.rb/blob/master/lib/bel/ragel/bel.rl#L73-L85) class.\r\n- Construct file format to capture keyword, URL, and RDF URI prefix (e.g. `http://identifiers.org/hgnc/` for HGNC).\r\n- Provide a command-line option to pass to the `bin/bel2rdf.rb` command that expects to receive a file with this format. I propose `-r` and `--resource-override` for the name.\r\n- Convert resource override file to objects that the parser can use to set annotations and namespaces."},"comment":{"url":"https://api.github.com/repos/OpenBEL/bel.rb/issues/comments/194389284","html_url":"https://github.com/OpenBEL/bel.rb/issues/92#issuecomment-194389284","issue_url":"https://api.github.com/repos/OpenBEL/bel.rb/issues/92","id":194389284,"user":{"login":"abargnesi","id":149445,"avatar_url":"https://avatars.githubusercontent.com/u/149445?v=3","gravatar_id":"","url":"https://api.github.com/users/abargnesi","html_url":"https://github.com/abargnesi","followers_url":"https://api.github.com/users/abargnesi/followers","following_url":"https://api.github.com/users/abargnesi/following{/other_user}","gists_url":"https://api.github.com/users/abargnesi/gists{/gist_id}","starred_url":"https://api.github.com/users/abargnesi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abargnesi/subscriptions","organizations_url":"https://api.github.com/users/abargnesi/orgs","repos_url":"https://api.github.com/users/abargnesi/repos","events_url":"https://api.github.com/users/abargnesi/events{/privacy}","received_events_url":"https://api.github.com/users/abargnesi/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T16:43:10Z","updated_at":"2016-03-09T16:43:10Z","body":"We also need to map source annotation/namespace references (i.e. in the source document) to chosen ones in the output (e.g. identifiers.org). This will allow the translator to rewrite the references according to this mapping.\r\n\r\nI'm dealing with this problem as well in #111. I should be able to use your file format directly if it contained this mapping of old to new annotation/namespace references.\r\n\r\nThoughts, @sanea, @juliakozlovsky?"}}