wikibase_representable 0.1.3 → 0.2.0
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/.rspec +1 -0
- data/.rubocop.yml +4 -17
- data/.rubocop_todo.yml +17 -0
- data/LICENSE.txt +21 -0
- data/lib/wikibase_representable/model/{alias_group_list.rb → alias_group_hash.rb} +2 -2
- data/lib/wikibase_representable/model/data_value.rb +5 -3
- data/lib/wikibase_representable/model/entity_id.rb +5 -4
- data/lib/wikibase_representable/model/entity_id_value.rb +8 -8
- data/lib/wikibase_representable/model/item.rb +26 -35
- data/lib/wikibase_representable/model/property.rb +15 -40
- data/lib/wikibase_representable/model/property_value_snak.rb +5 -5
- data/lib/wikibase_representable/model/site_link.rb +5 -5
- data/lib/wikibase_representable/model/{site_link_list.rb → site_link_hash.rb} +1 -1
- data/lib/wikibase_representable/model/{snak_list.rb → snak_hash.rb} +2 -2
- data/lib/wikibase_representable/model/statement.rb +14 -25
- data/lib/wikibase_representable/model/{statement_list.rb → statement_hash.rb} +2 -2
- data/lib/wikibase_representable/model/term.rb +5 -3
- data/lib/wikibase_representable/model/{term_list.rb → term_hash.rb} +2 -2
- data/lib/wikibase_representable/model/time.rb +12 -14
- data/lib/wikibase_representable/model/time_value.rb +11 -14
- data/lib/wikibase_representable/model.rb +5 -5
- data/lib/wikibase_representable/representers/{alias_group_list_representer.rb → alias_group_hash_representer.rb} +1 -1
- data/lib/wikibase_representable/representers/item_representer.rb +16 -17
- data/lib/wikibase_representable/representers/property_representer.rb +13 -13
- data/lib/wikibase_representable/representers/{site_link_list_representer.rb → site_link_hash_representer.rb} +1 -1
- data/lib/wikibase_representable/representers/{snak_list_representer.rb → snak_hash_representer.rb} +2 -2
- data/lib/wikibase_representable/representers/{statement_list_representer.rb → statement_hash_representer.rb} +1 -1
- data/lib/wikibase_representable/representers/statement_representer.rb +3 -3
- data/lib/wikibase_representable/representers/{term_list_representer.rb → term_hash_representer.rb} +2 -2
- data/lib/wikibase_representable/representers.rb +5 -5
- data/lib/wikibase_representable/version.rb +1 -1
- data/scripts/test_deserialization_round_trip.rb +85 -0
- metadata +45 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0172a6186013fc4a2c5584eff040ca1c0ef7f774dac7934c5539f8f646227a3
|
4
|
+
data.tar.gz: 83e494bc775b64224172092b50a903d3b128f462cab6b945abdadd5b733e209b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ad5a4d89f31b22a5ad54b7370e7c41689c3fa71d657351e6bc21ab876de2e93408a0af33fefa95a23ce2de63e1e935f5328da2dd36d1316b1275a5de4ccbf3f
|
7
|
+
data.tar.gz: b7b25e41ec60dca76a97e1b34695496a36c97921120c19c6b30c6b651b1865d5ea1cd63a5c7c3b40792d02996f0c63d06550b01e4d63903399296b670c2e5545
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
CHANGED
@@ -1,18 +1,5 @@
|
|
1
|
-
|
2
|
-
- rubocop-rake
|
3
|
-
- rubocop-rspec
|
1
|
+
inherit_from: .rubocop_todo.yml
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
EnforcedStyle: gemspec
|
9
|
-
Metrics/AbcSize:
|
10
|
-
Enabled: false
|
11
|
-
Metrics/CyclomaticComplexity:
|
12
|
-
Enabled: false
|
13
|
-
Metrics/ParameterLists:
|
14
|
-
Enabled: false
|
15
|
-
RSpec/MultipleMemoizedHelpers:
|
16
|
-
Enabled: false
|
17
|
-
Style/SafeNavigationChainLength:
|
18
|
-
Enabled: false
|
3
|
+
inherit_gem:
|
4
|
+
upennlib-rubocop: upennlib_rubocop_defaults.yml
|
5
|
+
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-01-18 04:14:35 UTC using RuboCop version 1.69.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 13
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: EnforceForPrefixed.
|
12
|
+
Rails/Delegate:
|
13
|
+
Exclude:
|
14
|
+
- 'lib/wikibase_representable/model/entity_id_value.rb'
|
15
|
+
- 'lib/wikibase_representable/model/item.rb'
|
16
|
+
- 'lib/wikibase_representable/model/statement.rb'
|
17
|
+
- 'lib/wikibase_representable/model/time_value.rb'
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Michael Holloway
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module WikibaseRepresentable
|
4
4
|
module Model
|
5
|
-
#
|
6
|
-
class
|
5
|
+
# Hash of alias lists keyed by language code.
|
6
|
+
class AliasGroupHash < Hash
|
7
7
|
def aliases_for_language(language_code)
|
8
8
|
fetch(language_code, nil)
|
9
9
|
end
|
@@ -11,10 +11,12 @@ module WikibaseRepresentable
|
|
11
11
|
@value = value
|
12
12
|
end
|
13
13
|
|
14
|
+
def state
|
15
|
+
[type, value]
|
16
|
+
end
|
17
|
+
|
14
18
|
def ==(other)
|
15
|
-
other.
|
16
|
-
other.type == type &&
|
17
|
-
other.value == value
|
19
|
+
other.class == self.class && other.state == state
|
18
20
|
end
|
19
21
|
|
20
22
|
def eql?(other)
|
@@ -12,11 +12,12 @@ module WikibaseRepresentable
|
|
12
12
|
@entity_type = entity_type
|
13
13
|
end
|
14
14
|
|
15
|
+
def state
|
16
|
+
[id, numeric_id, entity_type]
|
17
|
+
end
|
18
|
+
|
15
19
|
def ==(other)
|
16
|
-
other.
|
17
|
-
id == other.id &&
|
18
|
-
entity_type == other.entity_type &&
|
19
|
-
numeric_id == other.numeric_id
|
20
|
+
other.class == self.class && other.state == state
|
20
21
|
end
|
21
22
|
|
22
23
|
def eql?(other)
|
@@ -13,23 +13,23 @@ module WikibaseRepresentable
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def id
|
16
|
-
|
16
|
+
value.id
|
17
17
|
end
|
18
18
|
|
19
19
|
def entity_type
|
20
|
-
|
20
|
+
value.entity_type
|
21
21
|
end
|
22
22
|
|
23
23
|
def numeric_id
|
24
|
-
|
24
|
+
value.numeric_id
|
25
|
+
end
|
26
|
+
|
27
|
+
def state
|
28
|
+
[type, value]
|
25
29
|
end
|
26
30
|
|
27
31
|
def ==(other)
|
28
|
-
other.
|
29
|
-
type == other.type &&
|
30
|
-
id == other.id &&
|
31
|
-
entity_type == other.entity_type &&
|
32
|
-
numeric_id == other.numeric_id
|
32
|
+
other.class == self.class && other.state == state
|
33
33
|
end
|
34
34
|
|
35
35
|
def eql?(other)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'wikibase_representable/model/
|
4
|
-
require 'wikibase_representable/model/
|
5
|
-
require 'wikibase_representable/model/
|
6
|
-
require 'wikibase_representable/model/
|
3
|
+
require 'wikibase_representable/model/alias_group_hash'
|
4
|
+
require 'wikibase_representable/model/site_link_hash'
|
5
|
+
require 'wikibase_representable/model/statement_hash'
|
6
|
+
require 'wikibase_representable/model/term_hash'
|
7
7
|
require 'wikibase_representable/model/term'
|
8
8
|
|
9
9
|
module WikibaseRepresentable
|
@@ -13,64 +13,55 @@ module WikibaseRepresentable
|
|
13
13
|
class Item
|
14
14
|
ENTITY_TYPE = 'item'
|
15
15
|
|
16
|
-
attr_accessor :type, :id, :
|
16
|
+
attr_accessor :type, :id, :labels_hash, :descriptions_hash, :alias_groups_hash, :site_links_hash, :statements_hash
|
17
17
|
|
18
|
-
def initialize(
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
@
|
26
|
-
@id = id
|
27
|
-
@labels = labels
|
28
|
-
@descriptions = descriptions
|
29
|
-
@alias_groups = alias_groups
|
30
|
-
@site_links = site_links
|
31
|
-
@statements = statements
|
18
|
+
def initialize(**kwargs)
|
19
|
+
@type = ENTITY_TYPE
|
20
|
+
@id = kwargs[:id]
|
21
|
+
@labels_hash = kwargs[:labels_hash] || TermHash.new
|
22
|
+
@descriptions_hash = kwargs[:descriptions_hash] || TermHash.new
|
23
|
+
@alias_groups_hash = kwargs[:alias_groups_hash] || AliasGroupHash.new
|
24
|
+
@site_links_hash = kwargs[:site_links_hash] || SiteLinkHash.new
|
25
|
+
@statements_hash = kwargs[:statements_hash] || StatementHash.new
|
32
26
|
end
|
33
27
|
|
34
28
|
def label(language_code)
|
35
|
-
|
29
|
+
labels_hash.value_for_language(language_code)
|
30
|
+
end
|
31
|
+
|
32
|
+
def aliases_for_language(language_code)
|
33
|
+
alias_groups_hash.aliases_for_language(language_code)
|
36
34
|
end
|
37
35
|
|
38
36
|
def statements_by_property_id(property_id)
|
39
|
-
|
37
|
+
statements_hash.statements_by_property_id(property_id)
|
40
38
|
end
|
41
39
|
|
42
40
|
def statements_by_property_id?(property_id)
|
43
|
-
|
41
|
+
statements_hash.statements_by_property_id?(property_id)
|
44
42
|
end
|
45
43
|
|
46
44
|
def site_link(site_id)
|
47
|
-
|
45
|
+
site_links_hash.link_for_site(site_id)
|
48
46
|
end
|
49
47
|
|
50
48
|
def link_to_site?(site_id)
|
51
|
-
|
49
|
+
site_links_hash.link_for_site?(site_id)
|
52
50
|
end
|
53
51
|
|
54
|
-
def
|
55
|
-
|
52
|
+
def state
|
53
|
+
[type, id, labels_hash, descriptions_hash, alias_groups_hash, site_links_hash, statements_hash]
|
56
54
|
end
|
57
55
|
|
58
56
|
def ==(other)
|
59
|
-
other.
|
60
|
-
@type == other.type &&
|
61
|
-
@id == other.id &&
|
62
|
-
@labels == other.labels &&
|
63
|
-
@descriptions == other.descriptions &&
|
64
|
-
@alias_groups == other.alias_groups &&
|
65
|
-
@site_links == other.site_links &&
|
66
|
-
@statements == other.statements
|
57
|
+
other.class == self.class && other.state == state
|
67
58
|
end
|
68
59
|
|
69
60
|
def eql?(other)
|
70
61
|
self == other
|
71
62
|
end
|
72
63
|
|
73
|
-
alias
|
64
|
+
alias claims_hash statements_hash
|
74
65
|
alias claims_by_property_id statements_by_property_id
|
75
66
|
alias claims_by_property_id? statements_by_property_id?
|
76
67
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'wikibase_representable/model/
|
4
|
-
require 'wikibase_representable/model/
|
5
|
-
require 'wikibase_representable/model/
|
3
|
+
require 'wikibase_representable/model/alias_group_hash'
|
4
|
+
require 'wikibase_representable/model/statement_hash'
|
5
|
+
require 'wikibase_representable/model/term_hash'
|
6
6
|
require 'wikibase_representable/model/term'
|
7
7
|
|
8
8
|
module WikibaseRepresentable
|
@@ -11,49 +11,24 @@ module WikibaseRepresentable
|
|
11
11
|
class Property
|
12
12
|
ENTITY_TYPE = 'property'
|
13
13
|
|
14
|
-
attr_accessor :type, :id, :data_type, :
|
14
|
+
attr_accessor :type, :id, :data_type, :labels_hash, :descriptions_hash, :alias_groups_hash, :statements_hash
|
15
15
|
|
16
|
-
def initialize(
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@
|
24
|
-
@data_type = data_type
|
25
|
-
@id = id
|
26
|
-
@labels = labels
|
27
|
-
@descriptions = descriptions
|
28
|
-
@alias_groups = alias_groups
|
29
|
-
@statements = statements
|
16
|
+
def initialize(**kwargs)
|
17
|
+
@type = ENTITY_TYPE
|
18
|
+
@data_type = kwargs[:data_type]
|
19
|
+
@id = kwargs[:id]
|
20
|
+
@labels_hash = kwargs[:labels_hash] || TermHash.new
|
21
|
+
@descriptions_hash = kwargs[:descriptions_hash] || TermHash.new
|
22
|
+
@alias_groups_hash = kwargs[:alias_groups_hash] || AliasGroupHash.new
|
23
|
+
@statements_hash = kwargs[:statements_hash] || StatementHash.new
|
30
24
|
end
|
31
25
|
|
32
|
-
def
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
def description(language_code, value)
|
37
|
-
@descriptions.term(Term.new(language_code, value))
|
38
|
-
end
|
39
|
-
|
40
|
-
def aliases(language_code, aliases)
|
41
|
-
@alias_groups.aliases_for_language(language_code, aliases)
|
42
|
-
end
|
43
|
-
|
44
|
-
def empty?
|
45
|
-
@labels.empty? && @descriptions.empty? && @alias_groups.empty? && @statements.empty?
|
26
|
+
def state
|
27
|
+
[type, id, data_type, labels_hash, descriptions_hash, alias_groups_hash, statements_hash]
|
46
28
|
end
|
47
29
|
|
48
30
|
def ==(other)
|
49
|
-
other.
|
50
|
-
@type == other.type &&
|
51
|
-
@id == other.id &&
|
52
|
-
@data_type == other.data_type &&
|
53
|
-
@labels == other.labels &&
|
54
|
-
@descriptions == other.descriptions &&
|
55
|
-
@alias_groups == other.alias_groups &&
|
56
|
-
@statements == other.statements
|
31
|
+
other.class == self.class && other.state == state
|
57
32
|
end
|
58
33
|
|
59
34
|
def eql?(other)
|
@@ -18,12 +18,12 @@ module WikibaseRepresentable
|
|
18
18
|
@hash = hash
|
19
19
|
end
|
20
20
|
|
21
|
+
def state
|
22
|
+
[type, property_id, data_value, hash]
|
23
|
+
end
|
24
|
+
|
21
25
|
def ==(other)
|
22
|
-
other.
|
23
|
-
other.type == type &&
|
24
|
-
other.property_id == property_id &&
|
25
|
-
other.data_value == data_value &&
|
26
|
-
other.hash == hash
|
26
|
+
other.class == self.class && other.state == state
|
27
27
|
end
|
28
28
|
|
29
29
|
def eql?(other)
|
@@ -12,12 +12,12 @@ module WikibaseRepresentable
|
|
12
12
|
@badges = badges
|
13
13
|
end
|
14
14
|
|
15
|
+
def state
|
16
|
+
[site_id, page_name, badges]
|
17
|
+
end
|
18
|
+
|
15
19
|
def ==(other)
|
16
|
-
other.
|
17
|
-
@site_id == other.site_id &&
|
18
|
-
@page_name == other.page_name &&
|
19
|
-
@badges.size == other.badges.size &&
|
20
|
-
@badges & other.badges == @badges
|
20
|
+
other.class == self.class && other.state == state
|
21
21
|
end
|
22
22
|
|
23
23
|
def eql?(other)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'wikibase_representable/model/
|
3
|
+
require 'wikibase_representable/model/snak_hash'
|
4
4
|
|
5
5
|
module WikibaseRepresentable
|
6
6
|
module Model
|
@@ -17,22 +17,13 @@ module WikibaseRepresentable
|
|
17
17
|
|
18
18
|
attr_accessor :main_snak, :type, :qualifiers, :qualifiers_order, :guid, :rank
|
19
19
|
|
20
|
-
def initialize(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
@
|
27
|
-
@type = type
|
28
|
-
@qualifiers = qualifiers
|
29
|
-
@qualifiers_order = qualifiers_order
|
30
|
-
@guid = guid
|
31
|
-
@rank = rank
|
32
|
-
end
|
33
|
-
|
34
|
-
def qualifiers?
|
35
|
-
!!qualifiers && !qualifiers.empty?
|
20
|
+
def initialize(**kwargs)
|
21
|
+
@main_snak = kwargs[:main_snak]
|
22
|
+
@type = kwargs[:type] || TYPE
|
23
|
+
@qualifiers = kwargs[:qualifiers]
|
24
|
+
@qualifiers_order = kwargs[:qualifiers_order]
|
25
|
+
@guid = kwargs[:guid]
|
26
|
+
@rank = kwargs[:rank] || RANK_NORMAL
|
36
27
|
end
|
37
28
|
|
38
29
|
def qualifiers_by_property_id?(property_id)
|
@@ -44,17 +35,15 @@ module WikibaseRepresentable
|
|
44
35
|
end
|
45
36
|
|
46
37
|
def property_id
|
47
|
-
|
38
|
+
main_snak.property_id
|
39
|
+
end
|
40
|
+
|
41
|
+
def state
|
42
|
+
[main_snak, type, qualifiers, qualifiers_order, guid, rank]
|
48
43
|
end
|
49
44
|
|
50
45
|
def ==(other)
|
51
|
-
other.
|
52
|
-
other.type == @type &&
|
53
|
-
other.main_snak == @main_snak &&
|
54
|
-
other.qualifiers == @qualifiers &&
|
55
|
-
other.qualifiers_order == @qualifiers_order &&
|
56
|
-
other.rank == @rank &&
|
57
|
-
other.guid == @guid
|
46
|
+
other.class == self.class && other.state == state
|
58
47
|
end
|
59
48
|
|
60
49
|
def eql?(other)
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module WikibaseRepresentable
|
4
4
|
module Model
|
5
|
-
#
|
6
|
-
class
|
5
|
+
# Hash of Statement lists keyed by property id.
|
6
|
+
class StatementHash < Hash
|
7
7
|
def statements_by_property_id(property_id)
|
8
8
|
fetch(property_id, nil)
|
9
9
|
end
|
@@ -11,10 +11,12 @@ module WikibaseRepresentable
|
|
11
11
|
@value = value
|
12
12
|
end
|
13
13
|
|
14
|
+
def state
|
15
|
+
[language_code, value]
|
16
|
+
end
|
17
|
+
|
14
18
|
def ==(other)
|
15
|
-
other.
|
16
|
-
@language_code == other.language_code &&
|
17
|
-
@value == other.value
|
19
|
+
other.class == self.class && other.state == state
|
18
20
|
end
|
19
21
|
|
20
22
|
def eql?(other)
|
@@ -4,8 +4,8 @@ require 'wikibase_representable/model/term'
|
|
4
4
|
|
5
5
|
module WikibaseRepresentable
|
6
6
|
module Model
|
7
|
-
#
|
8
|
-
class
|
7
|
+
# Hash of Term objects keyed by language code.
|
8
|
+
class TermHash < Hash
|
9
9
|
def term_for_language(language_code)
|
10
10
|
fetch(language_code, nil)
|
11
11
|
end
|
@@ -6,23 +6,21 @@ module WikibaseRepresentable
|
|
6
6
|
class Time
|
7
7
|
attr_accessor :time, :time_zone, :before, :after, :precision, :calendar_model
|
8
8
|
|
9
|
-
def initialize(
|
10
|
-
@time = time
|
11
|
-
@time_zone = time_zone
|
12
|
-
@before = before
|
13
|
-
@after = after
|
14
|
-
@precision = precision
|
15
|
-
@calendar_model = calendar_model
|
9
|
+
def initialize(**kwargs)
|
10
|
+
@time = kwargs[:time]
|
11
|
+
@time_zone = kwargs[:time_zone]
|
12
|
+
@before = kwargs[:before]
|
13
|
+
@after = kwargs[:after]
|
14
|
+
@precision = kwargs[:precision]
|
15
|
+
@calendar_model = kwargs[:calendar_model]
|
16
|
+
end
|
17
|
+
|
18
|
+
def state
|
19
|
+
[time, time_zone, before, after, precision, calendar_model]
|
16
20
|
end
|
17
21
|
|
18
22
|
def ==(other)
|
19
|
-
other.
|
20
|
-
time == other.time &&
|
21
|
-
time_zone == other.time_zone &&
|
22
|
-
before == other.before &&
|
23
|
-
after == other.after &&
|
24
|
-
precision == other.precision &&
|
25
|
-
calendar_model == other.calendar_model
|
23
|
+
other.class == self.class && other.state == state
|
26
24
|
end
|
27
25
|
|
28
26
|
def eql?(other)
|
@@ -13,38 +13,35 @@ module WikibaseRepresentable
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def time
|
16
|
-
|
16
|
+
value.time
|
17
17
|
end
|
18
18
|
|
19
19
|
def time_zone
|
20
|
-
|
20
|
+
value.time_zone
|
21
21
|
end
|
22
22
|
|
23
23
|
def before
|
24
|
-
|
24
|
+
value.before
|
25
25
|
end
|
26
26
|
|
27
27
|
def after
|
28
|
-
|
28
|
+
value.after
|
29
29
|
end
|
30
30
|
|
31
31
|
def precision
|
32
|
-
|
32
|
+
value.precision
|
33
33
|
end
|
34
34
|
|
35
35
|
def calendar_model
|
36
|
-
|
36
|
+
value.calendar_model
|
37
|
+
end
|
38
|
+
|
39
|
+
def state
|
40
|
+
[type, value]
|
37
41
|
end
|
38
42
|
|
39
43
|
def ==(other)
|
40
|
-
other.
|
41
|
-
type == other.type &&
|
42
|
-
time == other.time &&
|
43
|
-
time_zone == other.time_zone &&
|
44
|
-
before == other.before &&
|
45
|
-
after == other.after &&
|
46
|
-
precision == other.precision &&
|
47
|
-
calendar_model == other.calendar_model
|
44
|
+
other.class == self.class && other.state == state
|
48
45
|
end
|
49
46
|
|
50
47
|
def eql?(other)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'wikibase_representable/model/snak_data_value_helper'
|
4
4
|
require 'wikibase_representable/model/statement_data_value_helper'
|
5
5
|
|
6
|
-
require 'wikibase_representable/model/
|
6
|
+
require 'wikibase_representable/model/alias_group_hash'
|
7
7
|
require 'wikibase_representable/model/data_value'
|
8
8
|
require 'wikibase_representable/model/entity_id'
|
9
9
|
require 'wikibase_representable/model/entity_id_value'
|
@@ -11,11 +11,11 @@ require 'wikibase_representable/model/item'
|
|
11
11
|
require 'wikibase_representable/model/property'
|
12
12
|
require 'wikibase_representable/model/property_value_snak'
|
13
13
|
require 'wikibase_representable/model/site_link'
|
14
|
-
require 'wikibase_representable/model/
|
15
|
-
require 'wikibase_representable/model/
|
14
|
+
require 'wikibase_representable/model/site_link_hash'
|
15
|
+
require 'wikibase_representable/model/snak_hash'
|
16
16
|
require 'wikibase_representable/model/statement'
|
17
|
-
require 'wikibase_representable/model/
|
17
|
+
require 'wikibase_representable/model/statement_hash'
|
18
18
|
require 'wikibase_representable/model/term'
|
19
|
-
require 'wikibase_representable/model/
|
19
|
+
require 'wikibase_representable/model/term_hash'
|
20
20
|
require 'wikibase_representable/model/time_value'
|
21
21
|
require 'wikibase_representable/model/time'
|
@@ -6,7 +6,7 @@ require 'wikibase_representable/representers/term_representer'
|
|
6
6
|
module WikibaseRepresentable
|
7
7
|
module Representers
|
8
8
|
# Representer for a hash of language_codes => term arrays
|
9
|
-
class
|
9
|
+
class AliasGroupHashRepresenter < Representable::Decorator
|
10
10
|
include Representable::JSON::Hash
|
11
11
|
|
12
12
|
values decorator: TermRepresenter.for_collection, instance: ->(_fragment) { [] }
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
require 'representable/json'
|
4
4
|
require 'wikibase_representable/model'
|
5
|
-
require 'wikibase_representable/representers/
|
6
|
-
require 'wikibase_representable/representers/
|
7
|
-
require 'wikibase_representable/representers/
|
8
|
-
require 'wikibase_representable/representers/
|
5
|
+
require 'wikibase_representable/representers/alias_group_hash_representer'
|
6
|
+
require 'wikibase_representable/representers/site_link_hash_representer'
|
7
|
+
require 'wikibase_representable/representers/statement_hash_representer'
|
8
|
+
require 'wikibase_representable/representers/term_hash_representer'
|
9
9
|
|
10
10
|
module WikibaseRepresentable
|
11
11
|
module Representers
|
@@ -16,19 +16,18 @@ module WikibaseRepresentable
|
|
16
16
|
|
17
17
|
property :type
|
18
18
|
property :id
|
19
|
-
property :
|
20
|
-
|
21
|
-
property :
|
22
|
-
|
23
|
-
property :
|
24
|
-
|
25
|
-
|
26
|
-
property :
|
27
|
-
|
28
|
-
|
29
|
-
property :
|
30
|
-
|
31
|
-
class: SiteLinkList
|
19
|
+
property :labels_hash, decorator: TermHashRepresenter,
|
20
|
+
class: TermHash
|
21
|
+
property :descriptions_hash, decorator: TermHashRepresenter,
|
22
|
+
class: TermHash
|
23
|
+
property :alias_groups_hash, as: 'aliases_hash',
|
24
|
+
decorator: AliasGroupHashRepresenter,
|
25
|
+
class: AliasGroupHash
|
26
|
+
property :statements_hash, as: 'claims_hash',
|
27
|
+
decorator: StatementHashRepresenter,
|
28
|
+
class: StatementHash
|
29
|
+
property :site_links_hash, decorator: SiteLinkHashRepresenter,
|
30
|
+
class: SiteLinkHash
|
32
31
|
end
|
33
32
|
end
|
34
33
|
end
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'representable/json'
|
4
4
|
require 'wikibase_representable/model'
|
5
|
-
require 'wikibase_representable/representers/
|
6
|
-
require 'wikibase_representable/representers/
|
7
|
-
require 'wikibase_representable/representers/
|
5
|
+
require 'wikibase_representable/representers/alias_group_hash_representer'
|
6
|
+
require 'wikibase_representable/representers/statement_hash_representer'
|
7
|
+
require 'wikibase_representable/representers/term_hash_representer'
|
8
8
|
|
9
9
|
module WikibaseRepresentable
|
10
10
|
module Representers
|
@@ -16,16 +16,16 @@ module WikibaseRepresentable
|
|
16
16
|
property :type
|
17
17
|
property :data_type, as: 'datatype'
|
18
18
|
property :id
|
19
|
-
property :
|
20
|
-
|
21
|
-
property :
|
22
|
-
|
23
|
-
property :
|
24
|
-
|
25
|
-
|
26
|
-
property :
|
27
|
-
|
28
|
-
|
19
|
+
property :labels_hash, decorator: TermHashRepresenter,
|
20
|
+
class: TermHash
|
21
|
+
property :descriptions_hash, decorator: TermHashRepresenter,
|
22
|
+
class: TermHash
|
23
|
+
property :alias_groups_hash, as: 'aliases_hash',
|
24
|
+
decorator: AliasGroupHashRepresenter,
|
25
|
+
class: AliasGroupHash
|
26
|
+
property :statements_hash, as: 'claims_hash',
|
27
|
+
decorator: StatementHashRepresenter,
|
28
|
+
class: StatementHash
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -7,7 +7,7 @@ require 'wikibase_representable/representers/site_link_representer'
|
|
7
7
|
module WikibaseRepresentable
|
8
8
|
module Representers
|
9
9
|
# Representer for a hash of (siteid => sitelink)
|
10
|
-
class
|
10
|
+
class SiteLinkHashRepresenter < Representable::Decorator
|
11
11
|
include Representable::JSON::Hash
|
12
12
|
include WikibaseRepresentable::Model
|
13
13
|
|
data/lib/wikibase_representable/representers/{snak_list_representer.rb → snak_hash_representer.rb}
RENAMED
@@ -5,8 +5,8 @@ require 'wikibase_representable/representers/property_value_snak_representer'
|
|
5
5
|
|
6
6
|
module WikibaseRepresentable
|
7
7
|
module Representers
|
8
|
-
# Representer for a
|
9
|
-
class
|
8
|
+
# Representer for a hash of snak lists keyed by property ID.
|
9
|
+
class SnakHashRepresenter < Representable::Decorator
|
10
10
|
include Representable::JSON::Hash
|
11
11
|
|
12
12
|
values decorator: PropertyValueSnakRepresenter.for_collection, instance: ->(_fragment) { [] }
|
@@ -6,7 +6,7 @@ require 'wikibase_representable/representers/statement_representer'
|
|
6
6
|
module WikibaseRepresentable
|
7
7
|
module Representers
|
8
8
|
# Representer for a hash of property IDs => statement arrays.
|
9
|
-
class
|
9
|
+
class StatementHashRepresenter < Representable::Decorator
|
10
10
|
include Representable::JSON::Hash
|
11
11
|
|
12
12
|
values decorator: StatementRepresenter.for_collection, instance: ->(_fragment) { [] }
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'representable/json'
|
4
4
|
require 'wikibase_representable/model'
|
5
5
|
require 'wikibase_representable/representers/property_value_snak_representer'
|
6
|
-
require 'wikibase_representable/representers/
|
6
|
+
require 'wikibase_representable/representers/snak_hash_representer'
|
7
7
|
|
8
8
|
module WikibaseRepresentable
|
9
9
|
module Representers
|
@@ -16,8 +16,8 @@ module WikibaseRepresentable
|
|
16
16
|
decorator: PropertyValueSnakRepresenter,
|
17
17
|
class: PropertyValueSnak
|
18
18
|
property :type
|
19
|
-
property :qualifiers, decorator:
|
20
|
-
class:
|
19
|
+
property :qualifiers, decorator: SnakHashRepresenter,
|
20
|
+
class: SnakHash
|
21
21
|
property :qualifiers_order, as: 'qualifiers-order'
|
22
22
|
property :guid, as: 'id'
|
23
23
|
property :rank
|
data/lib/wikibase_representable/representers/{term_list_representer.rb → term_hash_representer.rb}
RENAMED
@@ -6,8 +6,8 @@ require 'wikibase_representable/representers/term_representer'
|
|
6
6
|
|
7
7
|
module WikibaseRepresentable
|
8
8
|
module Representers
|
9
|
-
# Representer for term
|
10
|
-
class
|
9
|
+
# Representer for term hashes
|
10
|
+
class TermHashRepresenter < Representable::Decorator
|
11
11
|
include Representable::JSON::Hash
|
12
12
|
include WikibaseRepresentable::Model
|
13
13
|
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'wikibase_representable/representers/
|
3
|
+
require 'wikibase_representable/representers/alias_group_hash_representer'
|
4
4
|
require 'wikibase_representable/representers/data_value_representer'
|
5
5
|
require 'wikibase_representable/representers/entity_id_value_representer'
|
6
6
|
require 'wikibase_representable/representers/entity_id_representer'
|
7
7
|
require 'wikibase_representable/representers/item_representer'
|
8
8
|
require 'wikibase_representable/representers/property_value_snak_representer'
|
9
9
|
require 'wikibase_representable/representers/property_representer'
|
10
|
-
require 'wikibase_representable/representers/
|
10
|
+
require 'wikibase_representable/representers/site_link_hash_representer'
|
11
11
|
require 'wikibase_representable/representers/site_link_representer'
|
12
|
-
require 'wikibase_representable/representers/
|
13
|
-
require 'wikibase_representable/representers/
|
12
|
+
require 'wikibase_representable/representers/snak_hash_representer'
|
13
|
+
require 'wikibase_representable/representers/statement_hash_representer'
|
14
14
|
require 'wikibase_representable/representers/statement_representer'
|
15
|
-
require 'wikibase_representable/representers/
|
15
|
+
require 'wikibase_representable/representers/term_hash_representer'
|
16
16
|
require 'wikibase_representable/representers/term_representer'
|
17
17
|
require 'wikibase_representable/representers/time_value_representer'
|
18
18
|
require 'wikibase_representable/representers/time_representer'
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Tests round-trip deserialization and serialization of Wikibase entities.
|
4
|
+
# Attempts to correct for quirks in the Wikibase output format such as optional escape characters
|
5
|
+
# used by PHP and not Ruby (though this can lead to false-positive diffs where the data contains a
|
6
|
+
# backslash that looks like an escape character but isn't.).
|
7
|
+
|
8
|
+
require 'diffy'
|
9
|
+
require 'json'
|
10
|
+
require 'optparse'
|
11
|
+
require 'wikibase_representable'
|
12
|
+
require 'zlib'
|
13
|
+
|
14
|
+
dir = File.dirname __FILE__
|
15
|
+
|
16
|
+
export_file = File.expand_path '../../../DigitalScriptorium/ds-exports/json/ds-latest.json.gz', dir
|
17
|
+
|
18
|
+
OptionParser.new { |opts|
|
19
|
+
opts.banner = 'Usage: test_wikibase_representable_ds_serialization.rb [options]'
|
20
|
+
|
21
|
+
opts.on('-f', '--file=FILE', 'The file path to the Wikibase JSON export file.') do |f|
|
22
|
+
export_file = File.expand_path f, dir
|
23
|
+
end
|
24
|
+
}.parse!
|
25
|
+
|
26
|
+
lines_examined = 0
|
27
|
+
parse_errors = 0
|
28
|
+
diff_count = 0
|
29
|
+
|
30
|
+
def decorator(type)
|
31
|
+
if type == WikibaseRepresentable::Model::Item::ENTITY_TYPE
|
32
|
+
WikibaseRepresentable::Representers::ItemRepresenter
|
33
|
+
else
|
34
|
+
WikibaseRepresentable::Representers::PropertyRepresenter
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def clazz(type)
|
39
|
+
if type == WikibaseRepresentable::Model::Item::ENTITY_TYPE
|
40
|
+
WikibaseRepresentable::Model::Item
|
41
|
+
else
|
42
|
+
WikibaseRepresentable::Model::Property
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# File.readlines('../../hxsllc/hxs-blacklight/lib/export-prod-0328.json').each do |line|
|
47
|
+
Zlib::GzipReader.open(export_file).each_line do |line|
|
48
|
+
next if ["[\n", "]\n"].include?(line)
|
49
|
+
|
50
|
+
lines_examined += 1
|
51
|
+
|
52
|
+
line = line
|
53
|
+
.gsub(/(^\[|\]$|,\n$)/, '')
|
54
|
+
# Strip PHP-specific escape characters for diffing
|
55
|
+
# See https://stackoverflow.com/a/56834902 for discussion
|
56
|
+
.gsub(%r{\\(/|[A-Za-z0-9])}, '\1')
|
57
|
+
|
58
|
+
begin
|
59
|
+
hash = JSON.parse(line)
|
60
|
+
rescue StandardError
|
61
|
+
puts "***PARSE ERROR***\n#{line}\n\n"
|
62
|
+
parse_errors += 1
|
63
|
+
next
|
64
|
+
end
|
65
|
+
|
66
|
+
decorator = decorator(hash['type'])
|
67
|
+
clazz = clazz(hash['type'])
|
68
|
+
obj = decorator.new(clazz.new).from_json(line)
|
69
|
+
diff = Diffy::Diff.new("#{line}\n", "#{decorator.new(obj)
|
70
|
+
.to_json
|
71
|
+
# Adjust empty associative arrays to match PHP serialization
|
72
|
+
.gsub(/\{\}/, '[]')}\n")
|
73
|
+
|
74
|
+
unless diff.to_s.empty?
|
75
|
+
puts("***DIFF***\n#{diff}\n\n")
|
76
|
+
diff_count += 1
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# 3 items with known diffs: Q37381, Q43197 (both due to improperly regex-stripped backslash), Q66686 (TBD)
|
81
|
+
puts "Lines examined: #{lines_examined}"
|
82
|
+
puts "Parse errors: #{parse_errors}"
|
83
|
+
puts "Diff count: #{diff_count}"
|
84
|
+
|
85
|
+
exit [diff_count + parse_errors, 1].min
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikibase_representable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Holloway
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-02-09 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: multi_json
|
@@ -52,75 +52,89 @@ dependencies:
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '2.5'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: diffy
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '3.4'
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '3.4'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
69
|
+
name: pry
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 0.15.2
|
75
75
|
type: :development
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 0.15.2
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
83
|
+
name: rake
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '13.2'
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '13.2'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rspec
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '3.13'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.13'
|
96
110
|
- !ruby/object:Gem::Dependency
|
97
|
-
name:
|
111
|
+
name: simplecov
|
98
112
|
requirement: !ruby/object:Gem::Requirement
|
99
113
|
requirements:
|
100
114
|
- - "~>"
|
101
115
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
116
|
+
version: 0.22.0
|
103
117
|
type: :development
|
104
118
|
prerelease: false
|
105
119
|
version_requirements: !ruby/object:Gem::Requirement
|
106
120
|
requirements:
|
107
121
|
- - "~>"
|
108
122
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
123
|
+
version: 0.22.0
|
110
124
|
- !ruby/object:Gem::Dependency
|
111
|
-
name: rubocop
|
125
|
+
name: upennlib-rubocop
|
112
126
|
requirement: !ruby/object:Gem::Requirement
|
113
127
|
requirements:
|
114
128
|
- - "~>"
|
115
129
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
130
|
+
version: 1.2.0
|
117
131
|
type: :development
|
118
132
|
prerelease: false
|
119
133
|
version_requirements: !ruby/object:Gem::Requirement
|
120
134
|
requirements:
|
121
135
|
- - "~>"
|
122
136
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
137
|
+
version: 1.2.0
|
124
138
|
description: Provides Wikibase data model classes and support for serializing and
|
125
139
|
deserializing Wikibase entities to and from JSON.
|
126
140
|
email:
|
@@ -129,12 +143,15 @@ executables: []
|
|
129
143
|
extensions: []
|
130
144
|
extra_rdoc_files: []
|
131
145
|
files:
|
146
|
+
- ".rspec"
|
132
147
|
- ".rubocop.yml"
|
148
|
+
- ".rubocop_todo.yml"
|
149
|
+
- LICENSE.txt
|
133
150
|
- README.md
|
134
151
|
- Rakefile
|
135
152
|
- lib/wikibase_representable.rb
|
136
153
|
- lib/wikibase_representable/model.rb
|
137
|
-
- lib/wikibase_representable/model/
|
154
|
+
- lib/wikibase_representable/model/alias_group_hash.rb
|
138
155
|
- lib/wikibase_representable/model/data_value.rb
|
139
156
|
- lib/wikibase_representable/model/entity_id.rb
|
140
157
|
- lib/wikibase_representable/model/entity_id_value.rb
|
@@ -142,34 +159,35 @@ files:
|
|
142
159
|
- lib/wikibase_representable/model/property.rb
|
143
160
|
- lib/wikibase_representable/model/property_value_snak.rb
|
144
161
|
- lib/wikibase_representable/model/site_link.rb
|
145
|
-
- lib/wikibase_representable/model/
|
162
|
+
- lib/wikibase_representable/model/site_link_hash.rb
|
146
163
|
- lib/wikibase_representable/model/snak_data_value_helper.rb
|
147
|
-
- lib/wikibase_representable/model/
|
164
|
+
- lib/wikibase_representable/model/snak_hash.rb
|
148
165
|
- lib/wikibase_representable/model/statement.rb
|
149
166
|
- lib/wikibase_representable/model/statement_data_value_helper.rb
|
150
|
-
- lib/wikibase_representable/model/
|
167
|
+
- lib/wikibase_representable/model/statement_hash.rb
|
151
168
|
- lib/wikibase_representable/model/term.rb
|
152
|
-
- lib/wikibase_representable/model/
|
169
|
+
- lib/wikibase_representable/model/term_hash.rb
|
153
170
|
- lib/wikibase_representable/model/time.rb
|
154
171
|
- lib/wikibase_representable/model/time_value.rb
|
155
172
|
- lib/wikibase_representable/representers.rb
|
156
|
-
- lib/wikibase_representable/representers/
|
173
|
+
- lib/wikibase_representable/representers/alias_group_hash_representer.rb
|
157
174
|
- lib/wikibase_representable/representers/data_value_representer.rb
|
158
175
|
- lib/wikibase_representable/representers/entity_id_representer.rb
|
159
176
|
- lib/wikibase_representable/representers/entity_id_value_representer.rb
|
160
177
|
- lib/wikibase_representable/representers/item_representer.rb
|
161
178
|
- lib/wikibase_representable/representers/property_representer.rb
|
162
179
|
- lib/wikibase_representable/representers/property_value_snak_representer.rb
|
163
|
-
- lib/wikibase_representable/representers/
|
180
|
+
- lib/wikibase_representable/representers/site_link_hash_representer.rb
|
164
181
|
- lib/wikibase_representable/representers/site_link_representer.rb
|
165
|
-
- lib/wikibase_representable/representers/
|
166
|
-
- lib/wikibase_representable/representers/
|
182
|
+
- lib/wikibase_representable/representers/snak_hash_representer.rb
|
183
|
+
- lib/wikibase_representable/representers/statement_hash_representer.rb
|
167
184
|
- lib/wikibase_representable/representers/statement_representer.rb
|
168
|
-
- lib/wikibase_representable/representers/
|
185
|
+
- lib/wikibase_representable/representers/term_hash_representer.rb
|
169
186
|
- lib/wikibase_representable/representers/term_representer.rb
|
170
187
|
- lib/wikibase_representable/representers/time_representer.rb
|
171
188
|
- lib/wikibase_representable/representers/time_value_representer.rb
|
172
189
|
- lib/wikibase_representable/version.rb
|
190
|
+
- scripts/test_deserialization_round_trip.rb
|
173
191
|
homepage: https://github.com/mdholloway/wikibase_representable
|
174
192
|
licenses:
|
175
193
|
- MIT
|