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 +4 -4
- data/lib/ttl2html/template.rb +3 -3
- data/lib/ttl2html/version.rb +1 -1
- data/lib/ttl2html.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11d3e9f65c26b03aa9b49cee0175b091b61c976849627afe46c5c61a672a14c0
|
4
|
+
data.tar.gz: b3e34b67a54c93a2c86fe5ddd0678c59ac4289d924b8dd17baa8b74f05bc86e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50bb8772289268c78c3d9015beea1840dd8937301917cff752b401b361e86a3ee9514d06a86d7d6aabb4a14bfa61bf7a1e583ab05f5a19e010ac3913edf25284
|
7
|
+
data.tar.gz: 0f179ddaf87be9f28a8d94201027b73a1ce08bc43a62d5afa7cfc79c2933ea6a2383634e46d788b1c578bc97d2810fdd6940052907031a95fafc1524571a2dc3
|
data/lib/ttl2html/template.rb
CHANGED
@@ -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
|
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
|
-
|
139
|
+
default_title
|
140
140
|
end
|
141
141
|
def get_language_literal(object)
|
142
142
|
if object.respond_to? :has_key?
|
data/lib/ttl2html/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TTL2HTML::VERSION = "0.2.
|
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
|
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.
|
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-
|
11
|
+
date: 2020-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|