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 +4 -4
- data/CHANGES.md +2 -0
- data/README.md +27 -2
- data/VERSION +1 -1
- data/lib/rdf/borsh/format.rb +1 -1
- data/lib/rdf/borsh/writer.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35de9225111f9f281e91c1a287470859366dfe8fce5d211416e8e0a4216cf42a
|
4
|
+
data.tar.gz: 01f1d2ecd33f0f016c021fb4d24de4ca1333beb739c27b3f1de2f8eff15f579e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
[](https://rubygems.org/gems/rdf-borsh)
|
5
5
|
[](https://rubygems.org/gems/rdf-borsh)
|
6
6
|
|
7
|
-
|
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.
|
1
|
+
1.0.1
|
data/lib/rdf/borsh/format.rb
CHANGED
data/lib/rdf/borsh/writer.rb
CHANGED
@@ -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.
|
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:
|
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: []
|