-
Notifications
You must be signed in to change notification settings - Fork 6
Version 0.7.0
RDF translation allows for RDF prefixes to be used. Default RDF prefixes are provided (Issue #69).
URI prefixes can now be configured when translating BEL to RDF.
The expected format uses YAML mappings. For example by default the following mapping is used:
belr: 'http://www.openbel.org/bel/'
belv: 'http://www.openbel.org/vocabulary/'
bele: 'http://www.openbel.org/evidence/'
pubmed: 'http://bio2rdf.org/pubmed:'
rdfs: 'http://www.w3.org/2000/01/rdf-schema#'
rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
You can provide your own RDF prefix file by providing options to bel2rdf.rb
and bel translate
. Keep in mind that RDF formats like NTriples and NQuads always write the full URIs.
bel2rdf.rb --bel file.bel --rdf-prefix-file prefix_file.yml --format turtle
bel translate --input-file file.bel --to-option rdf_prefix_file=prefix_file.yml bel turtle
Annotation and Namespace definitions can now be remapped using a YAML file (Issue #92).
Annotation and Namespace definitions can now be remapped during translation to RDF. This is most useful when converting OpenBEL resource URIs to something more well-known (e.g. identifiers.org).
A remap file uses YAML for its format. You can generate an example using the command:
bel remapfile
Then provide the remap file when translating to RDF:
bel2rdf.rb --bel file.bel --remap-file remap_file.yml --format turtle
bel translate --input-file file.bel --to-option remap_file=remap_file.yml bel turtle
The following is an example remap file providing both annotation and namespace remaps:
namespaces:
- 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/20131211/namespace/mesh-diseases.belns"
to:
prefix: "MESHD"
url: "http://resource.belframework.org/belframework/20131211/namespace/mesh-diseases.belns"
rdf_uri: "http://identifiers.org/meshd/"
annotations:
- remap:
from:
keyword: "Anatomy"
type: "url"
domain: "http://resource.belframework.org/belframework/20131211/annotation/anatomy.belanno"
to:
keyword: "Anatomy"
type: "url"
domain: "http://resource.belframework.org/belframework/20131211/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/"