rdf-do 2.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +1 -0
- data/VERSION +1 -1
- data/lib/rdf/do.rb +2 -1
- metadata +31 -20
- data/README +0 -121
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31dd20b8a37d2fef08f93c84fefdbcc3dde6c38e
|
4
|
+
data.tar.gz: 6a9381c39440e07f891ea85282e954459e7f02ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a676955dfaadc5aa51c690b924ce8c341b14a5c0db0db38122bc20c7a7df8c5e07a0d7de03a60cc1512f534817ab1f7f7fca7788f6507a46c6485c43196b56f
|
7
|
+
data.tar.gz: 2596e0cbc7263aff89dc88f377ff92723221832b58f5b556f0fccb1f40db99165a3e929caeb2000c53c87f5b3c8a89e929b1516a6f9b156c05d4c343e89f9a48
|
data/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./README.md
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.0
|
data/lib/rdf/do.rb
CHANGED
@@ -59,6 +59,7 @@ module RDF
|
|
59
59
|
def supports?(feature)
|
60
60
|
case feature.to_sym
|
61
61
|
when :graph_name then true
|
62
|
+
when :literal_equality then true
|
62
63
|
else false
|
63
64
|
end
|
64
65
|
end
|
@@ -309,7 +310,7 @@ module RDF
|
|
309
310
|
def query_pattern(pattern, options = {}, &block)
|
310
311
|
return enum_for(:query_pattern, pattern, options) unless block_given?
|
311
312
|
@nodes = {} # reset cache. FIXME this should probably be in Node.intern
|
312
|
-
reader = @adapter.query(self,pattern.
|
313
|
+
reader = @adapter.query(self, pattern.to_h)
|
313
314
|
while reader.next!
|
314
315
|
yield RDF::Statement.new(
|
315
316
|
subject: unserialize(reader.values[0]),
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-do
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Lavender
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.2'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '4.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.2'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '4.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: data_objects
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,58 +76,64 @@ dependencies:
|
|
70
76
|
name: rdf-spec
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- - "
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '2.2'
|
82
|
+
- - "<"
|
74
83
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
84
|
+
version: '4.0'
|
76
85
|
type: :development
|
77
86
|
prerelease: false
|
78
87
|
version_requirements: !ruby/object:Gem::Requirement
|
79
88
|
requirements:
|
80
|
-
- - "
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '2.2'
|
92
|
+
- - "<"
|
81
93
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
94
|
+
version: '4.0'
|
83
95
|
- !ruby/object:Gem::Dependency
|
84
96
|
name: rspec
|
85
97
|
requirement: !ruby/object:Gem::Requirement
|
86
98
|
requirements:
|
87
99
|
- - "~>"
|
88
100
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
101
|
+
version: '3.7'
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
93
105
|
requirements:
|
94
106
|
- - "~>"
|
95
107
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
108
|
+
version: '3.7'
|
97
109
|
- !ruby/object:Gem::Dependency
|
98
110
|
name: rspec-its
|
99
111
|
requirement: !ruby/object:Gem::Requirement
|
100
112
|
requirements:
|
101
113
|
- - "~>"
|
102
114
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
115
|
+
version: '1.2'
|
104
116
|
type: :development
|
105
117
|
prerelease: false
|
106
118
|
version_requirements: !ruby/object:Gem::Requirement
|
107
119
|
requirements:
|
108
120
|
- - "~>"
|
109
121
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
122
|
+
version: '1.2'
|
111
123
|
- !ruby/object:Gem::Dependency
|
112
124
|
name: yard
|
113
125
|
requirement: !ruby/object:Gem::Requirement
|
114
126
|
requirements:
|
115
127
|
- - "~>"
|
116
128
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0.
|
129
|
+
version: '0.9'
|
118
130
|
type: :development
|
119
131
|
prerelease: false
|
120
132
|
version_requirements: !ruby/object:Gem::Requirement
|
121
133
|
requirements:
|
122
134
|
- - "~>"
|
123
135
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0.
|
136
|
+
version: '0.9'
|
125
137
|
description: RDF.rb extension providing a DataObjects storage adapter.
|
126
138
|
email: public-rdf-ruby@w3.org
|
127
139
|
executables: []
|
@@ -149,17 +161,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
161
|
requirements:
|
150
162
|
- - ">="
|
151
163
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
164
|
+
version: 2.2.2
|
153
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
166
|
requirements:
|
155
167
|
- - ">="
|
156
168
|
- !ruby/object:Gem::Version
|
157
169
|
version: '0'
|
158
170
|
requirements: []
|
159
|
-
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 2.6.14
|
161
173
|
signing_key:
|
162
174
|
specification_version: 4
|
163
175
|
summary: RDF.rb extension providing a DataObjects storage adapter.
|
164
176
|
test_files: []
|
165
|
-
has_rdoc: false
|
data/README
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
# RDF::DataObjects
|
2
|
-
|
3
|
-
DataObjects-backed [RDF.rb][] repository, aiming for a simple use case and
|
4
|
-
currently targeting SQLite and Postgres.
|
5
|
-
|
6
|
-
* <http://github.com/ruby-rdf/rdf-do>
|
7
|
-
* <http://lists.w3.org/Archives/Public/public-rdf-ruby>
|
8
|
-
|
9
|
-
[![Gem Version](https://badge.fury.io/rb/rdf-do.png)](http://badge.fury.io/rb/rdf-do)
|
10
|
-
[![Build Status](https://travis-ci.org/ruby-rdf/rdf-do.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-do)
|
11
|
-
|
12
|
-
This was written for a tutorial, and is thus a pretty naive implementation so far.
|
13
|
-
RDF::DataObjects stores triples in a simple subject, predicate, object, context
|
14
|
-
table. Don't try to back a big website with it yet. Nonetheless, it works,
|
15
|
-
and it passes all its tests on Heroku as well.
|
16
|
-
|
17
|
-
Example:
|
18
|
-
|
19
|
-
repository = RDF::DataObjects::Repository.new uri: "sqlite3:test.db"
|
20
|
-
repository.insert(statement)
|
21
|
-
repository.count #=> 1
|
22
|
-
repository.delete(statement)
|
23
|
-
|
24
|
-
You can use any DataObjects compatible connection options to create a new
|
25
|
-
repository, but only SQLite3 and Postgres are implemented for now. The
|
26
|
-
different databases are *just* different enough with their handling of unique
|
27
|
-
constraints that some database-specific work is required for a new adapter, but
|
28
|
-
it's not much.
|
29
|
-
|
30
|
-
## Installation
|
31
|
-
|
32
|
-
The greatly preferred installation method is via RubyGems:
|
33
|
-
|
34
|
-
$ sudo gem install rdf-do
|
35
|
-
|
36
|
-
Requires Ruby >= 2.0
|
37
|
-
|
38
|
-
## Connecting
|
39
|
-
require 'rdf'
|
40
|
-
require 'rdf/do'
|
41
|
-
require 'do_postgres' # gem install do_postgres
|
42
|
-
require 'do_sqlite3' # gem install do_sqlite3
|
43
|
-
repo = RDF::DataObjects::Repository.new uri: "postgres://localhost/database"
|
44
|
-
repo = RDF::DataObjects::Repository.new uri: "sqlite3:test.db"
|
45
|
-
|
46
|
-
|
47
|
-
## Using
|
48
|
-
|
49
|
-
Your repository is a fully-functional [RDF.rb][] `RDF::Repository`. As with any
|
50
|
-
[RDF.rb][] repository, this includes the mixins `RDF::Enumerable`, `RDF::Mutable`,
|
51
|
-
`RDF::Durable`, and `RDF::Queryable`. Please see <http://rdf.rubyforge.org/RDF/Repository.html> for
|
52
|
-
more information.
|
53
|
-
|
54
|
-
Example:
|
55
|
-
|
56
|
-
require 'rdf'
|
57
|
-
require 'rdf/ntriples'
|
58
|
-
require 'data_objects'
|
59
|
-
require 'do_sqlite3'
|
60
|
-
require 'rdf/do'
|
61
|
-
|
62
|
-
repo = RDF::DataObjects::Repository.new uri: 'sqlite3:test.db'
|
63
|
-
# repo = RDF::DataObjects::Repository.new uri: 'postgres://postgres@server/database'
|
64
|
-
# heroku_repo = RDF::DataObjects::Repository.new uri: ENV['DATABASE_URL']
|
65
|
-
repo.load('http://datagraph.org/jhacker/foaf.nt')
|
66
|
-
|
67
|
-
# How many statements did we have?
|
68
|
-
repo.count
|
69
|
-
#=> 10
|
70
|
-
|
71
|
-
# Get the URI of the first subject
|
72
|
-
jhacker = repo.first.subject
|
73
|
-
#=> #<RDF::URI(http://datagraph.org/jhacker/foaf)>
|
74
|
-
|
75
|
-
# Delete everything to do with it
|
76
|
-
jhacker_statements = repo.query(subject: jhacker)
|
77
|
-
repo.delete *jhacker_statements
|
78
|
-
repo.count
|
79
|
-
#=> 7
|
80
|
-
|
81
|
-
# with Postgres, we could have done this, but SQLite gives us a locking error:
|
82
|
-
# repo.delete(*repo.query(subject: jhacker))
|
83
|
-
|
84
|
-
# Changed our mind--bring it back
|
85
|
-
repo.insert *jhacker_statements
|
86
|
-
repo.count
|
87
|
-
#=> 10
|
88
|
-
|
89
|
-
## Contributing
|
90
|
-
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.
|
91
|
-
|
92
|
-
* Do your best to adhere to the existing coding conventions and idioms.
|
93
|
-
* Don't use hard tabs, and don't leave trailing whitespace on any line.
|
94
|
-
* Do document every method you add using [YARD][] annotations. Read the
|
95
|
-
[tutorial][YARD-GS] or just look at the existing code for examples.
|
96
|
-
* Don't touch the `.gemspec`, `VERSION` or `AUTHORS` files. If you need to
|
97
|
-
change them, do so on your private branch only.
|
98
|
-
* Do feel free to add yourself to the `CREDITS` file and the corresponding
|
99
|
-
list in the the `README`. Alphabetical order applies.
|
100
|
-
* Do note that in order for us to merge any non-trivial changes (as a rule
|
101
|
-
of thumb, additions larger than about 15 lines of code), we need an
|
102
|
-
explicit [public domain dedication][PDD] on record from you.
|
103
|
-
|
104
|
-
## Support
|
105
|
-
|
106
|
-
The preferred method to report issues is the issue queue at
|
107
|
-
<http://github.com/ruby-rdf/rdf-do/issues>. You'll get the the most attention if
|
108
|
-
you submit a failing test for a bug, or a pending test for a feature.
|
109
|
-
|
110
|
-
We'd also like to hear from you on the mailing list:
|
111
|
-
<http://lists.w3.org/Archives/Public/public-rdf-ruby>
|
112
|
-
|
113
|
-
## Miscellany
|
114
|
-
|
115
|
-
* Author: Ben Lavender | <blavender@gmail.com> | <http://bhuga.net> | <http://blog.datagraph.org>
|
116
|
-
* 'License': RDF::DataObjects is free and unemcumbered software released into the public domain. For more information, see the included UNLICENSE file.
|
117
|
-
|
118
|
-
[RDF.rb]: http://rubygems.org/gems/rdf
|
119
|
-
[YARD]: http://yardoc.org/
|
120
|
-
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
121
|
-
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
|