-
Notifications
You must be signed in to change notification settings - Fork 6
Version 0.5.0
Fix missing RDF prefixes when converting BEL Script to RDF (Issue #71)
There was an issue where the RDF prefix would not serialize to RDF using either bel translate bel rdf
or bel2rdf.rb
.
The issue was diagnosed, by @sanea, to be an issue with parsing BEL Script files in chunks. The missing prefix would always occur between the chunks of the file. More details in PR #99.
Error translating to JSON Evidence format using Oj adapter (Issue #93)
Writing JSON Evidence to a string was not supported within the translator when using the Oj adapter to serialize JSON. Now a StringIO is constructed to allow returning a JSON string.
Consistent representation of Annotation and Namespace references in Evidence model and translators (Issue #94)
The translator plugins did not agree on the format of annotation and namespace references. All have been updated to read/write annotations and namespaces as arrays of hashes. This schema further describes the format from the JSON Evidence perspective.
RDF conversion of Parameter does not include encoding type statement (Issue #96)
The encoding type of BEL parameters were not converted to RDF statements. The following example shows a BEL term that includes the encoding type of its BEL parameter:
<ns1:Term rdf:about='http://www.openbel.org/bel/p_HGNC_KRAS'>
<rdf:type rdf:resource='http://www.openbel.org/vocabulary/ProteinAbundance'></rdf:type>
<ns0:label>p(HGNC:KRAS)</ns0:label>
<ns3:hasConcept>
<ns5:AbundanceConcept rdf:about='http://www.openbel.org/bel/namespace/hgnc-human-genes/KRAS'>
<rdf:type rdf:resource='http://www.openbel.org/vocabulary/GeneConcept'></rdf:type>
<rdf:type rdf:resource='http://www.openbel.org/vocabulary/RNAConcept'></rdf:type>
<rdf:type rdf:resource='http://www.openbel.org/vocabulary/ProteinConcept'></rdf:type>
</ns5:AbundanceConcept>
</ns3:hasConcept>
</ns1:Term>
Introduced translators for additional RDF formats; split and removed the RDF translator in favor of one translator per RDF format (Issue #95)
The rdf
translator was split apart into a translator for each RDF format. This addition supports all of the formatters provided by RDF.rb. The gems provided by RDF.rb are needed as soft dependencies if the translator is created. The following translators are included:
- JSON-LD
- id:
jsonld
- id:
- N-Quads
- id:
nquads
- id:
- N-Triples
- id:
ntriples
- id:
- RDF/JSON
- id:
rj
- id:
- RDF/XML
- id:
rdfxml
- id:
- RDFa
- id:
rdfa
- id:
- TriG
- id:
trig
- id:
- TriX
- id:
trix
- id:
- Turtle
- id:
turtle
- id:
Example conversion from BEL to RDF/XML:
bel translator -i file.bel bel rdfxml
Warn when BEL namespace data could not be retrieved (Issue #97)
A warning will be outputted to standard error ff an annotation or namespace URL cannot be retrieved. The error will be similar to:
=====================================================================
Could not retrieve namespace.
Namespace:
http://resource.belframework.org/belframework/20150611/namespace/hgnc.belns
Error:
404 Not Found
=====================================================================
/usr/lib/ruby/2.3.0/open-uri.rb:359:in `open_http': 404 Not Found (OpenURI::HTTPError)
from /usr/lib/ruby/2.3.0/open-uri.rb:737:in `buffer_open'
from /usr/lib/ruby/2.3.0/open-uri.rb:212:in `block in open_loop'
from /usr/lib/ruby/2.3.0/open-uri.rb:210:in `catch'
from /usr/lib/ruby/2.3.0/open-uri.rb:210:in `open_loop'
from /usr/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri'
from /usr/lib/ruby/2.3.0/open-uri.rb:717:in `open'
from /usr/lib/ruby/2.3.0/open-uri.rb:35:in `open'
...
...
...
Added generator for random BEL Nanopubs using the bel generate subcommand (Issue #102)
A facility to generate random BEL Nanopubs was added. This can be accessed in ruby by the following:
require 'bel/gen'
include BEL::Gen::Evidence
# Generate 100 random BEL::Model::Evidence objects
100.times.map {
evidence
}
You can also write random BEL Nanopubs through a translator plugin using the bel generate subcommand. Here is an example that writes 10 random BEL Nanopubs to RDF/XML format:
bel generate --translator rdfxml --limit 10
Access BEL annotation resource values from external .belanno files (Issue #100)
BEL annotation resources (i.e. .belanno files) can now be retrieved. The available annotation values are also available from a BEL::Annotation::AnnotationDefinition object
. Here is an example in ruby:
require 'bel'
include BEL::Annotation
# Access from URL.
BEL::Annotation::AnnotationDefinition.new(
:Species,
"http://resource.belframework.org/belframework/latest-release/annotation/species-taxonomy-id.belanno"
).values
# => {:"9606"=>:"Homo sapiens", :"10090"=>:"Mus musculus", :"10116"=>:"Rattus norvegicus"}
# Access published OpenBEL annotations (BEL::Annotation::ANNOTATION_LATEST) as constants.
Species.values
# => {:"9606"=>:"Homo sapiens", :"10090"=>:"Mus musculus", :"10116"=>:"Rattus norvegicus"}
A warning will be outputted to standard error when an annotation URL cannot be retrieved.
Support different types of serialization within the BEL Script translator (Issue #98)
The BEL Script translator did not correctly serialize annotations using the SET
and UNSET
records. This issue was addressed by include three serialization strategies. An example best describes the three options:
discreet