rdf-marmotta 0.0.4 → 0.0.6
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 +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +5 -0
- data/README.md +1 -1
- data/Rakefile +23 -0
- data/UNLICENSE +24 -0
- data/jetty/.gitkeep +0 -0
- data/lib/rdf/marmotta.rb +28 -1
- data/lib/tasks/jetty.rake +19 -0
- data/rdf-marmotta.gemspec +6 -2
- data/spec/marmotta_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- metadata +51 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d25c88d77d8ced4a8c4bcb17822f614bce46248
|
4
|
+
data.tar.gz: ceba3df460c114a78b5eea6b146f79d007404c39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e1e5c2b40b5db654e827a3347cc8f1ea89f4218da9b850fca6acc313fae889b649838baebaa28db4d1d6926d18f83c64dda6962bdd41117d21889cbe70be4c1
|
7
|
+
data.tar.gz: d234bc13325174069d95f206ec97408aa04c3be62d19a2825c0379c174ca609ac427b7111fd2142a196eafbebe28853fc91132cef27902a2f83d6d84c94233a6
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/README.md
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rspec/core'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
require 'jettywrapper'
|
5
|
+
|
6
|
+
import 'lib/tasks/jetty.rake'
|
7
|
+
|
8
|
+
MARMOTTA_HOME = ENV['MARMOTTA_HOME'] ||
|
9
|
+
File.expand_path(File.join(Jettywrapper.app_root, 'marmotta'))
|
10
|
+
|
11
|
+
Jettywrapper.url =
|
12
|
+
'https://github.com/dpla/marmotta-jetty/archive/3.3.0-solr-4.9.0.zip'
|
13
|
+
|
14
|
+
desc "Run all specs in spec directory"
|
15
|
+
task :ci => ['jetty:clean'] do
|
16
|
+
Jettywrapper.wrap(quiet: true, jetty_port: 8983, :startup_wait => 30) do
|
17
|
+
Rake::Task["spec"].invoke
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "Run all specs in spec directory (excluding plugin specs)"
|
22
|
+
RSpec::Core::RakeTask.new(:spec)
|
23
|
+
task :default => :ci
|
data/UNLICENSE
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
2
|
+
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
4
|
+
distribute this software, either in source code form or as a compiled
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
6
|
+
means.
|
7
|
+
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
9
|
+
of this software dedicate any and all copyright interest in the
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
11
|
+
of the public at large and to the detriment of our heirs and
|
12
|
+
successors. We intend this dedication to be an overt act of
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
14
|
+
software under copyright law.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
24
|
+
For more information, please refer to <http://unlicense.org/>
|
data/jetty/.gitkeep
ADDED
File without changes
|
data/lib/rdf/marmotta.rb
CHANGED
@@ -14,11 +14,25 @@ module RDF
|
|
14
14
|
:ldpath => 'ldpath'
|
15
15
|
}
|
16
16
|
|
17
|
+
##
|
18
|
+
# Supported Accept headers for Marmotta. As of 3.3.0, Marmotta will reject
|
19
|
+
# a request if the first content type listed is not suppported.
|
20
|
+
#
|
21
|
+
# @see https://issues.apache.org/jira/browse/MARMOTTA-585
|
22
|
+
CTYPES = RDF::Format.content_types.select do |key, values|
|
23
|
+
!(values.map(&:to_s) & ['RDF::RDFXML::Format',
|
24
|
+
'RDF::Turtle::Format',
|
25
|
+
'RDF::TriG::Format',
|
26
|
+
'RDF::TriX::Format',
|
27
|
+
'RDF::N3::Format']).empty?
|
28
|
+
end
|
29
|
+
|
17
30
|
def initialize(base_url, options = {})
|
18
31
|
@endpoints = DEFAULT_OPTIONS
|
19
32
|
@endpoints.merge!(options)
|
20
33
|
@endpoints.each do |k, v|
|
21
|
-
|
34
|
+
next unless RDF::URI(v.to_s).relative?
|
35
|
+
@endpoints[k] = (RDF::URI(base_url.to_s) / v.to_s)
|
22
36
|
end
|
23
37
|
end
|
24
38
|
|
@@ -69,11 +83,24 @@ module RDF
|
|
69
83
|
end
|
70
84
|
|
71
85
|
class Client < SPARQL::Client
|
86
|
+
MARMOTTA_GRAPH_ALL = (Marmotta::CTYPES.keys + ['*/*;p=0.1'])
|
87
|
+
.join(', ').freeze
|
88
|
+
|
72
89
|
def initialize(url, options = {}, &block)
|
73
90
|
options[:method] ||= :get
|
74
91
|
options[:protocol] ||= '1.1'
|
75
92
|
super
|
76
93
|
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Limit to accepted content types per comment on RDF::Marmotta::CTYPES
|
97
|
+
def request(query, headers={}, &block)
|
98
|
+
headers['Accept'] ||= MARMOTTA_GRAPH_ALL if
|
99
|
+
(query.respond_to?(:expects_statements?) ?
|
100
|
+
query.expects_statements? :
|
101
|
+
(query =~ /CONSTRUCT|DESCRIBE|DELETE|CLEAR/))
|
102
|
+
super
|
103
|
+
end
|
77
104
|
end
|
78
105
|
end
|
79
106
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'jettywrapper'
|
3
|
+
|
4
|
+
namespace :jetty do
|
5
|
+
|
6
|
+
desc 'Configure solr schema'
|
7
|
+
task :config do
|
8
|
+
cp('solr_conf/schema.xml', 'jetty/solr/development-core/conf/schema.xml')
|
9
|
+
cp('solr_conf/solrconfig.xml',
|
10
|
+
'jetty/solr/development-core/conf/solrconfig.xml')
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Remove the jetty and marmotta directories and recreate them'
|
14
|
+
task :clean do
|
15
|
+
FileUtils.rm_rf(MARMOTTA_HOME)
|
16
|
+
Jettywrapper.clean
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/rdf-marmotta.gemspec
CHANGED
@@ -3,25 +3,29 @@ $:.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.0.
|
6
|
+
s.version = '0.0.6'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Tom Johnson"]
|
9
9
|
s.homepage = 'https://github.com/dpla/rdf-marmotta'
|
10
10
|
s.email = 'tom@dp.la'
|
11
11
|
s.summary = %q{RDF::Repository layer for Apache Marmotta.}
|
12
12
|
s.description = %q{RDF::Repository layer for Apache Marmotta.}
|
13
|
-
s.license = "
|
13
|
+
s.license = "Unlicense"
|
14
14
|
s.required_ruby_version = '>= 1.9.3'
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
18
18
|
|
19
|
+
s.add_dependency('rake')
|
19
20
|
s.add_dependency('rdf', '~> 1.1')
|
20
21
|
s.add_dependency('nokogiri')
|
21
22
|
s.add_dependency('rdf-rdfxml', '~> 1.1')
|
22
23
|
s.add_dependency('sparql-client', '~> 1.1')
|
24
|
+
s.add_development_dependency('jettywrapper')
|
25
|
+
s.add_development_dependency('linkeddata')
|
23
26
|
s.add_development_dependency('rspec')
|
24
27
|
s.add_development_dependency('rspec-its')
|
25
28
|
s.add_development_dependency('rdf-spec')
|
26
29
|
s.add_development_dependency('pry')
|
30
|
+
|
27
31
|
end
|
data/spec/marmotta_spec.rb
CHANGED
@@ -8,7 +8,7 @@ require 'rdf/marmotta'
|
|
8
8
|
|
9
9
|
describe RDF::Marmotta do
|
10
10
|
|
11
|
-
let(:base_url) { 'http://localhost:
|
11
|
+
let(:base_url) { 'http://localhost:8983/marmotta/' }
|
12
12
|
let(:opts) { {} }
|
13
13
|
let(:statement) { RDF::Statement(RDF::URI('http://api.dp.la/example/item/1234'), RDF::DC.title, 'Moomin') }
|
14
14
|
let(:statements) {
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'linkeddata'
|
1
2
|
require 'bundler/setup'
|
2
3
|
Bundler.setup
|
3
4
|
|
@@ -6,7 +7,7 @@ Dir['./spec/support/**/*.rb'].each { |f| require f }
|
|
6
7
|
RSpec.configure do |config|
|
7
8
|
config.color = true
|
8
9
|
config.tty = true
|
9
|
-
|
10
|
+
|
10
11
|
# Uncomment the following line to get errors and backtrace for deprecation warnings
|
11
12
|
# config.raise_errors_for_deprecations!
|
12
13
|
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-marmotta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rdf
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,34 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '1.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jettywrapper
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: linkeddata
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: rspec
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,15 +170,21 @@ executables: []
|
|
128
170
|
extensions: []
|
129
171
|
extra_rdoc_files: []
|
130
172
|
files:
|
173
|
+
- ".gitignore"
|
174
|
+
- ".travis.yml"
|
131
175
|
- Gemfile
|
132
176
|
- README.md
|
177
|
+
- Rakefile
|
178
|
+
- UNLICENSE
|
179
|
+
- jetty/.gitkeep
|
133
180
|
- lib/rdf/marmotta.rb
|
181
|
+
- lib/tasks/jetty.rake
|
134
182
|
- rdf-marmotta.gemspec
|
135
183
|
- spec/marmotta_spec.rb
|
136
184
|
- spec/spec_helper.rb
|
137
185
|
homepage: https://github.com/dpla/rdf-marmotta
|
138
186
|
licenses:
|
139
|
-
-
|
187
|
+
- Unlicense
|
140
188
|
metadata: {}
|
141
189
|
post_install_message:
|
142
190
|
rdoc_options: []
|