Project

rdf-borsh

0.0
The project is in a healthy, maintained state
An RDF.rb extension for encoding and decoding RDF knowledge graphs in the Borsh binary serialization format.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.3
~> 3.12
~> 0.9

Runtime

~> 0.3
~> 3.3
 Project Readme

RDF/Borsh for Ruby

License Compatibility Package

An RDF.rb extension for encoding and decoding RDF knowledge graphs in the Borsh binary serialization format.

🛠️ Prerequisites

⬇️ Installation

Installation via RubyGems

gem install rdf-borsh

👉 Examples

Importing the library

require 'rdf/borsh'

include RDF

Serializing an RDF graph into an RDF/Borsh file

RDF::Borsh::Writer.open("mygraph.rdfb") do |writer|
  writer << [RDF::URI("https://rubygems.org/gems/rdf-borsh"), RDFS.label, "RDF/Borsh for Ruby"]
end

Parsing an RDF graph from an RDF/Borsh file

graph = RDF::Graph.load("mygraph.rdfb")
graph.to_a

Parsing an RDF/Borsh dataset from standard input

RDF::Borsh::Reader.new($stdin).to_a

👨‍💻 Development

git clone https://github.com/ruby-rdf/rdf-borsh.git

Share on Twitter Share on Reddit Share on Hacker News Share on Facebook