rdf-marmotta 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -4
- data/lib/rdf/marmotta.rb +13 -4
- data/rdf-marmotta.gemspec +3 -3
- data/spec/marmotta_spec.rb +3 -9
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72224b38f944e869e52d585f5e4fd51c1d2486d8
|
4
|
+
data.tar.gz: 3c4daa11a5bc60193dea167c6a6ca9cde25e3d8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c211a6c914e42cf76bb759cf3fc6d901756162aa24ad38a61e79f9532b636b79760095c57afb9d993d49b828d48dd1f8e23a57d397fd32049b3939a987f82969
|
7
|
+
data.tar.gz: a4e50b29a91333e5966d28abdb6029e29de4786b10d6dbfa93ae4a0f7359962f5bccd414dbecfdbe8f1c68cda27cc3549ed22852d733f9ceb6434eb11e84852b
|
data/.travis.yml
CHANGED
data/lib/rdf/marmotta.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'rdf'
|
2
|
-
require 'rdf/rdfxml'
|
3
2
|
require 'sparql/client'
|
4
3
|
require 'enumerator'
|
5
4
|
|
@@ -29,14 +28,17 @@ module RDF
|
|
29
28
|
end
|
30
29
|
|
31
30
|
def initialize(base_url, options = {})
|
32
|
-
@options
|
31
|
+
@options = options.dup
|
32
|
+
|
33
|
+
@tx_class ||= @options.delete(:transaction_class) { DEFAULT_TX_CLASS }
|
34
|
+
|
33
35
|
@endpoints = DEFAULT_OPTIONS
|
34
36
|
@endpoints.merge!(options)
|
35
37
|
@endpoints.each do |k, v|
|
36
38
|
next unless RDF::URI(v.to_s).relative?
|
37
39
|
@endpoints[k] = (RDF::URI(base_url.to_s) / v.to_s)
|
38
40
|
end
|
39
|
-
@client
|
41
|
+
@client = Client.new(endpoints[:sparql].to_s, options)
|
40
42
|
@update_client = Client.new(endpoints[:sparql_update].to_s, options)
|
41
43
|
end
|
42
44
|
|
@@ -68,7 +70,7 @@ module RDF
|
|
68
70
|
.join(', ').freeze
|
69
71
|
|
70
72
|
def initialize(url, options = {}, &block)
|
71
|
-
options[:method]
|
73
|
+
options[:method] ||= :get
|
72
74
|
options[:protocol] ||= '1.1'
|
73
75
|
super
|
74
76
|
end
|
@@ -84,6 +86,13 @@ module RDF
|
|
84
86
|
super
|
85
87
|
end
|
86
88
|
|
89
|
+
##
|
90
|
+
# @private
|
91
|
+
def parse_rdf_serialization(response, options = {})
|
92
|
+
options[:content_type] ||= 'text/turtle' if response.content_type.nil?
|
93
|
+
super
|
94
|
+
end
|
95
|
+
|
87
96
|
# Do HTTP POST if it's an INSERT
|
88
97
|
def request_method(query)
|
89
98
|
method = (self.options[:method] || DEFAULT_METHOD).to_sym
|
data/rdf-marmotta.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "rdf-marmotta"
|
6
|
-
s.version = '0.1.
|
6
|
+
s.version = '0.1.1'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Tom Johnson"]
|
9
9
|
s.homepage = 'https://github.com/dpla/rdf-marmotta'
|
@@ -17,8 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
18
18
|
|
19
19
|
s.add_dependency('rake')
|
20
|
-
s.add_dependency('rdf',
|
21
|
-
s.add_dependency('sparql-client', '~> 2.0.
|
20
|
+
s.add_dependency('rdf', '~> 2.0')
|
21
|
+
s.add_dependency('sparql-client', '~> 2.0.1')
|
22
22
|
s.add_dependency('nokogiri')
|
23
23
|
s.add_development_dependency('jettywrapper')
|
24
24
|
s.add_development_dependency('linkeddata')
|
data/spec/marmotta_spec.rb
CHANGED
@@ -48,7 +48,6 @@ describe RDF::Marmotta do
|
|
48
48
|
# We probably want to pursue skolemization and/or talk to Marmotta
|
49
49
|
# folks about how they currently/should handle bnodes.
|
50
50
|
describe 'bnode handling' do
|
51
|
-
|
52
51
|
let(:node_triple) { RDF::Statement(RDF::Node.new, RDF::Vocab::DC.title, 'Moomin') }
|
53
52
|
|
54
53
|
xit 'deletes only the relevant bnode' do
|
@@ -96,7 +95,6 @@ describe RDF::Marmotta do
|
|
96
95
|
end
|
97
96
|
|
98
97
|
describe 'deleting' do
|
99
|
-
|
100
98
|
it 'delete triples' do
|
101
99
|
subject.delete(statement)
|
102
100
|
expect(subject.count).to eq 0
|
@@ -116,15 +114,11 @@ describe RDF::Marmotta do
|
|
116
114
|
|
117
115
|
|
118
116
|
# describe 'Repository' do
|
119
|
-
#
|
120
|
-
# @repository = subject
|
121
|
-
# end
|
117
|
+
# after { repository.clear }
|
122
118
|
|
123
|
-
#
|
124
|
-
# @repository.clear
|
125
|
-
# end
|
119
|
+
# let(:repository) { RDF::Marmotta.new(base_url, opts) }
|
126
120
|
|
127
|
-
#
|
121
|
+
# it_behaves_like 'an RDF::Repository'
|
128
122
|
# end
|
129
123
|
end
|
130
124
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-marmotta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.0.
|
47
|
+
version: 2.0.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.0.
|
54
|
+
version: 2.0.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,4 +207,3 @@ signing_key:
|
|
207
207
|
specification_version: 4
|
208
208
|
summary: RDF::Repository layer for Apache Marmotta.
|
209
209
|
test_files: []
|
210
|
-
has_rdoc:
|