rdf 1.0.10.2 → 1.1.0.p0
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 +8 -8
- data/CREDITS +0 -2
- data/README +67 -20
- data/VERSION +1 -1
- data/etc/doap.nt +75 -75
- data/lib/rdf.rb +15 -64
- data/lib/rdf/format.rb +11 -20
- data/lib/rdf/mixin/countable.rb +4 -11
- data/lib/rdf/mixin/enumerable.rb +4 -8
- data/lib/rdf/mixin/mutable.rb +1 -4
- data/lib/rdf/mixin/queryable.rb +13 -60
- data/lib/rdf/model/graph.rb +46 -22
- data/lib/rdf/model/list.rb +27 -102
- data/lib/rdf/model/literal.rb +48 -100
- data/lib/rdf/model/literal/date.rb +1 -1
- data/lib/rdf/model/literal/datetime.rb +1 -35
- data/lib/rdf/model/literal/decimal.rb +0 -30
- data/lib/rdf/model/literal/double.rb +6 -14
- data/lib/rdf/model/literal/integer.rb +3 -11
- data/lib/rdf/model/literal/numeric.rb +0 -40
- data/lib/rdf/model/literal/time.rb +4 -3
- data/lib/rdf/model/node.rb +1 -3
- data/lib/rdf/model/statement.rb +7 -47
- data/lib/rdf/model/term.rb +9 -0
- data/lib/rdf/model/uri.rb +28 -68
- data/lib/rdf/model/value.rb +1 -31
- data/lib/rdf/nquads.rb +4 -7
- data/lib/rdf/ntriples.rb +2 -2
- data/lib/rdf/ntriples/format.rb +1 -2
- data/lib/rdf/ntriples/reader.rb +15 -68
- data/lib/rdf/ntriples/writer.rb +13 -53
- data/lib/rdf/query.rb +1 -8
- data/lib/rdf/query/pattern.rb +25 -7
- data/lib/rdf/query/solution.rb +3 -19
- data/lib/rdf/query/solutions.rb +4 -22
- data/lib/rdf/query/variable.rb +1 -3
- data/lib/rdf/reader.rb +8 -22
- data/lib/rdf/repository.rb +23 -5
- data/lib/rdf/transaction.rb +19 -8
- data/lib/rdf/util/aliasing.rb +3 -13
- data/lib/rdf/util/cache.rb +2 -3
- data/lib/rdf/util/file.rb +5 -15
- data/lib/rdf/vocab.rb +19 -20
- data/lib/rdf/writer.rb +5 -44
- metadata +12 -27
- data/lib/rdf/vocab/schema.rb +0 -652
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWZmZWNkYTZjMTY1NjlmMjAyMzM3MmE2ODVmZmUwZDY0NDE3NDkzMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGMzZWNkNzhjYmZlOTk4NjkyY2VhNjEzOTgyMjRmY2U1MjRiMjA4Zg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2M3OTczM2MwNjRkZWI4ZjgwNWUxZWY4MTJmNjAxMzY2NjUyYTAxMTI5NDlk
|
10
|
+
NDVkYWI0NTE5YmZhYmQ4NDI3ZTlhNzI4NmYxNWZiOTA0NmU5ZDhlYzFlN2M4
|
11
|
+
MTZlOWM1Yzk2Njg4OTYxMjgwY2E3NTlhZDJhZmU0YWY5NzIyYTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTE0M2E3OTQyYjgyMTgwOGEyYzI3ZTZlODA0MzQ2ZmIyMDEzYWU0OWFjZDhm
|
14
|
+
MDc5NmE3OTJiMTc1NDI1ZTg5NjhlYmU1MzlhMjNhYTdjM2Q0ZDA3MzM4ZmMy
|
15
|
+
MjA4MGNlOGM1YjNlM2UxODlhMTk0ZTYyYWM5NjBkMjJhNThiMjQ=
|
data/CREDITS
CHANGED
@@ -4,9 +4,7 @@
|
|
4
4
|
* Joey Geiger <jgeiger@gmail.com>
|
5
5
|
* Fumihiro Kato <fumi@fumi.me>
|
6
6
|
* Naoki Kawamukai <kna@slis.tsukuba.ac.jp>
|
7
|
-
* Tom Nixon <tom@tomn.co.uk>
|
8
7
|
* Hellekin O. Wolf <hellekin@cepheide.org>
|
9
8
|
* John Fieber <jrf@ursamaris.org>
|
10
9
|
* Keita Urashima <ursm@ursm.jp>
|
11
10
|
* Pius Uzamere <pius@alum.mit.edu>
|
12
|
-
* Judson Lester <nyarly@gmail.com>
|
data/README
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# RDF.rb: Linked Data for Ruby
|
2
|
+
[](http://travis-ci.org/ruby-rdf/rdf)
|
2
3
|
|
3
4
|
This is a pure-Ruby library for working with [Resource Description Framework
|
4
5
|
(RDF)][RDF] data.
|
@@ -9,15 +10,13 @@ This is a pure-Ruby library for working with [Resource Description Framework
|
|
9
10
|
* <http://blog.datagraph.org/2010/04/parsing-rdf-with-ruby>
|
10
11
|
* <http://blog.datagraph.org/2010/04/rdf-repository-howto>
|
11
12
|
|
12
|
-
[](http://badge.fury.io/rb/rdf)
|
13
|
-
[](http://travis-ci.org/ruby-rdf/rdf)
|
14
|
-
|
15
13
|
## Features
|
16
14
|
|
17
15
|
* 100% pure Ruby with minimal dependencies and no bloat.
|
16
|
+
* Fully compatible with [RDF 1.1][] specifications.
|
18
17
|
* 100% free and unencumbered [public domain](http://unlicense.org/) software.
|
19
18
|
* Provides a clean, well-designed RDF object model and related APIs.
|
20
|
-
* Supports parsing and serializing
|
19
|
+
* Supports parsing and serializing N-Triples out of the box, with more
|
21
20
|
serialization format support available through add-on plugins.
|
22
21
|
* Includes in-memory graph and repository implementations, with more storage
|
23
22
|
adapter support available through add-on plugins.
|
@@ -26,11 +25,48 @@ This is a pure-Ruby library for working with [Resource Description Framework
|
|
26
25
|
not modify any of Ruby's core classes or standard library.
|
27
26
|
* Based entirely on Ruby's autoloading, meaning that you can generally make
|
28
27
|
use of any one part of the library without needing to load up the rest.
|
29
|
-
* Compatible with Ruby
|
28
|
+
* Compatible with Ruby Ruby 1.9.x, Ruby 2.0, Rubinius and JRuby 1.7+.
|
30
29
|
* Compatible with older Ruby versions with the help of the [Backports][] gem.
|
31
30
|
* Performs auto-detection of input to select appropriate Reader class if one
|
32
31
|
cannot be determined from file characteristics.
|
33
32
|
|
33
|
+
## Differences between RDF 1.0 and RDF 1.1
|
34
|
+
|
35
|
+
This version of RDF.rb is fully compatible with [RDF 1.1][], but it creates some
|
36
|
+
marginal incompatibilities with [RDF 1.0][], as implemented in versions prior to
|
37
|
+
the 1.1 release of RDF.rb:
|
38
|
+
|
39
|
+
* Introduces {RDF::IRI}, as a synonym for {RDF::URI} either {RDF::IRI} or {RDF::URI} can be used interchangeably.
|
40
|
+
Versions of RDF.rb prior to the 1.1 release were already compatible with IRIs.
|
41
|
+
Internationalized Resource Identifiers (see [RFC3987][]) are a super-set of URIs (see [RFC3986][])
|
42
|
+
which allow for characters other than standard US-ASCII.
|
43
|
+
* {RDF::List} no longer emits a `rdf:List` type. However, it will now recognize
|
44
|
+
any subjects that are {RDF::Node} instances as being list elements, as long
|
45
|
+
as they have both `rdf:first` and `rdf:rest` predicates.
|
46
|
+
* {RDF::Graph} adding a `context` to a graph may only be done when the underlying
|
47
|
+
storage model supports contexts (the default {RDF::Repository} does).
|
48
|
+
The notion of `context` in RDF.rb is treated equivalently to [Named
|
49
|
+
Graphs](http://www.w3.org/TR/rdf11-concepts/#dfn-named-graph) within an RDF
|
50
|
+
Dataset, and graphs on their own are not named.
|
51
|
+
* {RDF::Graph}, {RDF::Statement} and {RDF::List} now include {RDF::Value}, and not {RDF::Resource}.
|
52
|
+
Made it clear that using {RDF::Graph} does not mean that it may be used within an
|
53
|
+
{RDF::Statement}, for this see {RDF::Term}.
|
54
|
+
* {RDF::Dataset} is introduced as a class alias of {RDF::Repository}.
|
55
|
+
This allows closer alignment to the RDF concept
|
56
|
+
of [Dataset](http://www.w3.org/TR/rdf11-concepts/#dfn-dataset).
|
57
|
+
* The `context` (or `name`) of a named graph within a Dataset or Repository may be
|
58
|
+
either an {RDF::IRI} or {RDF::Node}. Implementations of repositories may restrict
|
59
|
+
this to being only {RDF::IRI}.
|
60
|
+
* There are substantial and somewhat incompatible changes to {RDF::Literal}. In [RDF 1.1][],
|
61
|
+
all literals are typed, including plain literals and language tagged literals.
|
62
|
+
Internally, plain literals are given the `xsd:string` datatype and language tagged
|
63
|
+
literals are given the `rdf:langString` datatype. Creating a plain literal, without
|
64
|
+
a datatype or language, will automatically provide the `xsd:string` datatype; similar
|
65
|
+
for language tagged literals. Note that most serialization formats will remove this
|
66
|
+
datatype. Code which depends on a literal having the `xsd:string` datatype being different
|
67
|
+
from a plain literal (formally, without a datatype) may break. However note that the
|
68
|
+
`#has\_datatype?` will continue to return `false` for plain or language-tagged literals.
|
69
|
+
|
34
70
|
## Tutorials
|
35
71
|
|
36
72
|
* [Getting data from the Semantic Web using Ruby and RDF.rb](http://semanticweb.org/wiki/Getting_data_from_the_Semantic_Web_%28Ruby%29)
|
@@ -41,7 +77,7 @@ This is a pure-Ruby library for working with [Resource Description Framework
|
|
41
77
|
When installed, RDF.rb includes a `rdf` shell script which acts as a wrapper to perform a number of different
|
42
78
|
operations on RDF files using available readers and writers.
|
43
79
|
|
44
|
-
* `serialize`: Parse an RDF input and re-serializing to
|
80
|
+
* `serialize`: Parse an RDF input and re-serializing to N-Triples or another available format using `--output-format` option.
|
45
81
|
* `count`: Parse and RDF input and count the number of statements.
|
46
82
|
* `subjects`: Returns unique subjects from parsed input.
|
47
83
|
* `objects`: Returns unique objects from parsed input.
|
@@ -52,7 +88,7 @@ operations on RDF files using available readers and writers.
|
|
52
88
|
require 'rdf'
|
53
89
|
include RDF
|
54
90
|
|
55
|
-
### Writing RDF data using the
|
91
|
+
### Writing RDF data using the N-Triples format
|
56
92
|
|
57
93
|
require 'rdf/ntriples'
|
58
94
|
graph = RDF::Graph.new << [:hello, RDF::DC.title, "Hello, world!"]
|
@@ -62,7 +98,7 @@ or
|
|
62
98
|
|
63
99
|
RDF::Writer.open("hello.nt") { |writer| writer << graph }
|
64
100
|
|
65
|
-
### Reading RDF data in the
|
101
|
+
### Reading RDF data in the N-Triples format
|
66
102
|
|
67
103
|
require 'rdf/ntriples'
|
68
104
|
graph = RDF::Graph.load("http://ruby-rdf.github.com/rdf/etc/doap.nt")
|
@@ -81,7 +117,7 @@ to use when loading a file. The specific format to use can be forced using, e.g.
|
|
81
117
|
option where the specific format symbol is determined by the available readers. Both also use
|
82
118
|
MimeType or file extension, where available.
|
83
119
|
|
84
|
-
require '
|
120
|
+
require 'linkeddata'
|
85
121
|
|
86
122
|
graph = RDF::Graph.load("http://ruby-rdf.github.com/rdf/etc/doap.nq", :format => :nquads)
|
87
123
|
|
@@ -115,10 +151,7 @@ appropriate writer to use.
|
|
115
151
|
|
116
152
|
A specific sub-type of Writer can also be invoked directly:
|
117
153
|
|
118
|
-
|
119
|
-
|
120
|
-
repo = RDF::Repository.new << RDF::Statement.new(:hello, RDF::DC.title, "Hello, world!", :context => RDF::URI("context"))
|
121
|
-
File.open("hello.nq", "w") {|f| f << repo.dump(:nquads)}
|
154
|
+
graph.dump(:nquads)
|
122
155
|
|
123
156
|
## Reader/Writer convenience methods
|
124
157
|
{RDF::Enumerable} implements `to_{format}` for each available instance of {RDF::Reader}.
|
@@ -228,6 +261,23 @@ other gems:
|
|
228
261
|
|
229
262
|
The meta-gem [LinkedData][LinkedData doc] includes many of these gems.
|
230
263
|
|
264
|
+
### RDF Datatypes
|
265
|
+
|
266
|
+
RDF.rb only implements core datatypes from the
|
267
|
+
[RDF Datatype Map](http://www.w3.org/TR/rdf11-concepts/#datatype-maps). Most other
|
268
|
+
XSD and RDF datatype implementations can be find in the following:
|
269
|
+
|
270
|
+
* {RDF::XSD}
|
271
|
+
|
272
|
+
### Graph Isomorphism
|
273
|
+
|
274
|
+
Two graphs may be compared with each other to determine if they are _isomorphic_.
|
275
|
+
As BNodes within two different graphs are no equal, graphs may not be directly compared.
|
276
|
+
The `RDF::Isomorphic` gem may be used to determine if they make the same statements, aside
|
277
|
+
from BNode identity (i.e., they each entail the other)
|
278
|
+
|
279
|
+
* `RDF::Isomorphic`
|
280
|
+
|
231
281
|
### RDF Storage
|
232
282
|
|
233
283
|
<http://blog.datagraph.org/2010/04/rdf-repository-howto>
|
@@ -281,7 +331,7 @@ The meta-gem [LinkedData][LinkedData doc] includes many of these gems.
|
|
281
331
|
|
282
332
|
## Dependencies
|
283
333
|
|
284
|
-
* [Ruby](http://ruby-lang.org/) (>= 1.
|
334
|
+
* [Ruby](http://ruby-lang.org/) (>= 1.9.x)
|
285
335
|
* [Addressable](http://rubygems.org/gems/addressable) (>= 2.2.0)
|
286
336
|
|
287
337
|
## Installation
|
@@ -289,8 +339,7 @@ The meta-gem [LinkedData][LinkedData doc] includes many of these gems.
|
|
289
339
|
The recommended installation method is via [RubyGems](http://rubygems.org/).
|
290
340
|
To install the latest official release of RDF.rb, do:
|
291
341
|
|
292
|
-
% [sudo] gem install rdf # Ruby 1.
|
293
|
-
% [sudo] gem install backports rdf # Ruby 1.8.1+
|
342
|
+
% [sudo] gem install rdf # Ruby 1.9.x+
|
294
343
|
|
295
344
|
## Download
|
296
345
|
|
@@ -330,12 +379,10 @@ follows:
|
|
330
379
|
* [Joey Geiger](http://github.com/jgeiger) - <http://github.com/jgeiger>
|
331
380
|
* [Fumihiro Kato](http://github.com/fumi) - <http://fumi.me/>
|
332
381
|
* [Naoki Kawamukai](http://github.com/kna) - <http://github.com/kna>
|
333
|
-
* [Tom Nixon](https://github.com/tomjnixon) - <https://github.com/tomjnixon>
|
334
382
|
* [Hellekin O. Wolf](http://github.com/hellekin) - <http://hellekin.cepheide.org/>
|
335
383
|
* [John Fieber](http://github.com/jfieber) - <http://github.com/jfieber>
|
336
384
|
* [Keita Urashima](http://github.com/ursm) - <http://ursm.jp/>
|
337
385
|
* [Pius Uzamere](http://github.com/pius) - <http://pius.me/>
|
338
|
-
* [Judson Lester](https://github.com/nyarly) - <https://github.com/nyarly>
|
339
386
|
|
340
387
|
## Contributing
|
341
388
|
|
@@ -360,8 +407,6 @@ This is free and unencumbered public domain software. For more information,
|
|
360
407
|
see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
361
408
|
|
362
409
|
[RDF]: http://www.w3.org/RDF/
|
363
|
-
[N-Triples]: http://www.w3.org/TR/n-triples/
|
364
|
-
[N-Quads]: http://www.w3.org/TR/n-quads/
|
365
410
|
[YARD]: http://yardoc.org/
|
366
411
|
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
367
412
|
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
|
@@ -374,6 +419,8 @@ see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
|
374
419
|
[RDFXML doc]: http://rubydoc.info/github/ruby-rdf/rdf-rdfxml/master/frames
|
375
420
|
[Turtle doc]: http://rubydoc.info/github/ruby-rdf/rdf-turtle/master/frames
|
376
421
|
[SPARQL doc]: http://rubydoc.info/github/ruby-rdf/sparql/frames
|
422
|
+
[RDF 1.0]: http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/
|
423
|
+
[RDF 1.1]: http://www.w3.org/TR/rdf11-concepts/
|
377
424
|
[SPARQL 1.0]: http://www.w3.org/TR/rdf-sparql-query/
|
378
425
|
[RDF.rb]: http://ruby-rdf.github.com/
|
379
426
|
[RDF::DO]: http://ruby-rdf.github.com/rdf-do
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.1.0.p0
|
data/etc/doap.nt
CHANGED
@@ -1,85 +1,85 @@
|
|
1
|
-
<http://rubygems.org/gems/rdf> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
|
2
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#name> "RDF.rb" .
|
3
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#homepage> <http://rubygems.org/gems/rdf> .
|
4
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#license> <http://creativecommons.org/licenses/publicdomain/> .
|
5
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#shortdesc> "A Ruby library for working with Resource Description Framework (RDF) data."@en .
|
6
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#description> "RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data."@en .
|
7
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#created> "2007-10-23" .
|
8
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#platform> "Ruby" .
|
9
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Resource_Description_Framework> .
|
10
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Ruby_(programming_language)> .
|
11
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/rdf-concepts/> .
|
12
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/n-quads/> .
|
13
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/n-triples/> .
|
14
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubyforge.org/projects/rdf/> .
|
15
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#bug-database> <http://github.com/ruby-rdf/rdf/issues> .
|
16
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://ar.to/> .
|
17
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://blog.datagraph.org/> .
|
18
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#vendor> <http://datagraph.org/> .
|
19
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#developer> <http://ar.to/#self> .
|
20
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#developer> <http://bhuga.net/#ben> .
|
21
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#developer> <http://greggkellogg.net/foaf#me> .
|
22
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#maintainer> <http://ar.to/#self> .
|
23
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#maintainer> <http://bhuga.net/#ben> .
|
24
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#maintainer> <http://greggkellogg.net/foaf#me> .
|
25
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://ar.to/#self> .
|
26
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://bhuga.net/#ben> .
|
27
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://greggkellogg.net/foaf#me> .
|
28
|
-
_:g70186318075540 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
29
|
-
_:g70186318075540 <http://xmlns.com/foaf/0.1/name> "Călin Ardelean" .
|
30
|
-
_:g70186318075540 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "274bd18402fc773ffc0606996aa1fb90b603aa29" .
|
31
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186318075540 .
|
32
|
-
_:g70186318591960 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
33
|
-
_:g70186318591960 <http://xmlns.com/foaf/0.1/name> "Danny Gagne" .
|
34
|
-
_:g70186318591960 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "6de43e9cf7de53427fea9765706703e4d957c17b" .
|
35
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186318591960 .
|
36
|
-
_:g70186318228820 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
37
|
-
_:g70186318228820 <http://xmlns.com/foaf/0.1/name> "Joey Geiger" .
|
38
|
-
_:g70186318228820 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "f412d743150d7b27b8468d56e69ca147917ea6fc" .
|
39
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186318228820 .
|
40
|
-
_:g70186318408440 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
41
|
-
_:g70186318408440 <http://xmlns.com/foaf/0.1/name> "Fumihiro Kato" .
|
42
|
-
_:g70186318408440 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "d31fdd6af7a279a89bf09fdc9f7c44d9d08bb930" .
|
43
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186318408440 .
|
44
|
-
_:g70186318725620 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
45
|
-
_:g70186318725620 <http://xmlns.com/foaf/0.1/name> "Naoki Kawamukai" .
|
46
|
-
_:g70186318725620 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "5bdcd8e2af4f5952aaeeffbdd371c41525ec761d" .
|
47
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186318725620 .
|
48
|
-
_:g70186319866820 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
49
|
-
_:g70186319866820 <http://xmlns.com/foaf/0.1/name> "Hellekin O. Wolf" .
|
50
|
-
_:g70186319866820 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "c69f3255ff0639543cc5edfd8116eac8df16fab8" .
|
51
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186319866820 .
|
52
|
-
_:g70186321042840 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
53
|
-
_:g70186321042840 <http://xmlns.com/foaf/0.1/name> "John Fieber" .
|
54
|
-
_:g70186321042840 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "f7653fc1ac0e82ebb32f092389bd5fc728eaae12" .
|
55
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186321042840 .
|
56
|
-
_:g70186319319640 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
57
|
-
_:g70186319319640 <http://xmlns.com/foaf/0.1/name> "Keita Urashima" .
|
58
|
-
_:g70186319319640 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "2b4247b6fd5bb4a1383378f325784318680d5ff9" .
|
59
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186319319640 .
|
60
|
-
_:g70186321063140 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
61
|
-
_:g70186321063140 <http://xmlns.com/foaf/0.1/name> "Pius Uzamere" .
|
62
|
-
_:g70186321063140 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "bedbbf2451e5beb38d59687c0460032aff92cd3c" .
|
63
|
-
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:g70186321063140 .
|
64
|
-
<http://rubygems.org/gems/rdf> <http://xmlns.com/foaf/0.1/maker> <http://ar.to/#self> .
|
65
|
-
<http://rubygems.org/gems/rdf> <http://purl.org/dc/terms/creator> <http://ar.to/#self> .
|
66
1
|
<http://ar.to/#self> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
67
|
-
<http://ar.to/#self> <http://
|
2
|
+
<http://ar.to/#self> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bendiken/foaf> .
|
3
|
+
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/homepage> <http://ar.to/> .
|
4
|
+
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/made> <http://rubygems.org/gems/rdf> .
|
68
5
|
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox> <mailto:arto@bendiken.net> .
|
69
6
|
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "a033f652c84a4d73b8c26d318c2395699dd2bdfb" .
|
70
7
|
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "d0737cceb55eb7d740578d2db1bc0727e3ed49ce" .
|
71
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/
|
72
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/made> <http://rubygems.org/gems/rdf> .
|
73
|
-
<http://ar.to/#self> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bendiken/foaf> .
|
8
|
+
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/name> "Arto Bendiken" .
|
74
9
|
<http://bhuga.net/#ben> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
75
|
-
<http://bhuga.net/#ben> <http://
|
10
|
+
<http://bhuga.net/#ben> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bhuga/foaf> .
|
11
|
+
<http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/homepage> <http://bhuga.net/> .
|
76
12
|
<http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/mbox> <mailto:blavender@gmail.com> .
|
77
13
|
<http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "dbf45f4ffbd27b67aa84f02a6a31c144727d10af" .
|
78
|
-
<http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/
|
79
|
-
<http://bhuga.net/#ben> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bhuga/foaf> .
|
14
|
+
<http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/name> "Ben Lavender" .
|
80
15
|
<http://greggkellogg.net/foaf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
81
|
-
<http://greggkellogg.net/foaf#me> <http://
|
16
|
+
<http://greggkellogg.net/foaf#me> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://greggkellogg.net/foaf> .
|
17
|
+
<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/homepage> <http://greggkellogg.net/> .
|
82
18
|
<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/mbox> <mailto:gregg@greggkellogg.net> .
|
83
19
|
<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "35bc44e6d0070e5ad50ccbe0d24403c96af2b9bd" .
|
84
|
-
<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/
|
85
|
-
<http://
|
20
|
+
<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/name> "Gregg Kellogg" .
|
21
|
+
<http://rubygems.org/gems/rdf> <http://purl.org/dc/terms/creator> <http://ar.to/#self> .
|
22
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://ar.to/> .
|
23
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://blog.datagraph.org/> .
|
24
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#bug-database> <http://github.com/ruby-rdf/rdf/issues> .
|
25
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Resource_Description_Framework> .
|
26
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Ruby_(programming_language)> .
|
27
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#created> "2007-10-23" .
|
28
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#description> "RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data."@en .
|
29
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#developer> <http://ar.to/#self> .
|
30
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#developer> <http://bhuga.net/#ben> .
|
31
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#developer> <http://greggkellogg.net/foaf#me> .
|
32
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://ar.to/#self> .
|
33
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://bhuga.net/#ben> .
|
34
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://greggkellogg.net/foaf#me> .
|
35
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubyforge.org/projects/rdf/> .
|
36
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid1 .
|
37
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid2 .
|
38
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid3 .
|
39
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid4 .
|
40
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid5 .
|
41
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid6 .
|
42
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid7 .
|
43
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid8 .
|
44
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid9 .
|
45
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#homepage> <http://rubygems.org/gems/rdf> .
|
46
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://sw.deri.org/2008/07/n-quads/> .
|
47
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/2001/sw/RDFCore/ntriples/> .
|
48
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/rdf-concepts/> .
|
49
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#license> <http://creativecommons.org/licenses/publicdomain/> .
|
50
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#maintainer> <http://ar.to/#self> .
|
51
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#maintainer> <http://bhuga.net/#ben> .
|
52
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#maintainer> <http://greggkellogg.net/foaf#me> .
|
53
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#name> "RDF.rb" .
|
54
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#platform> "Ruby" .
|
55
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#shortdesc> "A Ruby library for working with Resource Description Framework (RDF) data."@en .
|
56
|
+
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#vendor> <http://datagraph.org/> .
|
57
|
+
<http://rubygems.org/gems/rdf> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
|
58
|
+
<http://rubygems.org/gems/rdf> <http://xmlns.com/foaf/0.1/maker> <http://ar.to/#self> .
|
59
|
+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
60
|
+
_:genid1 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "274bd18402fc773ffc0606996aa1fb90b603aa29" .
|
61
|
+
_:genid1 <http://xmlns.com/foaf/0.1/name> "C\u0103lin Ardelean" .
|
62
|
+
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
63
|
+
_:genid2 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "6de43e9cf7de53427fea9765706703e4d957c17b" .
|
64
|
+
_:genid2 <http://xmlns.com/foaf/0.1/name> "Danny Gagne" .
|
65
|
+
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
66
|
+
_:genid3 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "f412d743150d7b27b8468d56e69ca147917ea6fc" .
|
67
|
+
_:genid3 <http://xmlns.com/foaf/0.1/name> "Joey Geiger" .
|
68
|
+
_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
69
|
+
_:genid4 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "d31fdd6af7a279a89bf09fdc9f7c44d9d08bb930" .
|
70
|
+
_:genid4 <http://xmlns.com/foaf/0.1/name> "Fumihiro Kato" .
|
71
|
+
_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
72
|
+
_:genid5 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "5bdcd8e2af4f5952aaeeffbdd371c41525ec761d" .
|
73
|
+
_:genid5 <http://xmlns.com/foaf/0.1/name> "Naoki Kawamukai" .
|
74
|
+
_:genid6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
75
|
+
_:genid6 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "c69f3255ff0639543cc5edfd8116eac8df16fab8" .
|
76
|
+
_:genid6 <http://xmlns.com/foaf/0.1/name> "Hellekin O. Wolf" .
|
77
|
+
_:genid7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
78
|
+
_:genid7 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "f7653fc1ac0e82ebb32f092389bd5fc728eaae12" .
|
79
|
+
_:genid7 <http://xmlns.com/foaf/0.1/name> "John Fieber" .
|
80
|
+
_:genid8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
81
|
+
_:genid8 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "2b4247b6fd5bb4a1383378f325784318680d5ff9" .
|
82
|
+
_:genid8 <http://xmlns.com/foaf/0.1/name> "Keita Urashima" .
|
83
|
+
_:genid9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
84
|
+
_:genid9 <http://xmlns.com/foaf/0.1/mbox_sha1sum> "bedbbf2451e5beb38d59687c0460032aff92cd3c" .
|
85
|
+
_:genid9 <http://xmlns.com/foaf/0.1/name> "Pius Uzamere" .
|
data/lib/rdf.rb
CHANGED
@@ -5,26 +5,9 @@ require 'bigdecimal'
|
|
5
5
|
require 'date'
|
6
6
|
require 'time'
|
7
7
|
|
8
|
-
if RUBY_VERSION < '1.8.7'
|
9
|
-
# @see http://rubygems.org/gems/backports
|
10
|
-
begin
|
11
|
-
require 'backports/1.8.7'
|
12
|
-
rescue LoadError
|
13
|
-
begin
|
14
|
-
require 'rubygems'
|
15
|
-
require 'backports/1.8.7'
|
16
|
-
rescue LoadError
|
17
|
-
abort "RDF.rb requires Ruby 1.8.7 or the Backports gem (hint: `gem install backports')."
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
8
|
require 'rdf/version'
|
23
9
|
|
24
10
|
module RDF
|
25
|
-
# For compatibility with both Ruby 1.8.x and Ruby 1.9.x:
|
26
|
-
Enumerator = defined?(::Enumerator) ? ::Enumerator : ::Enumerable::Enumerator
|
27
|
-
|
28
11
|
# RDF mixins
|
29
12
|
autoload :Countable, 'rdf/mixin/countable'
|
30
13
|
autoload :Durable, 'rdf/mixin/durable'
|
@@ -39,6 +22,7 @@ module RDF
|
|
39
22
|
|
40
23
|
# RDF objects
|
41
24
|
autoload :Graph, 'rdf/model/graph'
|
25
|
+
autoload :IRI, 'rdf/model/uri'
|
42
26
|
autoload :Literal, 'rdf/model/literal'
|
43
27
|
autoload :Node, 'rdf/model/node'
|
44
28
|
autoload :Resource, 'rdf/model/resource'
|
@@ -62,6 +46,7 @@ module RDF
|
|
62
46
|
autoload :NQuads, 'rdf/nquads'
|
63
47
|
|
64
48
|
# RDF storage
|
49
|
+
autoload :Dataset, 'rdf/model/dataset'
|
65
50
|
autoload :Repository, 'rdf/repository'
|
66
51
|
autoload :Transaction, 'rdf/transaction'
|
67
52
|
|
@@ -133,30 +118,11 @@ module RDF
|
|
133
118
|
end
|
134
119
|
|
135
120
|
##
|
136
|
-
#
|
137
|
-
#
|
138
|
-
# @overload Statement(options = {})
|
139
|
-
# @param [Hash{Symbol => Object}] options
|
140
|
-
# @option options [RDF::Resource] :subject (nil)
|
141
|
-
# @option options [RDF::URI] :predicate (nil)
|
142
|
-
# @option options [RDF::Term] :object (nil)
|
143
|
-
# @option options [RDF::Resource] :context (nil)
|
144
|
-
# Note, in RDF 1.1, a context MUST be an IRI.
|
145
|
-
#
|
146
|
-
# @overload Statement(subject, predicate, object, options = {})
|
147
|
-
# @param [RDF::Resource] subject
|
148
|
-
# @param [RDF::URI] predicate
|
149
|
-
# @param [RDF::Term] object
|
150
|
-
# @param [Hash{Symbol => Object}] options
|
151
|
-
# @option options [RDF::Resource] :context (nil)
|
152
|
-
# @return [RDF::Statement]
|
121
|
+
# Alias for `RDF::Statement.new`.
|
153
122
|
#
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
else
|
158
|
-
Statement.new(*args)
|
159
|
-
end
|
123
|
+
# @return [RDF::Statement]
|
124
|
+
def self.Statement(*args, &block)
|
125
|
+
Statement.new(*args, &block)
|
160
126
|
end
|
161
127
|
|
162
128
|
##
|
@@ -168,6 +134,12 @@ module RDF
|
|
168
134
|
Vocabulary.create(uri)
|
169
135
|
end
|
170
136
|
|
137
|
+
##
|
138
|
+
# @return [URI]
|
139
|
+
def self.type
|
140
|
+
self[:type]
|
141
|
+
end
|
142
|
+
|
171
143
|
##
|
172
144
|
# @return [#to_s] property
|
173
145
|
# @return [URI]
|
@@ -199,32 +171,11 @@ module RDF
|
|
199
171
|
RDF::URI.intern("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
|
200
172
|
end
|
201
173
|
|
202
|
-
# RDF Vocabulary terms
|
203
|
-
%w(
|
204
|
-
Alt
|
205
|
-
Bag
|
206
|
-
first
|
207
|
-
HTML
|
208
|
-
langString
|
209
|
-
List
|
210
|
-
nil
|
211
|
-
object
|
212
|
-
predicate
|
213
|
-
Property
|
214
|
-
rest
|
215
|
-
Seq
|
216
|
-
subject
|
217
|
-
type
|
218
|
-
value
|
219
|
-
XMLLiteral
|
220
|
-
).each do |term|
|
221
|
-
term_uri = self[term.to_sym]
|
222
|
-
define_method(term) {term_uri}
|
223
|
-
module_function term.to_sym
|
224
|
-
end
|
225
|
-
|
226
174
|
class << self
|
227
175
|
# For compatibility with `RDF::Vocabulary.__name__`:
|
228
176
|
alias_method :__name__, :name
|
177
|
+
|
178
|
+
# For IRI compatibility
|
179
|
+
alias_method :to_iri, :to_uri
|
229
180
|
end
|
230
181
|
end
|