rdf-reasoner 0.4.2 → 0.4.3
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/README.md +2 -2
- data/VERSION +1 -1
- data/lib/rdf/reasoner/format.rb +11 -13
- data/lib/rdf/reasoner/rdfs.rb +3 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dd2fb50e0757e5bc8c4d3e93ac9eb401422c891
|
4
|
+
data.tar.gz: b1adb845ea5cfe53345ca292ba9313685c3a1ba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adc382c500d6659b6c2ebf2fb97eb93f883d5b70d02cbcf1ca6ec27b317c05af69db33fe74de344d81113d0333d629bc452c087e824b27516ddfd00a9230b793
|
7
|
+
data.tar.gz: 0d8cb95fffe01665cbb02f60b723c322d9d732810f564278fe418dae440b541eb56c7fb6f823d81fd8f6b78a9b25f3b354775c49161d341eb684d3151c4bbf2d
|
data/README.md
CHANGED
@@ -143,6 +143,6 @@ see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
|
143
143
|
[SPARQL Query]: http://www.w3.org/TR/2013/REC-sparql11-query-20130321/
|
144
144
|
[SPARQL Entailment]:http://www.w3.org/TR/sparql11-entailment/
|
145
145
|
[RDF 1.1]: http://www.w3.org/TR/rdf11-concepts
|
146
|
-
[RDF.rb]: http://
|
146
|
+
[RDF.rb]: http://www.rubydoc.info/github/ruby-rdf/rdf/
|
147
147
|
[RDF Schema]: http://www.w3.org/TR/rdf-schema/
|
148
|
-
[Rack]:
|
148
|
+
[Rack]: https://rack.github.io/
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/lib/rdf/reasoner/format.rb
CHANGED
@@ -14,33 +14,31 @@ module RDF::Reasoner
|
|
14
14
|
def self.cli_commands
|
15
15
|
{
|
16
16
|
entail: {
|
17
|
-
description: "
|
18
|
-
help: "entail",
|
17
|
+
description: "Add entailed triples to repository",
|
18
|
+
help: "entail\nPerform RDFS, OWL and schema.org entailment to expand the repository based on referenced built-in vocabuaries",
|
19
|
+
control: :button, # Treats this like a separate control in the HTML UI
|
19
20
|
parse: true,
|
20
21
|
lambda: ->(argv, opts) do
|
21
22
|
RDF::Reasoner.apply(:rdfs, :owl, :schema)
|
22
23
|
start, stmt_cnt = Time.now, RDF::CLI.repository.count
|
23
24
|
RDF::CLI.repository.entail!
|
24
25
|
secs, new_cnt = (Time.new - start), (RDF::CLI.repository.count - stmt_cnt)
|
25
|
-
|
26
|
+
opts[:logger].info "\nEntailed #{new_cnt} new statements in #{secs} seconds."
|
26
27
|
end
|
27
28
|
},
|
28
29
|
lint: {
|
29
|
-
description: "Lint the repository
|
30
|
-
help: "lint",
|
30
|
+
description: "Lint the repository",
|
31
|
+
help: "lint\nLint the repository using built-in vocabularies",
|
31
32
|
parse: true,
|
33
|
+
option_use: {output_format: :disabled},
|
32
34
|
lambda: ->(argv, opts) do
|
33
35
|
RDF::Reasoner.apply(:rdfs, :owl, :schema)
|
34
36
|
start = Time.now
|
35
|
-
|
37
|
+
# Messages added to opts for appropriate display
|
38
|
+
opts[:messages].merge!(RDF::CLI.repository.lint)
|
39
|
+
opts[:output].puts "Linter responded with #{opts[:messages].empty? ? 'no' : ''} messages."
|
36
40
|
secs = Time.new - start
|
37
|
-
|
38
|
-
term_messages.each do |term, messages|
|
39
|
-
$stdout.puts "#{kind} #{term}"
|
40
|
-
messages.each {|m| $stdout.puts " #{m}"}
|
41
|
-
end
|
42
|
-
end
|
43
|
-
$stdout.puts "\nLinted in #{secs} seconds."
|
41
|
+
opts[:logger].info "\nLinted in #{secs} seconds."
|
44
42
|
end
|
45
43
|
}
|
46
44
|
}
|
data/lib/rdf/reasoner/rdfs.rb
CHANGED
@@ -223,6 +223,9 @@ module RDF::Reasoner
|
|
223
223
|
ranges.all? do |range|
|
224
224
|
if [RDF::RDFS.Literal, RDF.XMLLiteral, RDF.HTML].include?(range)
|
225
225
|
true # Don't bother checking for validity
|
226
|
+
elsif range == RDF.langString
|
227
|
+
# Value must have a language
|
228
|
+
resource.has_language?
|
226
229
|
elsif range.start_with?(RDF::XSD)
|
227
230
|
# XSD types are valid if the datatype matches, or they are plain and valid according to the grammar of the range
|
228
231
|
resource.datatype == range ||
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-reasoner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.2.8
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '2.2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.2.8
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rdf-vocab
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
182
|
version: '0'
|
177
183
|
requirements: []
|
178
184
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.6.
|
185
|
+
rubygems_version: 2.6.12
|
180
186
|
signing_key:
|
181
187
|
specification_version: 4
|
182
188
|
summary: RDFS/OWL Reasoner for RDF.rb
|