Skip to content

Commit 0362948

Browse files
committed
Finish 1.1.0
2 parents 4a24c17 + 42c0829 commit 0362948

21 files changed

Lines changed: 615 additions & 888 deletions

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ script: "bundle exec rspec spec"
44
env:
55
- CI=true
66
rvm:
7-
#- jruby-19mode-1.7.4
87
- 1.9.3
98
- 2.0.0
10-
- rbx-19mode
9+
- jruby-19mode
10+
- rbx

Gemfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ source "https://rubygems.org"
22

33
gemspec
44

5-
gem "rdf", :git => "git://github.com/ruby-rdf/rdf.git"
6-
gem "rdf-xsd", :git => "git://github.com/ruby-rdf/rdf-xsd.git"
5+
gem "rdf", :git => "git://github.com/ruby-rdf/rdf.git", :branch => "develop"
6+
gem "rdf-rdfa", :git => "git://github.com/ruby-rdf/rdf-rdfa.git", :branch => "develop"
77

88
group :development do
9-
gem "rdf-spec", :git => "git://github.com/ruby-rdf/rdf-spec.git"
10-
gem "rdf-turtle", :git => "git://github.com/ruby-rdf/rdf-turtle.git"
9+
gem "rdf-xsd", :git => "git://github.com/ruby-rdf/rdf-xsd.git", :branch => "develop"
10+
gem 'json-ld', :git => "git://github.com/ruby-rdf/json-ld.git", :branch => "develop"
11+
gem 'rdf-isomorphic', :git => "git://github.com/ruby-rdf/rdf-isomorphic.git", :branch => "develop"
12+
gem "rdf-spec", :git => "git://github.com/ruby-rdf/rdf-spec.git", :branch => "develop"
13+
gem "rdf-turtle", :git => "git://github.com/ruby-rdf/rdf-turtle.git", :branch => "develop"
1114
end
1215

13-
group :test do
16+
group :debug do
1417
gem "wirble"
15-
gem "debugger", :platforms => [:mri_19]
18+
gem "ruby-debug", :platforms => :jruby
19+
gem "debugger", :platforms => :mri_19
20+
gem "byebug", :platforms => :mri_20
1621
end

README.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# RDF::RDFXML reader/writer
22

3-
[RDF/XML][RDF/XML] parser for [RDF.rb][RDF.rb].
3+
[RDF/XML][] reader/writer for [RDF.rb][].
44

55
[![Gem Version](https://badge.fury.io/rb/rdf-rdfxml.png)](http://badge.fury.io/rb/rdf-rdfxml)
66
[![Build Status](https://secure.travis-ci.org/ruby-rdf/rdf-rdfxml.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-rdfxml)
77

88
## DESCRIPTION
99

10-
RDF::RDFXML is an [RDF/XML][RDF/XML] reader/writer for Ruby using the [RDF.rb][RDF.rb] library suite.
10+
RDF::RDFXML is an [RDF/XML][RDF/XML] reader/writer for [Ruby][] using the [RDF.rb][RDF.rb] library suite.
1111

1212
## FEATURES
13-
RDF::RDFXML parses [RDF/XML][RDF/XML] into statements or triples and serializes triples, statements or graphs.
13+
RDF::RDFXML parses [RDF/XML][] into statements or triples and serializes triples, statements or graphs. It also serializes graphs to [RDF/XML][].
1414

15-
Fully compliant [RDF/XML][RDF/XML] parser and serializer.
15+
Fully compliant [RDF/XML][] parser and serializer.
1616

1717
Install with `gem install rdf-rdfxml`
1818

19+
* 100% free and unencumbered [public domain](http://unlicense.org/) software.
20+
* Implements a complete parser for [RDF/XML][].
21+
* Compatible with Ruby >= 1.9.2.
22+
1923
## Usage:
2024
Instantiate a parser and parse source, specifying type and base-URL
2125

@@ -25,13 +29,22 @@ Instantiate a parser and parse source, specifying type and base-URL
2529
end
2630
end
2731

32+
Define `xml:base` and `xmlns` definitions, and use for serialization using `:base_uri` an `:prefixes` options.
33+
34+
Canonicalize and validate using `:canonicalize` and `:validate` options.
35+
36+
Write a graph to a file:
37+
38+
RDF::RDFXML::Writer.open("etc/test.ttl") do |writer|
39+
writer << graph
40+
end
41+
2842
## Dependencies
29-
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.0)
30-
* Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.5.9)
31-
* Does not run properly on jRuby due to [Nokogiri][] issues.
43+
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.1)
44+
* Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.0)
3245

3346
## Documentation
34-
Full documentation available on [RubyForge](http://rubydoc.info/github/ruby-rdf/rdf-rdfxml/master/frames)
47+
Full documentation available on [Rubydoc.info][RDF/XML doc])
3548

3649
### Principle Classes
3750
* {RDF::RDFXML}
@@ -42,22 +55,14 @@ Full documentation available on [RubyForge](http://rubydoc.info/github/ruby-rdf/
4255
### Additional vocabularies
4356
* {RDF::XML}
4457

45-
### Patches
46-
* {Array}
47-
* {RDF::Queryable}
48-
* {Nokogiri::XML::Node}
49-
5058
## TODO
51-
* Add support for LibXML and REXML bindings, and use the best available
5259
* Consider a SAX-based parser for improved performance
53-
* jRuby integration awaiting improvements in Nokogiri
5460

5561
## Resources
5662
* [RDF.rb][RDF.rb]
5763
* [RDF/XML][RDF/XML]
58-
* [Distiller](http://distiller.kellogg-assoc)
59-
* [Documentation](http://rubygems.org/gems/rdf-rdfxml)
60-
* [History](file:file.History.html)
64+
* [Distiller](http://rdf.greggkellogg.net)
65+
* [Documentation][RDF/XML doc]
6166
* [RDF Tests](http://www.w3.org/2000/10/rdf-tests/rdfcore/allTestCases.html)
6267

6368
## Author
@@ -67,6 +72,7 @@ Full documentation available on [RubyForge](http://rubydoc.info/github/ruby-rdf/
6772
* [Nicholas Humfrey](http://github.com/njh) - <http://njh.me/>
6873

6974
## Contributing
75+
This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.
7076

7177
* Do your best to adhere to the existing coding conventions and idioms.
7278
* Don't use hard tabs, and don't leave trailing whitespace on any line.
@@ -87,13 +93,16 @@ see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
8793

8894
## FEEDBACK
8995

90-
* gregg@kellogg-assoc.com
96+
* gregg@greggkellogg.net
9197
* <http://rubygems.org/rdf-rdfxml>
9298
* <http://github.com/ruby-rdf/rdf-rdfxml>
9399
* <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
94100

95-
[RDF.rb]: http://rubygems.org/gems/rdf
96-
[RDF/XML]: http://www.w3.org/TR/REC-rdf-syntax/ "RDF/XML Syntax Specification"
97-
[YARD]: http://yardoc.org/
98-
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
99-
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
101+
[Ruby]: http://ruby-lang.org/
102+
[RDF]: http://www.w3.org/RDF/
103+
[RDF.rb]: http://rubygems.org/gems/rdf
104+
[RDF/XML]: http://www.w3.org/TR/REC-rdf-syntax/ "RDF/XML Syntax Specification"
105+
[YARD]: http://yardoc.org/
106+
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
107+
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
108+
[RDF/XML doc]: http://rubydoc.info/github/ruby-rdf/rdf-rdfxml/master/frames

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.3
1+
1.1.0
File renamed without changes.

example-files/jcoyne.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
require 'rubygems'
3+
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", 'lib')))
4+
require "bundler/setup"
5+
require 'rdf/rdfxml'
6+
7+
class Foo < RDF::Vocabulary('http://example.com#')
8+
property :hasList
9+
end
10+
11+
g = RDF::Graph.new
12+
u = RDF::URI.new('info:fedora/999')
13+
14+
list1 = RDF::Node.new
15+
list2 = RDF::Node.new
16+
17+
leaf1 = RDF::Node.new
18+
leaf2 = RDF::Node.new
19+
20+
g.insert([leaf1, RDF::DC.title, 'Hi' ])
21+
g.insert([leaf2, RDF::DC.title, 'There'])
22+
g.insert([list1, RDF.first, leaf1 ])
23+
g.insert([list1, RDF.rest, list2 ])
24+
g.insert([list2, RDF.first, leaf2 ])
25+
g.insert([list2, RDF.rest, RDF.nil])
26+
g.insert([u, Foo.hasList, list1 ])
27+
28+
puts g.dump(:rdfxml)
29+
puts g.dump(:ntriples)
File renamed without changes.

lib/rdf/rdfxml.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module RDF
2222
module RDFXML
2323
require 'rdf/rdfxml/format'
2424
require 'rdf/rdfxml/vocab'
25-
require 'rdf/rdfxml/patches/array_hacks'
2625
autoload :Reader, 'rdf/rdfxml/reader'
2726
autoload :Writer, 'rdf/rdfxml/writer'
2827
autoload :VERSION, 'rdf/rdfxml/version'

lib/rdf/rdfxml/patches/array_hacks.rb

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

lib/rdf/rdfxml/patches/graph_properties.rb

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

0 commit comments

Comments
 (0)