virtual_assembly-semantizer 0.0.1 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b7d378d2aa59e196b98bc2a5002eef7a245ef6c9abb2264d13ab53532f0a22f
|
4
|
+
data.tar.gz: 02d6eec9c39195bad788a1d5521dc3e6fa3a0f2b0e21fa07435dd0fe3851c935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e60334504ef85ba0fcfa14a6dfb0c748ad27111a70e2180c79be62badad988f2880ab0d4d773732f2d52c2bb5e9ba8f838c332c133fd6c658f4a0a31c42282b0
|
7
|
+
data.tar.gz: 2e6fe4aad1d0ffd28db5a7cb2c57038db9f43d836813d249a5861a25a038256a06d7778709c44320e6bd01872c3dbc084ba58f54095deb550cd2d432a13cd5a8
|
@@ -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,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtual_assembly-semantizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
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-
|
11
|
+
date: 2023-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library to add linked data to your models
|
14
14
|
email: maxime@lecoqlibre.fr
|