opencdd 0.1.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 +7 -0
- data/CLAUDE.md +486 -0
- data/README.md +304 -0
- data/bin/lint-no-raw-mdc +41 -0
- data/lib/cdd.rb +11 -0
- data/lib/opencdd/alias_table.rb +52 -0
- data/lib/opencdd/cddal/ast.rb +151 -0
- data/lib/opencdd/cddal/builder.rb +374 -0
- data/lib/opencdd/cddal/fetcher/in_memory.rb +32 -0
- data/lib/opencdd/cddal/fetcher/net_http.rb +84 -0
- data/lib/opencdd/cddal/fetcher.rb +18 -0
- data/lib/opencdd/cddal/generated_parser.rb +805 -0
- data/lib/opencdd/cddal/lexer.rb +193 -0
- data/lib/opencdd/cddal/parser.rb +19 -0
- data/lib/opencdd/cddal/resolver.rb +100 -0
- data/lib/opencdd/cddal/serializer.rb +210 -0
- data/lib/opencdd/cddal/value_serializer.rb +60 -0
- data/lib/opencdd/cddal.rb +63 -0
- data/lib/opencdd/class_tree.rb +80 -0
- data/lib/opencdd/class_type.rb +33 -0
- data/lib/opencdd/codegen/ts.rb +185 -0
- data/lib/opencdd/codegen.rb +7 -0
- data/lib/opencdd/composition_tree.rb +119 -0
- data/lib/opencdd/condition.rb +120 -0
- data/lib/opencdd/data_type.rb +143 -0
- data/lib/opencdd/database.rb +719 -0
- data/lib/opencdd/effective_properties.rb +119 -0
- data/lib/opencdd/entity/field_reader.rb +141 -0
- data/lib/opencdd/entity/field_registry.rb +99 -0
- data/lib/opencdd/entity/version_history.rb +62 -0
- data/lib/opencdd/entity.rb +255 -0
- data/lib/opencdd/exporters/json.rb +235 -0
- data/lib/opencdd/exporters/mermaid.rb +62 -0
- data/lib/opencdd/exporters/yaml.rb +16 -0
- data/lib/opencdd/exporters.rb +9 -0
- data/lib/opencdd/guid.rb +27 -0
- data/lib/opencdd/instance_rule.rb +70 -0
- data/lib/opencdd/irdi.rb +128 -0
- data/lib/opencdd/klass.rb +230 -0
- data/lib/opencdd/languages.rb +70 -0
- data/lib/opencdd/meta_class.rb +274 -0
- data/lib/opencdd/model/entity_store.rb +85 -0
- data/lib/opencdd/model/yaml_database.rb +49 -0
- data/lib/opencdd/model/yaml_entity.rb +196 -0
- data/lib/opencdd/model.rb +13 -0
- data/lib/opencdd/parcel/csv_reader.rb +35 -0
- data/lib/opencdd/parcel/csv_writer.rb +114 -0
- data/lib/opencdd/parcel/entity_manifest.rb +119 -0
- data/lib/opencdd/parcel/flat_dir_reader.rb +134 -0
- data/lib/opencdd/parcel/layout_detector.rb +115 -0
- data/lib/opencdd/parcel/metadata.rb +112 -0
- data/lib/opencdd/parcel/referenced_irdis.rb +91 -0
- data/lib/opencdd/parcel/scrape_verifier.rb +122 -0
- data/lib/opencdd/parcel/selector.rb +115 -0
- data/lib/opencdd/parcel/sharded_dir_reader.rb +151 -0
- data/lib/opencdd/parcel/sheet.rb +287 -0
- data/lib/opencdd/parcel/sheet_emitter.rb +171 -0
- data/lib/opencdd/parcel/sheet_schema.rb +253 -0
- data/lib/opencdd/parcel/workbook.rb +172 -0
- data/lib/opencdd/parcel/workbook_reader.rb +200 -0
- data/lib/opencdd/parcel/writer.rb +185 -0
- data/lib/opencdd/parcel.rb +175 -0
- data/lib/opencdd/parse_helpers.rb +73 -0
- data/lib/opencdd/property.rb +120 -0
- data/lib/opencdd/property_data_element_type.rb +44 -0
- data/lib/opencdd/property_ids.rb +202 -0
- data/lib/opencdd/reader.rb +103 -0
- data/lib/opencdd/relation.rb +88 -0
- data/lib/opencdd/relation_tree.rb +74 -0
- data/lib/opencdd/relation_type.rb +58 -0
- data/lib/opencdd/structured_values.rb +183 -0
- data/lib/opencdd/unit.rb +16 -0
- data/lib/opencdd/validator/class_reference_rule.rb +77 -0
- data/lib/opencdd/validator/condition_rule.rb +27 -0
- data/lib/opencdd/validator/data_type_rule.rb +26 -0
- data/lib/opencdd/validator/enum_rule.rb +27 -0
- data/lib/opencdd/validator/format_rule.rb +54 -0
- data/lib/opencdd/validator/hierarchy_rule.rb +65 -0
- data/lib/opencdd/validator/irdi_rule.rb +57 -0
- data/lib/opencdd/validator/mandatory_rule.rb +25 -0
- data/lib/opencdd/validator/pattern_rule.rb +26 -0
- data/lib/opencdd/validator/reference_rule.rb +36 -0
- data/lib/opencdd/validator/rule.rb +65 -0
- data/lib/opencdd/validator/runner.rb +101 -0
- data/lib/opencdd/validator/set_rule.rb +41 -0
- data/lib/opencdd/validator/synonym_rule.rb +30 -0
- data/lib/opencdd/validator/type_rule.rb +102 -0
- data/lib/opencdd/validator/uniqueness_rule.rb +32 -0
- data/lib/opencdd/validator.rb +68 -0
- data/lib/opencdd/value_format.rb +71 -0
- data/lib/opencdd/value_list.rb +42 -0
- data/lib/opencdd/value_term.rb +24 -0
- data/lib/opencdd/version.rb +5 -0
- data/lib/opencdd/view_control.rb +10 -0
- data/lib/opencdd/visitor.rb +93 -0
- data/lib/opencdd.rb +57 -0
- metadata +325 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Opencdd
|
|
4
|
+
module Validator
|
|
5
|
+
ValidationError = Struct.new(:sheet, :row, :column, :rule, :message, keyword_init: true) do
|
|
6
|
+
def to_s
|
|
7
|
+
"#{sheet} row=#{row} col=#{column} [#{rule}]: #{message}"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Lazy-load validator rule classes. Autoload (rather than eager
|
|
12
|
+
# `require`) keeps startup cheap when only one rule is needed.
|
|
13
|
+
# The convention matches the rest of the codebase (see
|
|
14
|
+
# lib/cdd/parcel.rb, lib/cdd/exporters.rb).
|
|
15
|
+
autoload :Rule, "opencdd/validator/rule"
|
|
16
|
+
autoload :IrdiRule, "opencdd/validator/irdi_rule"
|
|
17
|
+
autoload :UniquenessRule, "opencdd/validator/uniqueness_rule"
|
|
18
|
+
autoload :MandatoryRule, "opencdd/validator/mandatory_rule"
|
|
19
|
+
autoload :TypeRule, "opencdd/validator/type_rule"
|
|
20
|
+
autoload :EnumRule, "opencdd/validator/enum_rule"
|
|
21
|
+
autoload :FormatRule, "opencdd/validator/format_rule"
|
|
22
|
+
autoload :PatternRule, "opencdd/validator/pattern_rule"
|
|
23
|
+
autoload :ReferenceRule, "opencdd/validator/reference_rule"
|
|
24
|
+
autoload :SetRule, "opencdd/validator/set_rule"
|
|
25
|
+
autoload :SynonymRule, "opencdd/validator/synonym_rule"
|
|
26
|
+
autoload :ConditionRule, "opencdd/validator/condition_rule"
|
|
27
|
+
autoload :DataTypeRule, "opencdd/validator/data_type_rule"
|
|
28
|
+
autoload :HierarchyRule, "opencdd/validator/hierarchy_rule"
|
|
29
|
+
autoload :ClassReferenceRule, "opencdd/validator/class_reference_rule"
|
|
30
|
+
autoload :Runner, "opencdd/validator/runner"
|
|
31
|
+
|
|
32
|
+
module_function
|
|
33
|
+
|
|
34
|
+
# Composite runner — applies every rule to every entity's every
|
|
35
|
+
# property, plus the database-level invariants (class-hierarchy
|
|
36
|
+
# acyclicity). Returns an Array of +ValidationError+ records
|
|
37
|
+
# that the UI / CI can render as a clickable list.
|
|
38
|
+
def run(database, **opts)
|
|
39
|
+
Runner.run(database, **opts)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# ── Reusable predicates (plan 10 public API). Each wraps an
|
|
43
|
+
# existing rule class so the OpenCDD Editor's live validator
|
|
44
|
+
# (TS port) can share the same semantics as the Ruby gem. ──
|
|
45
|
+
|
|
46
|
+
def irdi_well_formed?(value)
|
|
47
|
+
return false if value.nil? || value.to_s.strip.empty?
|
|
48
|
+
!Opencdd::IRDI.parse(value.to_s).nil?
|
|
49
|
+
rescue Opencdd::IRDI::ParseError
|
|
50
|
+
false
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def mandatory_present?(value)
|
|
54
|
+
!value.nil? && !value.to_s.strip.empty?
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def pattern_valid?(value, pattern)
|
|
58
|
+
return false if pattern.nil? || pattern.to_s.empty?
|
|
59
|
+
Regexp.new(pattern).match?(value.to_s)
|
|
60
|
+
rescue RegexpError
|
|
61
|
+
false
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def class_hierarchy_acyclic?(database)
|
|
65
|
+
HierarchyRule.class_hierarchy_acyclic?(database)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Opencdd
|
|
4
|
+
class ValueFormat
|
|
5
|
+
CODES = %w[NR1 NR2 NR3 M].freeze
|
|
6
|
+
|
|
7
|
+
attr_reader :code, :signed, :total, :fractional
|
|
8
|
+
|
|
9
|
+
def initialize(code:, signed: false, total: nil, fractional: nil)
|
|
10
|
+
unless CODES.include?(code.to_s)
|
|
11
|
+
raise ArgumentError, "unknown value_format code: #{code.inspect}"
|
|
12
|
+
end
|
|
13
|
+
@code = code.to_s
|
|
14
|
+
@signed = signed
|
|
15
|
+
@total = total
|
|
16
|
+
@fractional = fractional
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def numeric? = @code != "M"
|
|
20
|
+
def string? = @code == "M"
|
|
21
|
+
|
|
22
|
+
def to_s
|
|
23
|
+
if @code == "M"
|
|
24
|
+
@total ? "M..#{@total}" : "M"
|
|
25
|
+
else
|
|
26
|
+
sign = @signed ? "S" : ""
|
|
27
|
+
frac = @fractional ? ".#{@fractional}" : ""
|
|
28
|
+
total_part = @total ? "..#{@total}" : ""
|
|
29
|
+
"#{@code} #{sign}#{total_part}#{frac}".strip
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
alias_method :inspect, :to_s
|
|
34
|
+
|
|
35
|
+
def ==(other)
|
|
36
|
+
other.is_a?(Opencdd::ValueFormat) &&
|
|
37
|
+
@code == other.code &&
|
|
38
|
+
@signed == other.signed &&
|
|
39
|
+
@total == other.total &&
|
|
40
|
+
@fractional == other.fractional
|
|
41
|
+
end
|
|
42
|
+
alias_method :eql?, :==
|
|
43
|
+
|
|
44
|
+
def hash
|
|
45
|
+
[@code, @signed, @total, @fractional].hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
PATTERN = /\A
|
|
49
|
+
(?<code>NR1|NR2|NR3|M)
|
|
50
|
+
(?:
|
|
51
|
+
\s*(?<signed>S)?
|
|
52
|
+
\.\.(?<total>\d+)
|
|
53
|
+
(?:\.(?<frac>\d+))?
|
|
54
|
+
)?
|
|
55
|
+
\z/x.freeze
|
|
56
|
+
|
|
57
|
+
class << self
|
|
58
|
+
def parse(raw)
|
|
59
|
+
return nil if raw.nil? || raw.to_s.strip.empty?
|
|
60
|
+
s = raw.to_s.strip
|
|
61
|
+
match = s.match(PATTERN)
|
|
62
|
+
return nil unless match
|
|
63
|
+
code = match[:code]
|
|
64
|
+
signed = !match[:signed].nil?
|
|
65
|
+
total = match[:total]&.to_i
|
|
66
|
+
fractional = match[:frac]&.to_i
|
|
67
|
+
new(code: code, signed: signed, total: total, fractional: fractional)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Opencdd
|
|
4
|
+
class ValueList < Opencdd::Entity
|
|
5
|
+
LIST_TYPE_ALIASES = {
|
|
6
|
+
"EXTENSIBLE" => :extensible,
|
|
7
|
+
"CLOSED" => :closed,
|
|
8
|
+
"OPEN" => :open,
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
# ── Pure field reads ─────────────────────────────────────────
|
|
12
|
+
field :term_irdis, "MDC_P043"
|
|
13
|
+
# MDC_P044 is :set_of_refs in REGISTRY but ValueList code_list is
|
|
14
|
+
# a list of plain codes, not IRDIs. Use :string_list to preserve
|
|
15
|
+
# historical behavior.
|
|
16
|
+
field :code_list, "MDC_P044", :string_list
|
|
17
|
+
|
|
18
|
+
# ── Computed fields with block-form readers ──────────────────
|
|
19
|
+
field(:selection_count, synthetic: true) do
|
|
20
|
+
raw = properties[Opencdd::PropertyIds::MDC_P045]
|
|
21
|
+
next nil unless raw
|
|
22
|
+
s = raw.to_s.strip
|
|
23
|
+
s = s[1..-2] if s.start_with?("(") && s.end_with?(")")
|
|
24
|
+
parts = s.split(",").map { |x| Integer(x.strip) rescue nil }.compact
|
|
25
|
+
parts.empty? ? nil : parts
|
|
26
|
+
end
|
|
27
|
+
field(:list_type, synthetic: true) do
|
|
28
|
+
raw = properties[Opencdd::PropertyIds::MDC_P046]
|
|
29
|
+
LIST_TYPE_ALIASES[raw] || raw
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def terms(database = nil)
|
|
33
|
+
return enum_for(:terms) unless block_given?
|
|
34
|
+
term_irdis.each do |i|
|
|
35
|
+
if database
|
|
36
|
+
term = database.find(i)
|
|
37
|
+
yield term if term
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Opencdd
|
|
4
|
+
class ValueTerm < Opencdd::Entity
|
|
5
|
+
# ── Pure field reads ─────────────────────────────────────────
|
|
6
|
+
# MDC_P022 is :class_ref in REGISTRY but ValueTerm treats it as
|
|
7
|
+
# a raw type-string ("STRING_TYPE", etc.).
|
|
8
|
+
field :enumeration_code, "MDC_P044", :string
|
|
9
|
+
field :definition_class_irdi, "MDC_P021"
|
|
10
|
+
field :data_type, "MDC_P022", :string
|
|
11
|
+
|
|
12
|
+
# ── Computed fields with block-form readers ──────────────────
|
|
13
|
+
# The value-list backref can live under MDC_P018_1, MDC_P045, or
|
|
14
|
+
# a non-standard VALUE_LIST_IRDI key. Try each in turn.
|
|
15
|
+
field(:value_list_irdi, synthetic: true) do
|
|
16
|
+
raw = properties[Opencdd::PropertyIds::MDC_P018_1] ||
|
|
17
|
+
properties[Opencdd::PropertyIds::MDC_P045] ||
|
|
18
|
+
properties["VALUE_LIST_IRDI"]
|
|
19
|
+
Opencdd::IRDI.parse(raw) if raw
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
alias_method :term_code, :enumeration_code
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Opencdd
|
|
4
|
+
class ViewControl < Opencdd::Entity
|
|
5
|
+
# ── Pure field reads ─────────────────────────────────────────
|
|
6
|
+
field :controlled_class_irdis, "EXT_P002"
|
|
7
|
+
field :shown_property_irdis, "EXT_P003"
|
|
8
|
+
# data_object_identifier and time_stamp inherited from Entity base.
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "set"
|
|
4
|
+
|
|
5
|
+
module Opencdd
|
|
6
|
+
class Visitor
|
|
7
|
+
attr_reader :seen
|
|
8
|
+
|
|
9
|
+
def initialize
|
|
10
|
+
@seen = Set.new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def visit_database(database)
|
|
14
|
+
visit_classes(database)
|
|
15
|
+
visit_properties(database)
|
|
16
|
+
visit_units(database)
|
|
17
|
+
visit_value_lists(database)
|
|
18
|
+
visit_value_terms(database)
|
|
19
|
+
visit_relations(database)
|
|
20
|
+
visit_view_controls(database)
|
|
21
|
+
self
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def visit_classes(database)
|
|
25
|
+
each_sorted(database.root_classes) { |k| visit_class(k) }
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def visit_class(klass)
|
|
29
|
+
return if @seen.include?(klass.irdi)
|
|
30
|
+
@seen << klass.irdi
|
|
31
|
+
each_sorted(klass.children) { |c| visit_class(c) }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def visit_properties(database)
|
|
35
|
+
each_sorted(database.properties) { |p| visit_property(p) }
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def visit_units(database)
|
|
39
|
+
each_sorted(database.units) { |u| visit_unit(u) }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def visit_value_lists(database)
|
|
43
|
+
each_sorted(database.value_lists) { |v| visit_value_list(v) }
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def visit_value_terms(database)
|
|
47
|
+
each_sorted(database.value_terms) { |v| visit_value_term(v) }
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def visit_relations(database)
|
|
51
|
+
each_sorted(database.relations) { |r| visit_relation(r) }
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def visit_view_controls(database)
|
|
55
|
+
each_sorted(database.view_controls) { |v| visit_view_control(v) }
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Single source of truth for sort-by-code traversal. Was
|
|
59
|
+
# duplicated as `.sort_by { |x| x.code.to_s }` in 7 methods.
|
|
60
|
+
def each_sorted(entities)
|
|
61
|
+
entities.sort_by { |e| e.code.to_s }.each { |e| yield e }
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def visit_property(prop)
|
|
65
|
+
@seen << prop.irdi if prop.irdi
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def visit_unit(unit)
|
|
69
|
+
@seen << unit.irdi if unit.irdi
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def visit_value_list(vl)
|
|
73
|
+
@seen << vl.irdi if vl.irdi
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def visit_value_term(vt)
|
|
77
|
+
@seen << vt.irdi if vt.irdi
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def visit_relation(rel)
|
|
81
|
+
@seen << rel.irdi if rel.irdi
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def visit_view_control(vc)
|
|
85
|
+
@seen << vc.irdi if vc.irdi
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def reset!
|
|
89
|
+
@seen.clear
|
|
90
|
+
self
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
data/lib/opencdd.rb
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Opencdd
|
|
4
|
+
autoload :VERSION, "opencdd/version"
|
|
5
|
+
|
|
6
|
+
autoload :IRDI, "opencdd/irdi"
|
|
7
|
+
|
|
8
|
+
autoload :PropertyIds, "opencdd/property_ids"
|
|
9
|
+
autoload :AliasTable, "opencdd/alias_table"
|
|
10
|
+
|
|
11
|
+
autoload :MetaClass, "opencdd/meta_class"
|
|
12
|
+
autoload :MetaClasses, "opencdd/meta_class"
|
|
13
|
+
|
|
14
|
+
autoload :ClassType, "opencdd/class_type"
|
|
15
|
+
autoload :DataType, "opencdd/data_type"
|
|
16
|
+
autoload :ValueFormat, "opencdd/value_format"
|
|
17
|
+
autoload :StructuredValues, "opencdd/structured_values"
|
|
18
|
+
|
|
19
|
+
autoload :PropertyDataTypeElement, "opencdd/property_data_element_type"
|
|
20
|
+
autoload :Condition, "opencdd/condition"
|
|
21
|
+
autoload :RelationType, "opencdd/relation_type"
|
|
22
|
+
|
|
23
|
+
autoload :Entity, "opencdd/entity"
|
|
24
|
+
autoload :Klass, "opencdd/klass"
|
|
25
|
+
autoload :Property, "opencdd/property"
|
|
26
|
+
autoload :Unit, "opencdd/unit"
|
|
27
|
+
autoload :ValueList, "opencdd/value_list"
|
|
28
|
+
autoload :ValueTerm, "opencdd/value_term"
|
|
29
|
+
autoload :Relation, "opencdd/relation"
|
|
30
|
+
autoload :ViewControl, "opencdd/view_control"
|
|
31
|
+
|
|
32
|
+
autoload :Database, "opencdd/database"
|
|
33
|
+
autoload :EffectiveProperties, "opencdd/effective_properties"
|
|
34
|
+
autoload :CompositionTree, "opencdd/composition_tree"
|
|
35
|
+
autoload :RelationTree, "opencdd/relation_tree"
|
|
36
|
+
autoload :Reader, "opencdd/reader"
|
|
37
|
+
autoload :ClassTree, "opencdd/class_tree"
|
|
38
|
+
autoload :Visitor, "opencdd/visitor"
|
|
39
|
+
|
|
40
|
+
autoload :Parcel, "opencdd/parcel"
|
|
41
|
+
|
|
42
|
+
autoload :ParseHelpers, "opencdd/parse_helpers"
|
|
43
|
+
|
|
44
|
+
autoload :Validator, "opencdd/validator"
|
|
45
|
+
autoload :InstanceRule, "opencdd/instance_rule"
|
|
46
|
+
autoload :GUID, "opencdd/guid"
|
|
47
|
+
|
|
48
|
+
autoload :Exporters, "opencdd/exporters"
|
|
49
|
+
|
|
50
|
+
autoload :Cddal, "opencdd/cddal"
|
|
51
|
+
|
|
52
|
+
autoload :Codegen, "opencdd/codegen"
|
|
53
|
+
|
|
54
|
+
autoload :Languages, "opencdd/languages"
|
|
55
|
+
|
|
56
|
+
autoload :Model, "opencdd/model"
|
|
57
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: opencdd
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- OpenCDD contributors
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: roo
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '2.10'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '2.10'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rubyzip
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '2.3'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '2.3'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: spreadsheet
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '1.3'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '1.3'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: caxlsx
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '4.5'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '4.5'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: base64
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0.2'
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0.2'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: bigdecimal
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '3.1'
|
|
89
|
+
type: :runtime
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '3.1'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: csv
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - "~>"
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '3.3'
|
|
103
|
+
type: :runtime
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - "~>"
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '3.3'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: lutaml-model
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0.8'
|
|
117
|
+
type: :runtime
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0.8'
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: lutaml-store
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "~>"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0.2'
|
|
131
|
+
type: :runtime
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - "~>"
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0.2'
|
|
138
|
+
- !ruby/object:Gem::Dependency
|
|
139
|
+
name: rake
|
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - "~>"
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '13.0'
|
|
145
|
+
type: :development
|
|
146
|
+
prerelease: false
|
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - "~>"
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '13.0'
|
|
152
|
+
- !ruby/object:Gem::Dependency
|
|
153
|
+
name: rspec
|
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - "~>"
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '3.13'
|
|
159
|
+
type: :development
|
|
160
|
+
prerelease: false
|
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - "~>"
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '3.13'
|
|
166
|
+
- !ruby/object:Gem::Dependency
|
|
167
|
+
name: rspec-its
|
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
|
169
|
+
requirements:
|
|
170
|
+
- - "~>"
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '1.3'
|
|
173
|
+
type: :development
|
|
174
|
+
prerelease: false
|
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
176
|
+
requirements:
|
|
177
|
+
- - "~>"
|
|
178
|
+
- !ruby/object:Gem::Version
|
|
179
|
+
version: '1.3'
|
|
180
|
+
- !ruby/object:Gem::Dependency
|
|
181
|
+
name: racc
|
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
|
183
|
+
requirements:
|
|
184
|
+
- - "~>"
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: '1.7'
|
|
187
|
+
type: :development
|
|
188
|
+
prerelease: false
|
|
189
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
190
|
+
requirements:
|
|
191
|
+
- - "~>"
|
|
192
|
+
- !ruby/object:Gem::Version
|
|
193
|
+
version: '1.7'
|
|
194
|
+
description: |
|
|
195
|
+
Cdd is a pure-Ruby library that models the IEC Common Data Dictionary
|
|
196
|
+
(IEC 61360 / CDD ontology), supports power-type semantics where instances
|
|
197
|
+
can themselves be used as classes, and imports the Parcel Excel workbook
|
|
198
|
+
format (both ParcelMaker .xlsx and the legacy 6-file .xls export layout)
|
|
199
|
+
into a navigable in-memory database.
|
|
200
|
+
email:
|
|
201
|
+
- cdd@opencdd.org
|
|
202
|
+
executables: []
|
|
203
|
+
extensions: []
|
|
204
|
+
extra_rdoc_files: []
|
|
205
|
+
files:
|
|
206
|
+
- CLAUDE.md
|
|
207
|
+
- README.md
|
|
208
|
+
- bin/lint-no-raw-mdc
|
|
209
|
+
- lib/cdd.rb
|
|
210
|
+
- lib/opencdd.rb
|
|
211
|
+
- lib/opencdd/alias_table.rb
|
|
212
|
+
- lib/opencdd/cddal.rb
|
|
213
|
+
- lib/opencdd/cddal/ast.rb
|
|
214
|
+
- lib/opencdd/cddal/builder.rb
|
|
215
|
+
- lib/opencdd/cddal/fetcher.rb
|
|
216
|
+
- lib/opencdd/cddal/fetcher/in_memory.rb
|
|
217
|
+
- lib/opencdd/cddal/fetcher/net_http.rb
|
|
218
|
+
- lib/opencdd/cddal/generated_parser.rb
|
|
219
|
+
- lib/opencdd/cddal/lexer.rb
|
|
220
|
+
- lib/opencdd/cddal/parser.rb
|
|
221
|
+
- lib/opencdd/cddal/resolver.rb
|
|
222
|
+
- lib/opencdd/cddal/serializer.rb
|
|
223
|
+
- lib/opencdd/cddal/value_serializer.rb
|
|
224
|
+
- lib/opencdd/class_tree.rb
|
|
225
|
+
- lib/opencdd/class_type.rb
|
|
226
|
+
- lib/opencdd/codegen.rb
|
|
227
|
+
- lib/opencdd/codegen/ts.rb
|
|
228
|
+
- lib/opencdd/composition_tree.rb
|
|
229
|
+
- lib/opencdd/condition.rb
|
|
230
|
+
- lib/opencdd/data_type.rb
|
|
231
|
+
- lib/opencdd/database.rb
|
|
232
|
+
- lib/opencdd/effective_properties.rb
|
|
233
|
+
- lib/opencdd/entity.rb
|
|
234
|
+
- lib/opencdd/entity/field_reader.rb
|
|
235
|
+
- lib/opencdd/entity/field_registry.rb
|
|
236
|
+
- lib/opencdd/entity/version_history.rb
|
|
237
|
+
- lib/opencdd/exporters.rb
|
|
238
|
+
- lib/opencdd/exporters/json.rb
|
|
239
|
+
- lib/opencdd/exporters/mermaid.rb
|
|
240
|
+
- lib/opencdd/exporters/yaml.rb
|
|
241
|
+
- lib/opencdd/guid.rb
|
|
242
|
+
- lib/opencdd/instance_rule.rb
|
|
243
|
+
- lib/opencdd/irdi.rb
|
|
244
|
+
- lib/opencdd/klass.rb
|
|
245
|
+
- lib/opencdd/languages.rb
|
|
246
|
+
- lib/opencdd/meta_class.rb
|
|
247
|
+
- lib/opencdd/model.rb
|
|
248
|
+
- lib/opencdd/model/entity_store.rb
|
|
249
|
+
- lib/opencdd/model/yaml_database.rb
|
|
250
|
+
- lib/opencdd/model/yaml_entity.rb
|
|
251
|
+
- lib/opencdd/parcel.rb
|
|
252
|
+
- lib/opencdd/parcel/csv_reader.rb
|
|
253
|
+
- lib/opencdd/parcel/csv_writer.rb
|
|
254
|
+
- lib/opencdd/parcel/entity_manifest.rb
|
|
255
|
+
- lib/opencdd/parcel/flat_dir_reader.rb
|
|
256
|
+
- lib/opencdd/parcel/layout_detector.rb
|
|
257
|
+
- lib/opencdd/parcel/metadata.rb
|
|
258
|
+
- lib/opencdd/parcel/referenced_irdis.rb
|
|
259
|
+
- lib/opencdd/parcel/scrape_verifier.rb
|
|
260
|
+
- lib/opencdd/parcel/selector.rb
|
|
261
|
+
- lib/opencdd/parcel/sharded_dir_reader.rb
|
|
262
|
+
- lib/opencdd/parcel/sheet.rb
|
|
263
|
+
- lib/opencdd/parcel/sheet_emitter.rb
|
|
264
|
+
- lib/opencdd/parcel/sheet_schema.rb
|
|
265
|
+
- lib/opencdd/parcel/workbook.rb
|
|
266
|
+
- lib/opencdd/parcel/workbook_reader.rb
|
|
267
|
+
- lib/opencdd/parcel/writer.rb
|
|
268
|
+
- lib/opencdd/parse_helpers.rb
|
|
269
|
+
- lib/opencdd/property.rb
|
|
270
|
+
- lib/opencdd/property_data_element_type.rb
|
|
271
|
+
- lib/opencdd/property_ids.rb
|
|
272
|
+
- lib/opencdd/reader.rb
|
|
273
|
+
- lib/opencdd/relation.rb
|
|
274
|
+
- lib/opencdd/relation_tree.rb
|
|
275
|
+
- lib/opencdd/relation_type.rb
|
|
276
|
+
- lib/opencdd/structured_values.rb
|
|
277
|
+
- lib/opencdd/unit.rb
|
|
278
|
+
- lib/opencdd/validator.rb
|
|
279
|
+
- lib/opencdd/validator/class_reference_rule.rb
|
|
280
|
+
- lib/opencdd/validator/condition_rule.rb
|
|
281
|
+
- lib/opencdd/validator/data_type_rule.rb
|
|
282
|
+
- lib/opencdd/validator/enum_rule.rb
|
|
283
|
+
- lib/opencdd/validator/format_rule.rb
|
|
284
|
+
- lib/opencdd/validator/hierarchy_rule.rb
|
|
285
|
+
- lib/opencdd/validator/irdi_rule.rb
|
|
286
|
+
- lib/opencdd/validator/mandatory_rule.rb
|
|
287
|
+
- lib/opencdd/validator/pattern_rule.rb
|
|
288
|
+
- lib/opencdd/validator/reference_rule.rb
|
|
289
|
+
- lib/opencdd/validator/rule.rb
|
|
290
|
+
- lib/opencdd/validator/runner.rb
|
|
291
|
+
- lib/opencdd/validator/set_rule.rb
|
|
292
|
+
- lib/opencdd/validator/synonym_rule.rb
|
|
293
|
+
- lib/opencdd/validator/type_rule.rb
|
|
294
|
+
- lib/opencdd/validator/uniqueness_rule.rb
|
|
295
|
+
- lib/opencdd/value_format.rb
|
|
296
|
+
- lib/opencdd/value_list.rb
|
|
297
|
+
- lib/opencdd/value_term.rb
|
|
298
|
+
- lib/opencdd/version.rb
|
|
299
|
+
- lib/opencdd/view_control.rb
|
|
300
|
+
- lib/opencdd/visitor.rb
|
|
301
|
+
homepage: https://github.com/opencdd/opencdd-ruby
|
|
302
|
+
licenses:
|
|
303
|
+
- MIT
|
|
304
|
+
metadata:
|
|
305
|
+
homepage_uri: https://github.com/opencdd/opencdd-ruby
|
|
306
|
+
source_code_uri: https://github.com/opencdd/opencdd-ruby
|
|
307
|
+
changelog_uri: https://github.com/opencdd/opencdd-ruby/releases
|
|
308
|
+
rdoc_options: []
|
|
309
|
+
require_paths:
|
|
310
|
+
- lib
|
|
311
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
312
|
+
requirements:
|
|
313
|
+
- - ">="
|
|
314
|
+
- !ruby/object:Gem::Version
|
|
315
|
+
version: '3.1'
|
|
316
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
|
+
requirements:
|
|
318
|
+
- - ">="
|
|
319
|
+
- !ruby/object:Gem::Version
|
|
320
|
+
version: '0'
|
|
321
|
+
requirements: []
|
|
322
|
+
rubygems_version: 3.6.9
|
|
323
|
+
specification_version: 4
|
|
324
|
+
summary: Ruby model and Parcel-format importer for the IEC Common Data Dictionary
|
|
325
|
+
test_files: []
|