relaton-bsi 2.0.0.pre.alpha.2 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3761eac8aaa29d16884a70b45081caa0c1142a6c3b4f58d92c544caddc22743
4
- data.tar.gz: 8d5d18a33dcfa75b2672352d23e09b9f0bc4e9d94465419470406371900281b8
3
+ metadata.gz: b3da9e7c45bcfab248b2c756822372254a3942b3003ae575167e6e89b05d4e2a
4
+ data.tar.gz: 736245ec9107245d16fb752e41958237c0f9e793968bf05f1789226197966654
5
5
  SHA512:
6
- metadata.gz: d005c8d9aade1936f2b1da7656684de2c1dc51630fde10a91efcf8f331f6a2ca76d7244fe5a50068302ad18547202194623e88205701c4ebc0d6d0c9c31e3234
7
- data.tar.gz: 4cd613faff93db8bc1779dd3e62a6677874dc9277e1701e117395148c570e480c5616a2042ee0cf0706d22000808bb6746c1fa263fb68485e8442b36cfd39778
6
+ metadata.gz: 82317ae24b84302fc86d68891eea1bfc001dcf8c654ab7a5b6060b6f2cadf30866754d7f2ce39dd4297262821f493442f8134f72589fef11ce888004ef07331d
7
+ data.tar.gz: 077ff061529b15d8bf38842cbade1416f322b606d2308bec005db45574f62cb67b88b3057740682f191aa457e4c8d406debd52e9429a15c7801e4fc144c0bbbb
data/Gemfile CHANGED
@@ -8,6 +8,7 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
  gem "rspec", "~> 3.0"
10
10
 
11
+
11
12
  gem "equivalent-xml", "~> 0.6"
12
13
  gem "pry-byebug"
13
14
  gem "ruby-jing"
data/grammars/biblio.rng CHANGED
@@ -2015,15 +2015,11 @@ provided that it is not the entire bibliographic item that is so related</a:docu
2015
2015
  <a:documentation>A version of the bibliographic item (within an edition). Can be used for drafts</a:documentation>
2016
2016
  <element name="version">
2017
2017
  <optional>
2018
- <ref name="revision-date">
2019
- <a:documentation>The date at which the current version of the bibliographic item was produced</a:documentation>
2020
- </ref>
2021
- </optional>
2022
- <optional>
2023
- <ref name="draft">
2024
- <a:documentation>The identifier for the current draft of the bibliographic item</a:documentation>
2025
- </ref>
2018
+ <attribute name="type">
2019
+ <a:documentation>Versioning scheme, in case of multiple versioning schemes</a:documentation>
2020
+ </attribute>
2026
2021
  </optional>
2022
+ <text/>
2027
2023
  </element>
2028
2024
  </define>
2029
2025
  <define name="vedition">
@@ -1,10 +1,6 @@
1
1
  module Relaton
2
2
  module Bsi
3
3
  class ItemData < Iso::ItemData
4
- def deep_clone
5
- Item.from_yaml Item.to_yaml(self)
6
- end
7
-
8
4
  def create_id(without_date: false)
9
5
  docid = docidentifier.find(&:primary) || docidentifier.first
10
6
  return unless docid
@@ -12,38 +8,6 @@ module Relaton
12
8
  id_content = without_date ? docid.content.sub(/:\d{4}$/, "") : docid.content
13
9
  self.id = id_content.gsub(/\W+/, "")
14
10
  end
15
-
16
- def create_relation(**args)
17
- Relation.new(**args)
18
- end
19
-
20
- def to_xml(bibdata: false, **opts)
21
- add_notes opts[:note] do
22
- bibdata ? Bibdata.to_xml(self) : Bibitem.to_xml(self)
23
- end
24
- end
25
-
26
- def to_yaml(**opts)
27
- add_notes opts[:note] do
28
- Item.to_yaml(self)
29
- end
30
- end
31
-
32
- def to_json(**opts)
33
- add_notes opts[:note] do
34
- Item.to_json(self)
35
- end
36
- end
37
-
38
- # private
39
-
40
- # def add_notes(notes)
41
- # self.note ||= []
42
- # Relaton.array(notes).each { |nt| note << Bib::Note.new(**nt) }
43
- # result = yield
44
- # Relaton.array(notes).each { note.pop }
45
- # result
46
- # end
47
11
  end
48
12
  end
49
13
  end
@@ -1,6 +1,7 @@
1
1
  module Relaton
2
2
  module Bsi
3
3
  class Bibdata < Item
4
+ model ItemData
4
5
  include Bib::BibdataShared
5
6
  end
6
7
  end
@@ -1,6 +1,7 @@
1
1
  module Relaton
2
2
  module Bsi
3
3
  class Bibitem < Item
4
+ model ItemData
4
5
  include Bib::BibitemShared
5
6
  end
6
7
  end
@@ -2,28 +2,16 @@ require_relative "doctype"
2
2
 
3
3
  module Relaton
4
4
  module Bsi
5
- class Ext < Lutaml::Model::Serializable
6
- attribute :schema_version, method: :get_schema_version
5
+ class Ext < Bib::Ext
7
6
  attribute :doctype, Doctype
8
- attribute :subdoctype, :string
9
- attribute :flavor, :string
10
7
  attribute :ics, Bib::ICS, collection: true
11
8
  attribute :structuredidentifier, Iso::StructuredIdentifier, collection: true, initialize_empty: true
12
9
  attribute :stagename, Iso::Stagename
13
10
 
14
- xml do
15
- map_attribute "schema-version", to: :schema_version
16
- map_element "doctype", to: :doctype
17
- map_element "subdoctype", to: :subdoctype
18
- map_element "flavor", to: :flavor
19
- map_element "ics", to: :ics
20
- map_element "stagename", to: :stagename
21
- map_element "structuredidentifier", to: :structuredidentifier
22
- end
11
+ xml { map_element "stagename", to: :stagename }
12
+ key_value { map_element "stagename", to: :stagename }
23
13
 
24
- def get_schema_version
25
- Relaton.schema_versions["relaton-model-bsi"]
26
- end
14
+ def get_schema_version = Relaton.schema_versions["relaton-model-bsi"]
27
15
  end
28
16
  end
29
17
  end
@@ -1,19 +1,22 @@
1
+ require_relative "docidentifier"
2
+
1
3
  module Relaton
2
4
  module Bsi
3
- # The class is for relaton bibitem instances.
4
- # The in relaton bibitem instances dosn't have schema-version & fetched attributes.
5
- class ItemBase < Item
5
+ class ItemBase < Lutaml::Model::Serializable
6
+ include Bib::NamespaceHelper
7
+
8
+ attr_accessor :type
9
+
6
10
  model ItemData
7
11
 
8
- # we don't need schema-version & fetched attributes in reation/bibitem
9
- mappings[:xml].instance_variable_get(:@attributes).delete("id")
10
- mappings[:xml].instance_variable_get(:@attributes).delete("schema-version")
11
- mappings[:xml].instance_variable_get(:@elements).delete("fetched")
12
- mappings[:xml].instance_variable_get(:@elements).delete("ext")
13
- attributes.delete :id
14
- attributes.delete :schema_version
15
- attributes.delete :fetched
16
- attributes.delete :ext
12
+ instance_exec(&Bib::ItemShared::ATTRIBUTES)
13
+ attribute :docidentifier, Docidentifier, collection: true, initialize_empty: true
14
+ attribute :relation, Relation, collection: true, initialize_empty: true
15
+
16
+ xml do
17
+ map_attribute "type", to: :type
18
+ instance_exec(&Bib::ItemShared::XML_BODY)
19
+ end
17
20
  end
18
21
  end
19
22
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Relaton
4
4
  module Bsi
5
- VERSION = "2.0.0-alpha.2".freeze
5
+ VERSION = "2.1.0".freeze
6
6
  end
7
7
  end
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "graphql", "~> 2.3"
35
35
  spec.add_dependency "graphql-client", "~> 0.23"
36
36
  spec.add_dependency "relaton-core", "~> 0.0.9"
37
- spec.add_dependency "relaton-iso", "~> 2.0.0-alpha.7"
37
+ spec.add_dependency "relaton-iso", "~> 2.1.0"
38
38
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-05-04 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: algolia
@@ -85,14 +86,14 @@ dependencies:
85
86
  requirements:
86
87
  - - "~>"
87
88
  - !ruby/object:Gem::Version
88
- version: 2.0.0.pre.alpha.7
89
+ version: 2.1.0
89
90
  type: :runtime
90
91
  prerelease: false
91
92
  version_requirements: !ruby/object:Gem::Requirement
92
93
  requirements:
93
94
  - - "~>"
94
95
  - !ruby/object:Gem::Version
95
- version: 2.0.0.pre.alpha.7
96
+ version: 2.1.0
96
97
  description: 'Relaton::Bsi: retrieve BSI Standards for bibliographic use using the
97
98
  BibliographicItem model'
98
99
  email:
@@ -136,13 +137,14 @@ files:
136
137
  - lib/relaton/bsi/scraper.rb
137
138
  - lib/relaton/bsi/util.rb
138
139
  - lib/relaton/bsi/version.rb
139
- - relaton_bsi.gemspec
140
+ - relaton-bsi.gemspec
140
141
  homepage: https://github.com/metanorma/relaton-bsi
141
142
  licenses:
142
143
  - BSD-2-Clause
143
144
  metadata:
144
145
  homepage_uri: https://github.com/metanorma/relaton-bsi
145
146
  source_code_uri: https://github.com/metanorma/relaton-bsi
147
+ post_install_message:
146
148
  rdoc_options: []
147
149
  require_paths:
148
150
  - lib
@@ -157,7 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
159
  - !ruby/object:Gem::Version
158
160
  version: '0'
159
161
  requirements: []
160
- rubygems_version: 3.6.9
162
+ rubygems_version: 3.5.22
163
+ signing_key:
161
164
  specification_version: 4
162
165
  summary: 'Relaton::Bsi: retrieve BSI Standards for bibliographic use using the BibliographicItem
163
166
  model'