rdf 1.1.9 → 1.1.10
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/VERSION +1 -1
- data/lib/rdf.rb +2 -2
- data/lib/rdf/mixin/enumerable.rb +3 -2
- data/lib/rdf/model/uri.rb +12 -0
- data/lib/rdf/{vocab.rb → vocabulary.rb} +2 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c527ab8ceef6cc215b7b30f603e3a51d3a0ee403
|
4
|
+
data.tar.gz: 9c47a7510c2f8b4e0ff6dd6048167c32055de5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a8dc1d4eec0baab67d6407b677f1a72825149a525c37b6ce8a34fba96d76814be3824a776d1e456f10af088c667bf28c27f7c528e4fd02a0dc90fd16c1d1b3
|
7
|
+
data.tar.gz: d26dac7f54707765751e32a249eb244862e86abdcdad12c83dcd81a0356ad902c46b0302f1734dfbc93c31b9477303cec3456dd3bc281f69f1ca89e5f2602693
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.10
|
data/lib/rdf.rb
CHANGED
@@ -52,8 +52,8 @@ module RDF
|
|
52
52
|
autoload :Query, 'rdf/query'
|
53
53
|
|
54
54
|
# RDF vocabularies
|
55
|
-
autoload :Vocabulary, 'rdf/
|
56
|
-
autoload :StrictVocabulary, 'rdf/
|
55
|
+
autoload :Vocabulary, 'rdf/vocabulary'
|
56
|
+
autoload :StrictVocabulary, 'rdf/vocabulary'
|
57
57
|
VOCABS = Dir.glob(File.join(File.dirname(__FILE__), 'rdf', 'vocab', '*.rb')).map { |f| File.basename(f)[0...-(File.extname(f).size)].to_sym } rescue []
|
58
58
|
VOCABS.each { |v| autoload v.to_s.upcase.to_sym, "rdf/vocab/#{v}" unless v == :rdf }
|
59
59
|
|
data/lib/rdf/mixin/enumerable.rb
CHANGED
@@ -66,8 +66,9 @@ module RDF
|
|
66
66
|
#
|
67
67
|
# Supported features include:
|
68
68
|
# * `:context` supports statements with a context, allowing multiple contexts
|
69
|
-
# * `:
|
70
|
-
# * `:
|
69
|
+
# * `:inference` supports RDFS inferrence of queryable contents.
|
70
|
+
# * `:validity` allows a concrete Enumerable implementation to indicate that it does or does not support valididty checking. By default implementations are assumed to support validity checking.
|
71
|
+
# * `:skolemize` supports [Skolemization](https://www.w3.org/wiki/BnodeSkolemization) of an `Enumerable`. Implementations supporting this feature must implement a `#skolemize` method, taking a base URI used for minting URIs for BNodes as stable identifiers and a `#deskolemize` method, also taking a base URI used for turning URIs having that prefix back into the same BNodes which were originally skolemized.
|
71
72
|
#
|
72
73
|
# @param [Symbol, #to_sym] feature
|
73
74
|
# @return [Boolean]
|
data/lib/rdf/model/uri.rb
CHANGED
@@ -312,6 +312,18 @@ module RDF
|
|
312
312
|
# A URI is relative when it does not have a scheme
|
313
313
|
# @return [Boolean] `true` or `false`
|
314
314
|
def relative?; !absolute?; end
|
315
|
+
|
316
|
+
# Attempt to make this URI relative to the provided `base_uri`. If successful, returns a relative URI, otherwise the original URI
|
317
|
+
# @param [#to_s] base_uri
|
318
|
+
# @return [RDF::URI]
|
319
|
+
def relativize(base_uri)
|
320
|
+
if base_uri.to_s.end_with?("/", "#") &&
|
321
|
+
self.to_s.start_with?(base_uri.to_s)
|
322
|
+
RDF::URI(self.to_s[base_uri.to_s.length..-1])
|
323
|
+
else
|
324
|
+
self
|
325
|
+
end
|
326
|
+
end
|
315
327
|
|
316
328
|
##
|
317
329
|
# Returns the string length of this URI.
|
@@ -2,7 +2,7 @@ module RDF
|
|
2
2
|
##
|
3
3
|
# A {Vocabulary} represents an RDFS or OWL vocabulary.
|
4
4
|
#
|
5
|
-
# A {Vocabulary} can also serve as a Domain Specific Language (DSL) for generating an RDF Graph definition for the vocabulary (see {RDF::Vocabulary#
|
5
|
+
# A {Vocabulary} can also serve as a Domain Specific Language (DSL) for generating an RDF Graph definition for the vocabulary (see {RDF::Vocabulary#to_enum}).
|
6
6
|
#
|
7
7
|
# ### Defining a vocabulary using the DSL
|
8
8
|
# Vocabularies can be defined based on {RDF::Vocabulary} or {RDF::StrictVocabulary} using a simple Domain Specific Language (DSL). Terms of the vocabulary are specified using either `property` or `term` (alias), with the attributes of the term listed in a hash. See {property} for description of the hash.
|
@@ -61,7 +61,7 @@ module RDF
|
|
61
61
|
# foaf['mbox'] #=> RDF::URI("http://xmlns.com/foaf/0.1/mbox")
|
62
62
|
#
|
63
63
|
# @example Generating RDF from a vocabulary definition
|
64
|
-
# graph = RDF::RDFS.
|
64
|
+
# graph = RDF::Graph.new << RDF::RDFS.to_enum
|
65
65
|
# graph.dump(:ntriples)
|
66
66
|
#
|
67
67
|
# @example Defining a simple vocabulary
|
@@ -273,7 +273,6 @@ module RDF
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
alias_method :to_enum, :enum_for
|
276
|
-
|
277
276
|
##
|
278
277
|
# Enumerate each statement constructed from the defined vocabulary terms
|
279
278
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|
@@ -246,7 +246,6 @@ files:
|
|
246
246
|
- lib/rdf/util/file.rb
|
247
247
|
- lib/rdf/util/uuid.rb
|
248
248
|
- lib/rdf/version.rb
|
249
|
-
- lib/rdf/vocab.rb
|
250
249
|
- lib/rdf/vocab/cc.rb
|
251
250
|
- lib/rdf/vocab/cert.rb
|
252
251
|
- lib/rdf/vocab/dc.rb
|
@@ -283,6 +282,7 @@ files:
|
|
283
282
|
- lib/rdf/vocab/xhtml.rb
|
284
283
|
- lib/rdf/vocab/xhv.rb
|
285
284
|
- lib/rdf/vocab/xsd.rb
|
285
|
+
- lib/rdf/vocabulary.rb
|
286
286
|
- lib/rdf/writer.rb
|
287
287
|
homepage: http://ruby-rdf.github.com/
|
288
288
|
licenses:
|