emp_json 1.4.0.pre.g116cfb0af → 1.4.0.pre.g2575975e4
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/Gemfile.lock +1 -1
- data/lib/empathy/emp_json/helpers/primitives.rb +3 -12
- data/sig/lib/empathy/emp_json/helpers/primitives.rbs +0 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42aaaba45f4492719c1b3528f66916835db5953cc0653e8be87480c190b8f406
|
4
|
+
data.tar.gz: 98f3f75abd3a9b9132451d82920081b4e5a1700eaccb5267ba2a5f60334895b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 298e200bc75c0f5bf8bb4c6e42d3c2f5369ba24a0ab50b9d4cb0ecfa9e245b9b33930f5c2a15ffc00ac1aa2180762eb048507794c53d5a9d76f73b4f1178ba1d
|
7
|
+
data.tar.gz: 4fe179db61decfb069f343f64f5f3f4f5aba494ec9f0a88061485ecad5a13d3e36d61fe86b35f7ef6ed05bdd86593444682649f61fd67d6cbc29719006c3dd06
|
data/Gemfile.lock
CHANGED
@@ -14,7 +14,6 @@ module Empathy
|
|
14
14
|
EMP_TYPE_STRING = "s"
|
15
15
|
EMP_TYPE_BOOL = "b"
|
16
16
|
EMP_TYPE_INTEGER = "i"
|
17
|
-
EMP_TYPE_DOUBLE = "d"
|
18
17
|
EMP_TYPE_LONG = "l"
|
19
18
|
EMP_TYPE_PRIMITIVE = "p"
|
20
19
|
EMP_TYPE_LANGSTRING = "ls"
|
@@ -29,8 +28,6 @@ module Empathy
|
|
29
28
|
RDF_XSD_DATETIME = "#{RDF_XSD}dateTime"
|
30
29
|
RDF_XSD_BOOLEAN = "#{RDF_XSD}boolean"
|
31
30
|
RDF_XSD_INTEGER = "#{RDF_XSD}integer"
|
32
|
-
RDF_XSD_DECIMAL = "#{RDF_XSD}decimal"
|
33
|
-
RDF_XSD_DOUBLE = "#{RDF_XSD}double"
|
34
31
|
|
35
32
|
def object_to_value(value)
|
36
33
|
return primitive_to_value(value.iri) if value.respond_to?(:iri)
|
@@ -62,9 +59,7 @@ module Empathy
|
|
62
59
|
shorthand(EMP_TYPE_BOOL, value.to_s)
|
63
60
|
when Integer
|
64
61
|
integer_to_value(value)
|
65
|
-
when Float
|
66
|
-
shorthand(EMP_TYPE_DOUBLE, value.to_s)
|
67
|
-
when Numeric
|
62
|
+
when Float, Numeric
|
68
63
|
use_rdf_rb_for_primitive(value)
|
69
64
|
when RDF::Literal
|
70
65
|
rdf_literal_to_value(value)
|
@@ -84,7 +79,7 @@ module Empathy
|
|
84
79
|
end
|
85
80
|
end
|
86
81
|
|
87
|
-
def rdf_literal_to_value(value) # rubocop:disable Metrics/AbcSize
|
82
|
+
def rdf_literal_to_value(value) # rubocop:disable Metrics/AbcSize
|
88
83
|
case value.datatype.to_s
|
89
84
|
when RDF_RDFV_LANGSTRING
|
90
85
|
{
|
@@ -100,14 +95,10 @@ module Empathy
|
|
100
95
|
shorthand(EMP_TYPE_DATETIME, value.value)
|
101
96
|
when RDF_XSD_BOOLEAN
|
102
97
|
shorthand(EMP_TYPE_BOOL, value.value)
|
103
|
-
when RDF_XSD_DOUBLE
|
104
|
-
shorthand(EMP_TYPE_DOUBLE, value.value)
|
105
|
-
when RDF_XSD_DECIMAL
|
106
|
-
primitive(value.datatype.to_s, value.value)
|
107
98
|
when RDF_XSD_INTEGER
|
108
99
|
integer_to_value(value.to_i)
|
109
100
|
else
|
110
|
-
throw "unknown RDF::Literal
|
101
|
+
throw "unknown RDF::Literal"
|
111
102
|
end
|
112
103
|
end
|
113
104
|
|
@@ -16,8 +16,6 @@ module Empathy
|
|
16
16
|
|
17
17
|
EMP_TYPE_INTEGER: "i"
|
18
18
|
|
19
|
-
EMP_TYPE_DOUBLE: "d"
|
20
|
-
|
21
19
|
EMP_TYPE_LONG: "l"
|
22
20
|
|
23
21
|
EMP_TYPE_PRIMITIVE: "p"
|
@@ -44,10 +42,6 @@ module Empathy
|
|
44
42
|
|
45
43
|
RDF_XSD_INTEGER: "http://www.w3.org/2001/XMLSchema#integer"
|
46
44
|
|
47
|
-
RDF_XSD_DECIMAL: "http://www.w3.org/2001/XMLSchema#decimal"
|
48
|
-
|
49
|
-
RDF_XSD_DOUBLE: "http://www.w3.org/2001/XMLSchema#double"
|
50
|
-
|
51
45
|
type shorthand = { type: string, v: string }
|
52
46
|
type primitive = { type: string, dt: string, v: string }
|
53
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emp_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0.pre.
|
4
|
+
version: 1.4.0.pre.g2575975e4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom van Kalkeren
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Serializer for the EmpJson specification.
|
14
14
|
email:
|