ttl2html 0.2.0 → 0.2.1

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: fbbc4da0cfa20d2803025a5273b8399a1376af7e6e2a181cad79eaba19e7da9f
4
- data.tar.gz: 6962165c275071e94c34152e6474777f94f46f196fb1b04804b3ea17d6a0c8c5
3
+ metadata.gz: 11d3e9f65c26b03aa9b49cee0175b091b61c976849627afe46c5c61a672a14c0
4
+ data.tar.gz: b3e34b67a54c93a2c86fe5ddd0678c59ac4289d924b8dd17baa8b74f05bc86e9
5
5
  SHA512:
6
- metadata.gz: 2129bdefbb7b498a06301479638c96d1d35a67a8812a28202d0fc3eae1a706e393433b684f0e629c7cc0a2a7ba8e05d3cf5caa1a51e10731a9b0145c009af7b1
7
- data.tar.gz: 5e5e04ce0c0f2e1e8434cba7ac54a146eb23fb00ab39e007f4c78146f78cd1ddda4bdd89ae7d168ddb831c935b4ff3bde306e9f274c0477b67e9e7b1c49b0d3c
6
+ metadata.gz: 50bb8772289268c78c3d9015beea1840dd8937301917cff752b401b361e86a3ee9514d06a86d7d6aabb4a14bfa61bf7a1e583ab05f5a19e010ac3913edf25284
7
+ data.tar.gz: 0f179ddaf87be9f28a8d94201027b73a1ce08bc43a62d5afa7cfc79c2933ea6a2383634e46d788b1c578bc97d2810fdd6940052907031a95fafc1524571a2dc3
@@ -123,12 +123,12 @@ module TTL2HTML
123
123
  dest_uri
124
124
  end
125
125
  end
126
- def get_title(data)
126
+ def get_title(data, default_title = "no title")
127
127
  if @param[:title_property] and data[@param[:title_property]]
128
128
  return get_language_literal(data[@param[:title_property]])
129
129
  end
130
130
  %w(
131
- https://www.w3.org/TR/rdf-schema/#label
131
+ https://www.w3.org/TR/rdf-schema#label
132
132
  http://purl.org/dc/terms/title
133
133
  http://purl.org/dc/elements/1.1/title
134
134
  http://schema.org/name
@@ -136,7 +136,7 @@ module TTL2HTML
136
136
  ).each do |property|
137
137
  return get_language_literal(data[property]) if data[property]
138
138
  end
139
- "no title"
139
+ default_title
140
140
  end
141
141
  def get_language_literal(object)
142
142
  if object.respond_to? :has_key?
@@ -1 +1 @@
1
- TTL2HTML::VERSION = "0.2.0"
1
+ TTL2HTML::VERSION = "0.2.1"
data/lib/ttl2html.rb CHANGED
@@ -170,8 +170,9 @@ module TTL2HTML
170
170
  shapes.subjects.each do |subject|
171
171
  label = nil
172
172
  target_class = @data[subject.to_s]["http://www.w3.org/ns/shacl#targetClass"]
173
- if target_class and @data[target_class.first]
174
- label = template.get_title(@data[target_class.first])
173
+ if target_class
174
+ label = template.get_title(@data[target_class.first], nil) if @data[target_class.first]
175
+ label = template.format_property(target_class.first) if label.nil?
175
176
  else
176
177
  label = template.get_title(@data[subject.to_s])
177
178
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttl2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masao Takaku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-18 00:00:00.000000000 Z
11
+ date: 2020-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri