virtual_assembly-semantizer 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e04586a0dc0de06cd009f97a42698e5ed029b7eb4ac7994a4da7c7e782264f2d
4
- data.tar.gz: cdcbc06cbf6acacacedcdb952c767aca2f3d8c26c5a6dceb5a88dc7ad8874520
3
+ metadata.gz: 75d38840bf182d8a5111ad96fb65698ae4b1878c338efa7e91e61d131ebbe9c9
4
+ data.tar.gz: fa56956ba8eab9db58695eee5a4e8a44cf41eb401c71d021df802bdaada0997a
5
5
  SHA512:
6
- metadata.gz: 433ebe39bf0d941b04ac305e08c38e4e58ebb9c82c819cd4b0154c11754cb010760a8b8653f1b1f456e446d9e7d92fc31d9e69edf85b625e9c1a5f33ea040278
7
- data.tar.gz: 6c182bda3f463d2954c801123f04dd0da69d870cc05b6ce3b16fe48d2ff542159925cf9f66ef67c95aeff41d9bbb57926ef0d4237897315323c226711541add6
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
- result[name] = exportCollection(value)
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.1
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-01-18 00:00:00.000000000 Z
11
+ date: 2023-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-ld