rdf-borsh 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d3f80cf1f9a45652da775024fabd5c00d460f3d02c3ee34ed7ec355829a50f4
4
- data.tar.gz: c631076d5c4d8a9c57e2add7c937feb492699c3a5187ea735c06200713e9a03b
3
+ metadata.gz: 35de9225111f9f281e91c1a287470859366dfe8fce5d211416e8e0a4216cf42a
4
+ data.tar.gz: 01f1d2ecd33f0f016c021fb4d24de4ca1333beb739c27b3f1de2f8eff15f579e
5
5
  SHA512:
6
- metadata.gz: 1c45cf0db32119a5532825e288630b50d08634f72f8ef2e3c9d49719ca03aeaa2c3b52d03af4639163555ac90a17ff2f123eaaa01b1362fd28877b9c0a2dc13a
7
- data.tar.gz: ffc8a1a577fb3f8b0f0253de890dbb93366e7af112aab10af327ff27ce38e683462b2678027d6044c5fbb7106ceffc47768f7268bb71ef863e8108a807330b6d
6
+ metadata.gz: 8b3442aaf6fffe3abd8de243ca3f3af85fd3ae4b288997344d8051f43198d5601475539e63eea3a62c424b3075ce17dbf3a15f7092883a5909bb3f0c2a7187b5
7
+ data.tar.gz: bf2e5f7860fa8f733112713993ccb743b67960f732a7cfc0c4caada867b653d6d8b355d154a91649892459305c8177fe8c8eb6b4ae48f35684e652b1bb2baa0f
data/CHANGES.md CHANGED
@@ -5,4 +5,6 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 1.0.1 - 2025-01-07
9
+
8
10
  ## 1.0.0 - 2025-01-07
data/README.md CHANGED
@@ -4,10 +4,12 @@
4
4
  [![Compatibility](https://img.shields.io/badge/ruby-3.0%2B-blue)](https://rubygems.org/gems/rdf-borsh)
5
5
  [![Package](https://img.shields.io/gem/v/rdf-borsh)](https://rubygems.org/gems/rdf-borsh)
6
6
 
7
- A Ruby library for encoding and decoding RDF data using the [Borsh]
8
- binary serialization format.
7
+ An [RDF.rb] extension for encoding and decoding [RDF] knowledge graphs in
8
+ the [Borsh] binary serialization format.
9
9
 
10
10
  [Borsh]: https://borsh.io
11
+ [RDF]: https://www.w3.org/TR/rdf12-concepts/
12
+ [RDF.rb]: https://github.com/ruby-rdf/rdf
11
13
 
12
14
  ## 🛠️ Prerequisites
13
15
 
@@ -27,6 +29,29 @@ gem install rdf-borsh
27
29
 
28
30
  ```ruby
29
31
  require 'rdf/borsh'
32
+
33
+ include RDF
34
+ ```
35
+
36
+ ### Serializing an RDF graph into an RDF/Borsh file
37
+
38
+ ```ruby
39
+ RDF::Borsh::Writer.open("mygraph.rdfb") do |writer|
40
+ writer << [RDF::URI("https://rubygems.org/gems/rdf-borsh"), RDFS.label, "RDF/Borsh for Ruby"]
41
+ end
42
+ ```
43
+
44
+ ### Parsing an RDF graph from an RDF/Borsh file
45
+
46
+ ```ruby
47
+ graph = RDF::Graph.load("mygraph.rdfb")
48
+ graph.to_a
49
+ ```
50
+
51
+ ### Parsing an RDF/Borsh dataset from standard input
52
+
53
+ ```ruby
54
+ RDF::Borsh::Reader.new($stdin).to_a
30
55
  ```
31
56
 
32
57
  ## 👨‍💻 Development
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -4,7 +4,7 @@ require 'rdf/format'
4
4
 
5
5
  module RDF::Borsh
6
6
  class Format < RDF::Format
7
- content_type 'application/x-rdf+borsh', extension: :borsh
7
+ content_type 'application/x-rdf+borsh', extension: :rdfb
8
8
  reader { RDF::Borsh::Reader }
9
9
  writer { RDF::Borsh::Writer }
10
10
 
@@ -24,6 +24,7 @@ module RDF::Borsh
24
24
  when 0 then self.instance_eval(&block)
25
25
  else block.call(self)
26
26
  end
27
+ self.finish
27
28
  end
28
29
  end
29
30
  end
@@ -53,6 +54,7 @@ module RDF::Borsh
53
54
 
54
55
  # Writes the uncompressed header.
55
56
  def write_header
57
+ @output.binmode
56
58
  @output.write([MAGIC, VERSION, FLAGS].pack('a4CC'))
57
59
  @output.write([@quads_set.size].pack('V'))
58
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-borsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -93,8 +93,8 @@ dependencies:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0.9'
96
- description: A Ruby library for encoding and decoding RDF data using the Borsh binary
97
- serialization format.
96
+ description: An RDF.rb extension for encoding and decoding RDF knowledge graphs in
97
+ the Borsh binary serialization format.
98
98
  email: public-rdf-ruby@w3.org
99
99
  executables: []
100
100
  extensions: []