33[ Turtle] [ ] reader/writer for [ RDF.rb] [ RDF.rb ] .
44
55[ ![ Gem Version] ( https://badge.fury.io/rb/rdf-turtle.png )] ( https://badge.fury.io/rb/rdf-turtle )
6- [ ![ Build Status] ( https://travis-ci.org/ruby-rdf/rdf-turtle.png?branch=master )] ( https://travis-ci.org/ruby-rdf/rdf-turtle )
7- [ ![ Coverage Status] ( https://coveralls.io/repos/ruby-rdf/rdf-turtle/badge.svg )] ( https://coveralls.io/r/ruby-rdf/rdf-turtle )
6+ [ ![ Build Status] ( https://github.com/ruby-rdf/rdf-turtle/workflows/CI/badge.svg?branch=develop )] ( https://github.com/ruby-rdf/rdf-turtle/actions?query=workflow%3ACI )
7+ [ ![ Coverage Status] ( https://coveralls.io/repos/ruby-rdf/rdf-turtle/badge.svg )] ( https://coveralls.io/github/ruby-rdf/rdf-turtle )
8+ [ ![ Gitter chat] ( https://badges.gitter.im/ruby-rdf/rdf.png )] ( https://gitter.im/ruby-rdf/rdf )
89
910## Description
1011This is a [ Ruby] [ ] implementation of a [ Turtle] [ ] parser for [ RDF.rb] [ ] .
@@ -65,19 +66,29 @@ By default, the Turtle reader will reject a document containing a subject resour
6566 end
6667 # => RDF::ReaderError
6768
68- 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:
69+ Readers support a boolean valued ` rdfstar ` option; only one statement is asserted, although the reified statement is contained within the graph.
6970
7071 graph = RDF::Graph.new do |graph|
71- RDF::Turtle::Reader.new(ttl, rdfstar: :PG ) {|reader| graph << reader}
72+ RDF::Turtle::Reader.new(ttl, rdfstar: true ) {|reader| graph << reader}
7273 end
73- graph.count #=> 2
74+ graph.count #=> 1
75+
76+ ### Reading a Graph containing statement annotations
7477
75- When using the ` :SA ` mode, only one statement is asserted, although the reified statement is contained within the graph.
78+ Annotations are introduced using the ` {| ... |} ` syntax, which is treated like a ` blankNodePropertyList ` ,
79+ where the subject is the the triple ending with that annotation.
7680
81+ ttl = %(
82+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
83+ @prefix ex: <http://example.com/> .
84+ <bob> foaf:age 23 {| ex:certainty 9.0e-1 |} .
85+ )
7786 graph = RDF::Graph.new do |graph|
78- RDF::Turtle::Reader.new(ttl, rdfstar: :SA ) {|reader| graph << reader}
87+ RDF::Turtle::Reader.new(ttl) {|reader| graph << reader}
7988 end
80- graph.count #=> 1
89+ # => RDF::ReaderError
90+
91+ Note that this requires the ` rdfstar ` option to be se.
8192
8293## Documentation
8394Full documentation available on [ Rubydoc.info] [ Turtle doc ]
@@ -159,7 +170,9 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
159170 list in the the ` README ` . Alphabetical order applies.
160171* Do note that in order for us to merge any non-trivial changes (as a rule
161172 of thumb, additions larger than about 15 lines of code), we need an
162- explicit [ public domain dedication] [ PDD ] on record from you.
173+ explicit [ public domain dedication] [ PDD ] on record from you,
174+ which you will be asked to agree to on the first commit to a repo within the organization.
175+ Note that the agreement applies to all repos in the [ Ruby RDF] ( https://github.com/ruby-rdf/ ) organization.
163176
164177## License
165178This is free and unencumbered public domain software. For more information,
@@ -171,13 +184,13 @@ A copy of the [Turtle EBNF][] and derived parser files are included in the repos
171184[ RDF ] : https://www.w3.org/RDF/
172185[ YARD ] : https://yardoc.org/
173186[ YARD-GS ] : https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
174- [ PDD ] : https://lists.w3. org/Archives/Public/public-rdf-ruby/2010May/0013.html
187+ [ PDD ] : https://unlicense. org/#unlicensing-contributions
175188[ RDF.rb ] : https://rubydoc.info/github/ruby-rdf/rdf
176189[ EBNF ] : https://rubygems.org/gems/ebnf
177190[ Backports ] : https://rubygems.org/gems/backports
178191[ N-Triples ] : https://www.w3.org/TR/rdf-testcases/#ntriples
179192[ Turtle ] : https://www.w3.org/TR/2012/WD-turtle-20120710/
180- [ RDF* ] : https://lists.w3.org/Archives/Public/public- rdf-star/
193+ [ RDF* ] : https://w3c.github.io/ rdf-star/rdf-star-cg-spec.html
181194[ Turtle doc ] : https://rubydoc.info/github/ruby-rdf/rdf-turtle/master/file/README.md
182195[ Turtle EBNF ] : https://dvcs.w3.org/hg/rdf/file/default/rdf-turtle/turtle.bnf
183196[ Freebase Dumps ] : https://developers.google.com/freebase/data
0 commit comments