Skip to content

Commit 1a33e00

Browse files
committed
Finish 3.1.2
2 parents 2ca62f4 + 8c4eb44 commit 1a33e00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2090
-525
lines changed

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* Arto Bendiken <[email protected]>
22
* Ben Lavender <[email protected]>
3-
* Gregg Kellogg <gregg@kellogg-assoc.com>
3+
* Gregg Kellogg <gregg@greggkellogg.net>

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ group :debug do
2626
gem "redcarpet", platforms: :ruby
2727
gem "byebug", platforms: :mri
2828
gem 'guard-rspec'
29+
gem 'awesome_print', github: "akshaymohite/awesome_print", branch: "ruby-2-7-0-warnings-fix"
2930
end
3031

3132
group :test do

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ This is a pure-Ruby library for working with [Resource Description Framework
44
(RDF)][RDF] data.
55

66
* <https://ruby-rdf.github.com/rdf>
7-
* <https://blog.datagraph.org/2010/12/rdf-for-ruby>
8-
* <https://blog.datagraph.org/2010/03/rdf-for-ruby>
9-
* <https://blog.datagraph.org/2010/04/parsing-rdf-with-ruby>
10-
* <https://blog.datagraph.org/2010/04/rdf-repository-howto>
117

128
[![Gem Version](https://badge.fury.io/rb/rdf.png)](https://badge.fury.io/rb/rdf)
139
[![Build Status](https://travis-ci.org/ruby-rdf/rdf.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf)
@@ -33,6 +29,7 @@ This is a pure-Ruby library for working with [Resource Description Framework
3329
* Note, changes in mapping hashes to keyword arguments for Ruby 2.7+ may require that arguments be passed more explicitly, especially when the first argument is a Hash and there are optional keyword arguments. In this case, Hash argument may need to be explicitly included within `{}` and the optional keyword arguments may need to be specified using `**{}` if there are no keyword arguments.
3430
* Performs auto-detection of input to select appropriate Reader class if one
3531
cannot be determined from file characteristics.
32+
* Provisional support for [RDF*][].
3633

3734
### HTTP requests
3835

@@ -223,6 +220,46 @@ A separate [SPARQL][SPARQL doc] gem builds on basic BGP support to provide full
223220
foaf[:name] #=> RDF::URI("http://xmlns.com/foaf/0.1/name")
224221
foaf['mbox'] #=> RDF::URI("http://xmlns.com/foaf/0.1/mbox")
225222

223+
## RDF* (RDFStar)
224+
225+
[RDF.rb][] includes provisional support for [RDF*][] with an N-Triples/N-Quads syntax extension that uses inline statements in the _subject_ or _object_ position.
226+
227+
Internally, an `RDF::Statement` is treated as another resource, along with `RDF::URI` and `RDF::Node`, which allows an `RDF::Statement` to have a `#subject` or `#object` which is also an `RDF::Statement`.
228+
229+
**Note: This feature is subject to change or elimination as the standards process progresses.**
230+
231+
### Serializing a Graph containing embedded statements
232+
233+
require 'rdf/ntriples'
234+
statement = RDF::Statement(RDF::URI('bob'), RDF::Vocab::FOAF.age, RDF::Literal(23))
235+
graph = RDF::Graph.new << [statement, RDF::URI("ex:certainty"), RDF::Literal(0.9)]
236+
graph.dump(:ntriples, validate: false)
237+
# => '<<<bob> <http://xmlns.com/foaf/0.1/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer>>> <ex:certainty> "0.9"^^<http://www.w3.org/2001/XMLSchema#double> .'
238+
239+
### Reading a Graph containing embedded statements
240+
241+
By default, the N-Triples reader will reject a document containing a subject resource.
242+
243+
nt = '<<<bob> <http://xmlns.com/foaf/0.1/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer>>> <ex:certainty> "0.9"^^<http://www.w3.org/2001/XMLSchema#double> .'
244+
graph = RDF::Graph.new do |graph|
245+
RDF::NTriples::Reader.new(nt) {|reader| graph << reader}
246+
end
247+
# => RDF::ReaderError
248+
249+
Readers support a `rdfstar` option with either `:PG` (Property Graph) or `:SA` (Separate Assertions) modes. In `:PG` mode, statements that are used in the subject or object positions are also implicitly added to the graph:
250+
251+
graph = RDF::Graph.new do |graph|
252+
RDF::NTriples::Reader.new(nt, rdfstar: :PG) {|reader| graph << reader}
253+
end
254+
graph.count #=> 2
255+
256+
When using the `:SA` mode, only one statement is asserted, although the reified statement is contained within the graph.
257+
258+
graph = RDF::Graph.new do |graph|
259+
RDF::NTriples::Reader.new(nt, rdfstar: :SA) {|reader| graph << reader}
260+
end
261+
graph.count #=> 1
262+
226263
## Documentation
227264

228265
<https://rubydoc.info/github/ruby-rdf/rdf>
@@ -249,8 +286,6 @@ A separate [SPARQL][SPARQL doc] gem builds on basic BGP support to provide full
249286

250287
### RDF Serialization
251288

252-
<https://blog.datagraph.org/2010/04/parsing-rdf-with-ruby>
253-
254289
* {RDF::Format}
255290
* {RDF::Reader}
256291
* {RDF::Writer}
@@ -295,8 +330,6 @@ from BNode identity (i.e., they each entail the other)
295330

296331
### RDF Storage
297332

298-
<https://blog.datagraph.org/2010/04/rdf-repository-howto>
299-
300333
* {RDF::Repository}
301334
* {RDF::Countable}
302335
* {RDF::Enumerable}
@@ -419,7 +452,7 @@ see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
419452
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
420453
[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
421454
[JSONLD doc]: https://rubydoc.info/github/ruby-rdf/json-ld
422-
[LinkedData doc]: https://rubydoc.info/github/datagraph/linkeddata
455+
[LinkedData doc]: https://rubydoc.info/github/ruby-rdf/linkeddata
423456
[Microdata doc]: https://rubydoc.info/github/ruby-rdf/rdf-microdata
424457
[N3 doc]: https://rubydoc.info/github/ruby-rdf/rdf-n3
425458
[RDFa doc]: https://rubydoc.info/github/ruby-rdf/rdf-rdfa
@@ -442,6 +475,7 @@ see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
442475
[RDF::TriX]: https://ruby-rdf.github.com/rdf-trix
443476
[RDF::Turtle]: https://ruby-rdf.github.com/rdf-turtle
444477
[RDF::Raptor]: https://ruby-rdf.github.com/rdf-raptor
478+
[RDF*]: https://lists.w3.org/Archives/Public/public-rdf-star/
445479
[LinkedData]: https://ruby-rdf.github.com/linkeddata
446480
[JSON::LD]: https://ruby-rdf.github.com/json-ld
447481
[RestClient]: https://rubygems.org/gems/rest-client

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
3.1.2

etc/Gemfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)