virtual_assembly-semantizer 0.0.1 → 1.0.1
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: e04586a0dc0de06cd009f97a42698e5ed029b7eb4ac7994a4da7c7e782264f2d
|
4
|
+
data.tar.gz: cdcbc06cbf6acacacedcdb952c767aca2f3d8c26c5a6dceb5a88dc7ad8874520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 433ebe39bf0d941b04ac305e08c38e4e58ebb9c82c819cd4b0154c11754cb010760a8b8653f1b1f456e446d9e7d92fc31d9e69edf85b625e9c1a5f33ea040278
|
7
|
+
data.tar.gz: 6c182bda3f463d2954c801123f04dd0da69d870cc05b6ce3b16fe48d2ff542159925cf9f66ef67c95aeff41d9bbb57926ef0d4237897315323c226711541add6
|
@@ -23,7 +23,7 @@
|
|
23
23
|
#
|
24
24
|
# The HashSerializer will return the following Hash:
|
25
25
|
# {"http://xmlns.com/foaf/0.1/name" => "John"}.
|
26
|
-
class Semantizer::HashSerializer
|
26
|
+
class VirtualAssembly::Semantizer::HashSerializer
|
27
27
|
|
28
28
|
# This is the main method to begin the serialization.
|
29
29
|
#
|
@@ -46,7 +46,7 @@ class Semantizer::HashSerializer
|
|
46
46
|
|
47
47
|
# In case the property is a SemanticObject, we get its semanticId
|
48
48
|
# or we process it if it is a blank node.
|
49
|
-
elsif (value.
|
49
|
+
elsif (value.class < VirtualAssembly::Semantizer::SemanticObject)
|
50
50
|
if (value.isBlankNode?)
|
51
51
|
result[name] = process(value)
|
52
52
|
else
|
@@ -80,7 +80,7 @@ class Semantizer::HashSerializer
|
|
80
80
|
|
81
81
|
# In case the collection contains SemanticObject we have to process
|
82
82
|
# the blank nodes or return the semantic id.
|
83
|
-
elsif type
|
83
|
+
elsif type < VirtualAssembly::Semantizer::SemanticObject
|
84
84
|
values.each do |item|
|
85
85
|
if (item.isBlankNode?)
|
86
86
|
collection.push(process(item))
|
@@ -26,7 +26,7 @@ require 'virtual_assembly/semantizer/semantic_property'
|
|
26
26
|
# For example, a Person object including this module could register
|
27
27
|
# in its initializer method a semantic property for its name like:
|
28
28
|
# Person.registerSemanticProperty("http://xmlns.com/foaf/0.1/name") {self.name}
|
29
|
-
module Semantizer::SemanticObject
|
29
|
+
module VirtualAssembly::Semantizer::SemanticObject
|
30
30
|
|
31
31
|
# The semantic ID implements the concept of linked data ID.
|
32
32
|
#
|
@@ -153,7 +153,7 @@ module Semantizer::SemanticObject
|
|
153
153
|
|
154
154
|
# Create
|
155
155
|
else
|
156
|
-
@semanticProperties.push(Semantizer::SemanticProperty.new(name, &valueGetter))
|
156
|
+
@semanticProperties.push(VirtualAssembly::Semantizer::SemanticProperty.new(name, &valueGetter))
|
157
157
|
index = @semanticProperties.count - 1
|
158
158
|
@semanticPropertiesNameIndex.store(name, index);
|
159
159
|
end
|
@@ -31,7 +31,7 @@
|
|
31
31
|
#
|
32
32
|
# You should use a block to pass the value like so:
|
33
33
|
# SemanticProperty.new("http://xmlns.com/foaf/0.1/name") {self.name}
|
34
|
-
class Semantizer::SemanticProperty
|
34
|
+
class VirtualAssembly::Semantizer::SemanticProperty
|
35
35
|
|
36
36
|
# The name of the property. It generally points to an uri
|
37
37
|
# like "http://xmlns.com/foaf/0.1/name" or it is used to
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module VirtualAssembly
|
2
|
+
module Semantizer
|
3
|
+
require 'virtual_assembly/semantizer/semantic_object'
|
4
|
+
require 'virtual_assembly/semantizer/semantic_property'
|
5
|
+
require 'virtual_assembly/semantizer/hash_serializer'
|
6
|
+
end
|
5
7
|
end
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtual_assembly-semantizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
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-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-01-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json-ld
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.2.3
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.2.3
|
13
33
|
description: A library to add linked data to your models
|
14
34
|
email: maxime@lecoqlibre.fr
|
15
35
|
executables: []
|