virtual_assembly-semantizer 1.0.1 → 1.0.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d38840bf182d8a5111ad96fb65698ae4b1878c338efa7e91e61d131ebbe9c9
|
4
|
+
data.tar.gz: fa56956ba8eab9db58695eee5a4e8a44cf41eb401c71d021df802bdaada0997a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e199c2c86b7f4d5e3fcf93ff437495d04b0f79ae435291ba74054c7d2c01789219ac6a2138378c4107f003fce46f5ed122ce0d14abefa474d93221dbcf008184
|
7
|
+
data.tar.gz: 99c70064365f0de27f4fa6140673f4d379c24c780065e3053af48db6613aa4b4a63d2bfb33c8d7f2420f23fd35d9c3840803f10e1775edeb94c3cc61cf328688
|
@@ -55,7 +55,9 @@ class VirtualAssembly::Semantizer::HashSerializer
|
|
55
55
|
|
56
56
|
# In case the property is an Array, we export each item.
|
57
57
|
elsif (value.class == Array)
|
58
|
-
|
58
|
+
if (!value.empty?)
|
59
|
+
result[name] = exportCollection(value)
|
60
|
+
end
|
59
61
|
|
60
62
|
else
|
61
63
|
raise "The type of the property '" + name + "' is '" + value.class.to_s + "' but a primitive, a SemanticObject or an Array is required."
|
@@ -58,10 +58,8 @@ module VirtualAssembly::Semantizer::SemanticObject
|
|
58
58
|
|
59
59
|
# If the semanticId is nil, the object will be treated as a blank node.
|
60
60
|
def initialize(semanticId = nil, semanticType = nil)
|
61
|
-
@semanticId = semanticId
|
62
|
-
@semanticType = semanticType
|
63
61
|
@semanticProperties = Array.new
|
64
|
-
|
62
|
+
|
65
63
|
# This Hash allows us to find a property using its name.
|
66
64
|
#
|
67
65
|
# Hash<String, Integer>
|
@@ -70,6 +68,10 @@ module VirtualAssembly::Semantizer::SemanticObject
|
|
70
68
|
# The value store the index of the property in the
|
71
69
|
# semanticProperties array (Integer).
|
72
70
|
@semanticPropertiesNameIndex = Hash.new
|
71
|
+
|
72
|
+
# Ensure to call the setter methods
|
73
|
+
self.semanticId = semanticId
|
74
|
+
self.semanticType = semanticType
|
73
75
|
end
|
74
76
|
|
75
77
|
def hasSemanticProperty?(name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtual_assembly-semantizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Lecoq
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-ld
|