solis 0.113.0 → 0.114.0
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/lib/solis/model.rb +10 -1
- data/lib/solis/query/filter.rb +3 -0
- data/lib/solis/sparql_adaptor.rb +4 -2
- data/lib/solis/version.rb +1 -1
- data/solis.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c79cee8453b41aeab243fc45e69132a9192f9bc3481b447e68db95895d8e1e2
|
|
4
|
+
data.tar.gz: 1afd13dbd1e5e95505f5363766c829730e88d56e3e89471b8f770044f4e8b6e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e8fc91acdcf2f17f029907895be2ea35b3e0813aca875dc6f46f3787907ec7a02b66c8c46d012eb4e7f65e1920035e9eb57d576751c474ac6078c73963ee3aa
|
|
7
|
+
data.tar.gz: 1ba7210919daa84eed4be4994515834c0561f5d22f1d03ddb18f78cffb499be1f0c400946f10f5f8792437098f6cd204cb8ad0741bbf93aa9f55f54156d4c022
|
data/lib/solis/model.rb
CHANGED
|
@@ -22,7 +22,16 @@ module Solis
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
if self.class.metadata[:attributes][attribute.to_s][:node_kind].is_a?(RDF::URI) && value.is_a?(Hash)
|
|
25
|
-
|
|
25
|
+
inner_class = self.class.metadata[:attributes][attribute.to_s][:datatype].to_s
|
|
26
|
+
inner_model = self.class.graph.shape_as_model(inner_class)
|
|
27
|
+
|
|
28
|
+
if value.key?('id') && value['id'].match?(self.class.graph_name)
|
|
29
|
+
inner_class = value['id'].gsub(self.class.graph_name, '').split('/').first.classify.to_s
|
|
30
|
+
if inner_model.descendants.map(&:to_s).include?(inner_class)
|
|
31
|
+
inner_model = self.class.graph.shape_as_model(inner_class)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
26
35
|
value = inner_model.new(value)
|
|
27
36
|
elsif self.class.metadata[:attributes][attribute.to_s][:node_kind].is_a?(RDF::URI) && value.is_a?(Array)
|
|
28
37
|
new_value = []
|
data/lib/solis/query/filter.rb
CHANGED
|
@@ -89,6 +89,9 @@ module Solis
|
|
|
89
89
|
v=normalize_string(v)
|
|
90
90
|
filter = "filter( !exists {?concept <#{@model.class.graph_name}id> \"#{v}\"})"
|
|
91
91
|
end
|
|
92
|
+
elsif ['>', '<', '>=', '<='].include?(value[:operator])
|
|
93
|
+
v = normalize_string(value[:value].first)
|
|
94
|
+
filter = "?concept <#{@model.class.graph_name}id> ?__search FILTER (?__search #{value[:operator]} \"#{v}\") .\n"
|
|
92
95
|
else
|
|
93
96
|
filter = "?concept <#{@model.class.graph_name}id> ?__search FILTER (?__search IN(#{contains})) .\n"
|
|
94
97
|
end
|
data/lib/solis/sparql_adaptor.rb
CHANGED
|
@@ -44,10 +44,10 @@ module Solis
|
|
|
44
44
|
big_decimal: [:eq, :not_eq, :gt, :lt],
|
|
45
45
|
date: [:eq, :not_eq, :gt, :gte, :lt, :lte],
|
|
46
46
|
boolean: [:eq, :not_eq],
|
|
47
|
-
uuid: [:eq, :not_eq],
|
|
47
|
+
uuid: [:eq, :not_eq, :gt, :lt],
|
|
48
48
|
enum: [:eq],
|
|
49
49
|
datetime: [:eq, :not_eq, :gt, :lt],
|
|
50
|
-
anyuri: [:eq, :not_eq],
|
|
50
|
+
anyuri: [:eq, :not_eq, :gt, :lt],
|
|
51
51
|
}
|
|
52
52
|
end
|
|
53
53
|
|
|
@@ -106,6 +106,7 @@ module Solis
|
|
|
106
106
|
alias :filter_uuid_gt :filter_gt
|
|
107
107
|
alias :filter_enum_gt :filter_gt
|
|
108
108
|
alias :filter_datetime_gt :filter_gt
|
|
109
|
+
alias :filter_anyuri_gt :filter_gt
|
|
109
110
|
|
|
110
111
|
def filter_not_gt(scope, attribute, value)
|
|
111
112
|
filter_eq(scope, attribute, value, true, '>')
|
|
@@ -134,6 +135,7 @@ module Solis
|
|
|
134
135
|
alias :filter_uuid_lt :filter_lt
|
|
135
136
|
alias :filter_enum_lt :filter_lt
|
|
136
137
|
alias :filter_datetime_lt :filter_lt
|
|
138
|
+
alias :filter_anyuri_lt :filter_lt
|
|
137
139
|
|
|
138
140
|
def filter_not_lt(scope, attribute, value)
|
|
139
141
|
filter_eq(scope, attribute, value, true, '<')
|
data/lib/solis/version.rb
CHANGED
data/solis.gemspec
CHANGED
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.require_paths = ['lib']
|
|
29
29
|
|
|
30
30
|
spec.add_runtime_dependency 'activesupport', '~> 8.0'
|
|
31
|
-
spec.add_runtime_dependency 'http', '~> 5.
|
|
31
|
+
spec.add_runtime_dependency 'http', '~> 5.3'
|
|
32
32
|
spec.add_runtime_dependency 'graphiti', '~> 1.8'
|
|
33
33
|
spec.add_runtime_dependency 'moneta', '~> 1.6'
|
|
34
34
|
spec.add_runtime_dependency 'linkeddata', '~> 3.3'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.114.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mehmet Celik
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '5.
|
|
32
|
+
version: '5.3'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '5.
|
|
39
|
+
version: '5.3'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: graphiti
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|