rdf-ldp 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -12
- data/lib/rdf/ldp/helper.rb +9 -5
- data/lib/rdf/ldp/version.rb +1 -1
- data/lib/rdf/ldp/vocab.rb +10 -1
- data/rdf-ldp.gemspec +3 -2
- data/spec/helper_spec.rb +6 -6
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76067ed8fd6b28e3c35eb9bcb65d14585cd4e0fe
|
4
|
+
data.tar.gz: 098810c5faf3aca4dd7bc0992797eb1d4d309c67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fcb758fa163d0c6e229af2286f7332fd1561df33f56f23786e36de7a524dcfe6cb7457f0c26e06faf9cf6d7519f56df58a9b82958ff9e8e7e0398365cba6fe1
|
7
|
+
data.tar.gz: 465af32bf8ca54109cf01b555d626cc6e229ef83ffabc30d69eebd5ad1142697f3624cfbc38e618e1acf03b3b684d0e070a4bb36a157aba97ff802c10940d1f3
|
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# DEPRECATED - use rdf-vocab
|
2
|
+
|
3
|
+
This gem is deprecated; rdf-vocab gem (https://github.com/ruby-rdf/rdf-vocab, included in the linkeddata gem) now contains RDF::Vocab::LDP. You can find the helper method to strip LDP triples from an RDF::Graph object in the triannon gem in lib/oa_graph_helper.rb.
|
4
|
+
|
1
5
|
# rdf-ldp
|
2
6
|
|
3
7
|
[![Build Status](https://travis-ci.org/sul-dlss/rdf-ldp.svg)](https://travis-ci.org/sul-dlss/rdf-ldp) [![Dependency Status](https://gemnasium.com/sul-dlss/rdf-ldp.svg)](https://gemnasium.com/sul-dlss/rdf-ldp) [![Gem Version](https://badge.fury.io/rb/rdf-ldp.svg)](http://badge.fury.io/rb/rdf-ldp)
|
@@ -11,7 +15,7 @@ Also contains helper method to strip LDP triples from an RDF::Graph object.
|
|
11
15
|
Add this line to your application's Gemfile:
|
12
16
|
|
13
17
|
```ruby
|
14
|
-
gem 'rdf-ldp
|
18
|
+
gem 'rdf-vocab' # (was rdf-ldp)
|
15
19
|
```
|
16
20
|
|
17
21
|
And then execute:
|
@@ -20,19 +24,14 @@ And then execute:
|
|
20
24
|
|
21
25
|
Or install it yourself as:
|
22
26
|
|
23
|
-
$ gem install rdf-ldp
|
27
|
+
$ gem install rdf-vocab # (was rdf-ldp)
|
24
28
|
|
25
29
|
## Usage
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
RDF::LDP.member #=> RDF::URI("http://www.w3.org/ns/ldp#member")
|
31
|
+
require 'rdf/vocab'
|
32
|
+
|
33
|
+
RDF::Vocab::LDP.member #=> RDF::URI("http://www.w3.org/ns/ldp#member")
|
31
34
|
|
32
|
-
|
35
|
+
# DEPRECATED - use rdf-vocab
|
33
36
|
|
34
|
-
|
35
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
36
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
37
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
38
|
-
5. Create a new Pull Request
|
37
|
+
This gem is deprecated; rdf-vocab gem (https://github.com/ruby-rdf/rdf-vocab, included in the linkeddata gem) now contains RDF::Vocab::LDP. You can find the helper method to strip LDP triples from an RDF::Graph object in the triannon gem in lib/oa_graph_helper.rb.
|
data/lib/rdf/ldp/helper.rb
CHANGED
@@ -1,16 +1,19 @@
|
|
1
|
-
require '
|
1
|
+
require 'deprecation'
|
2
2
|
|
3
3
|
# mixin methods
|
4
4
|
module RDF
|
5
|
-
class
|
5
|
+
class LDPDeprecated < RDF::StrictVocabulary("http://www.w3.org/ns/ldp")
|
6
|
+
extend Deprecation
|
6
7
|
|
8
|
+
# @deprecated
|
7
9
|
# returns graph without any LDP-specific triples
|
8
10
|
def self.remove_ldp_triples graph
|
11
|
+
Deprecation.warn RDF::LDP, "RDF::LDP.remove_ldp_triples is deprecated. See oa_graph_helper in triannon gem."
|
9
12
|
if graph && graph.is_a?(RDF::Graph) && graph.count > 0
|
10
13
|
no_ldp_graph = RDF::Graph.new
|
11
14
|
ldp_props = RDF::LDP.properties.map {|p| p.to_s}
|
12
|
-
graph.each { |stmt|
|
13
|
-
no_ldp_graph << stmt unless ldp_props.include?(stmt.predicate.to_s) ||
|
15
|
+
graph.each { |stmt|
|
16
|
+
no_ldp_graph << stmt unless ldp_props.include?(stmt.predicate.to_s) ||
|
14
17
|
ldp_props.include?(stmt.object.to_s) ||
|
15
18
|
ldp_props.include?(stmt.subject.to_s)
|
16
19
|
}
|
@@ -19,5 +22,6 @@ module RDF
|
|
19
22
|
graph
|
20
23
|
end
|
21
24
|
end
|
25
|
+
|
22
26
|
end
|
23
|
-
end
|
27
|
+
end
|
data/lib/rdf/ldp/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION = "0.0
|
1
|
+
VERSION = "0.1.0"
|
data/lib/rdf/ldp/vocab.rb
CHANGED
@@ -2,7 +2,16 @@
|
|
2
2
|
# This file generated automatically using vocab-fetch from http://www.w3.org/ns/ldp#
|
3
3
|
require 'rdf'
|
4
4
|
module RDF
|
5
|
-
|
5
|
+
# deprecate LDP
|
6
|
+
def self.const_missing(const_name)
|
7
|
+
super unless const_name == :LDP
|
8
|
+
warn "DEPRECATION WARNING: the class RDF::LDP is deprecated. Use RDF::Vocab::LDP from https://github.com/ruby-rdf/rdf-vocab instead."
|
9
|
+
LDPDeprecated
|
10
|
+
end
|
11
|
+
|
12
|
+
# @deprecated: this class is deprecated in favor of RDF::Vocab::LDP
|
13
|
+
# from rdf-vocab gem
|
14
|
+
class LDPDeprecated < RDF::StrictVocabulary("http://www.w3.org/ns/ldp#")
|
6
15
|
|
7
16
|
# Class definitions
|
8
17
|
term :BasicContainer,
|
data/rdf-ldp.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = VERSION
|
9
9
|
spec.authors = ["Naomi Dushay"]
|
10
10
|
spec.email = ["ndushay@stanford.edu"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.homepage = ""
|
11
|
+
spec.summary = %q{This gem deprecated in favor of rdf-vocab; helper method is in triannon gem}
|
12
|
+
spec.homepage = "https://github.com/sul-dlss/rdf-ldp"
|
13
13
|
spec.license = "Apache 2"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_dependency 'rdf'
|
21
|
+
spec.add_dependency 'deprecation'
|
21
22
|
|
22
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
23
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/spec/helper_spec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'rdf/turtle'
|
3
3
|
|
4
|
-
describe RDF::
|
5
|
-
|
4
|
+
describe RDF::LDPDeprecated do
|
5
|
+
|
6
6
|
let(:anno_ttl) { File.read(fixture_path + '/open_anno_ldp_container.ttl') }
|
7
|
-
|
7
|
+
|
8
8
|
describe '#remove_ldp_triples' do
|
9
9
|
it 'graph returned has no ldp triples' do
|
10
10
|
graph = RDF::Graph.new
|
@@ -14,7 +14,7 @@ describe RDF::LDP do
|
|
14
14
|
expect(result.size).to eql 1
|
15
15
|
result = graph.query [nil, RDF::URI.new("http://www.w3.org/ns/ldp#contains"), nil]
|
16
16
|
expect(result.size).to eql 2
|
17
|
-
|
17
|
+
|
18
18
|
stripped_graph = RDF::LDP.remove_ldp_triples graph
|
19
19
|
expect(stripped_graph.count).to eql 29
|
20
20
|
result = stripped_graph.query [nil, RDF.type, RDF::URI.new("http://www.w3.org/ns/ldp#Container")]
|
@@ -23,5 +23,5 @@ describe RDF::LDP do
|
|
23
23
|
expect(result.size).to eql 0
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
27
|
-
end
|
26
|
+
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-ldp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naomi Dushay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: deprecation
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +115,7 @@ files:
|
|
101
115
|
- spec/fixtures/open_anno_ldp_container.ttl
|
102
116
|
- spec/helper_spec.rb
|
103
117
|
- spec/spec_helper.rb
|
104
|
-
homepage:
|
118
|
+
homepage: https://github.com/sul-dlss/rdf-ldp
|
105
119
|
licenses:
|
106
120
|
- Apache 2
|
107
121
|
metadata: {}
|
@@ -121,10 +135,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
135
|
version: '0'
|
122
136
|
requirements: []
|
123
137
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.4.3
|
125
139
|
signing_key:
|
126
140
|
specification_version: 4
|
127
|
-
summary:
|
141
|
+
summary: This gem deprecated in favor of rdf-vocab; helper method is in triannon gem
|
128
142
|
test_files:
|
129
143
|
- spec/fixtures/open_anno_ldp_container.ttl
|
130
144
|
- spec/helper_spec.rb
|