ttl2html 2.1.0 → 2.1.2
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/lib/ttl2html/version.rb +1 -1
- data/lib/ttl2html.rb +15 -0
- data/locales/en.yml +4 -2
- data/locales/ja.yml +4 -2
- data/templates/dataset.html.erb +5 -0
- data/templates/index.html.erb +6 -1
- data/templates/shape-table.html.erb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2eebcb6951620e22dbb1253cdba6859065c7ced1c0f210209ccdb2e76a5609b
|
4
|
+
data.tar.gz: 704300fa50a6be13a99fb03eca1f55ca3375777858ad39949526bc66d0aa1631
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0ab3fce6eeab88af14ca4eea3b8269dfaaf4afb77999a0558935dcbc8d85ccb8c646f1b2a9f283d70c549ebf6bebcd62252b4ae675797b43f35d51fc56e48f1
|
7
|
+
data.tar.gz: 3e17715b402b585fd5d24bae0f813fbeeedaadfe44f9a0e66c46f4c8fd6da122a13eb9b416fa9c95481552a001a5df0a399ef73a0b9e9561ef373a6fb8a61c3e
|
data/lib/ttl2html/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TTL2HTML::VERSION = "2.1.
|
1
|
+
TTL2HTML::VERSION = "2.1.2"
|
data/lib/ttl2html.rb
CHANGED
@@ -126,6 +126,7 @@ module TTL2HTML
|
|
126
126
|
|
127
127
|
def each_data(label = :each_data)
|
128
128
|
progressbar_options = {
|
129
|
+
output: $stderr,
|
129
130
|
title: label.to_s,
|
130
131
|
format: "(%t) %a %e %P% Processed: %c from %C"
|
131
132
|
}
|
@@ -392,6 +393,7 @@ module TTL2HTML
|
|
392
393
|
subset: subset,
|
393
394
|
link: link,
|
394
395
|
license: extract_license(data),
|
396
|
+
derivedfrom: extract_derivedfrom(data),
|
395
397
|
}
|
396
398
|
end
|
397
399
|
def extract_versions
|
@@ -414,6 +416,17 @@ module TTL2HTML
|
|
414
416
|
end
|
415
417
|
versions.sort_by{|v| [ v[:date], v[:version] ] }
|
416
418
|
end
|
419
|
+
def extract_derivedfrom(data)
|
420
|
+
derivedfrom = {}
|
421
|
+
wasDerivedFrom = data["http://www.w3.org/ns/prov#wasDerivedFrom"]&.first
|
422
|
+
if @data[wasDerivedFrom]
|
423
|
+
derivedfrom = {
|
424
|
+
url: @data[wasDerivedFrom]["http://www.w3.org/1999/02/22-rdf-syntax-ns#value"]&.first,
|
425
|
+
label: @data[wasDerivedFrom]["http://www.w3.org/2000/01/rdf-schema#label"]
|
426
|
+
}
|
427
|
+
end
|
428
|
+
derivedfrom
|
429
|
+
end
|
417
430
|
def extract_license(data)
|
418
431
|
license = {}
|
419
432
|
if data["http://purl.org/dc/terms/license"]
|
@@ -439,6 +452,7 @@ module TTL2HTML
|
|
439
452
|
data = @data[toplevel.to_s]
|
440
453
|
if toplevel
|
441
454
|
license = extract_license(data)
|
455
|
+
derivedfrom = extract_derivedfrom(data)
|
442
456
|
if data["http://purl.org/dc/terms/publisher"]
|
443
457
|
publisher_data = @data[data["http://purl.org/dc/terms/publisher"].first]
|
444
458
|
email = publisher_data["http://xmlns.com/foaf/0.1/mbox"]&.first
|
@@ -466,6 +480,7 @@ module TTL2HTML
|
|
466
480
|
license: license,
|
467
481
|
contact: contact,
|
468
482
|
endpoint: endpoint,
|
483
|
+
derivedfrom: derivedfrom,
|
469
484
|
}
|
470
485
|
end
|
471
486
|
result
|
data/locales/en.yml
CHANGED
@@ -17,14 +17,16 @@ en:
|
|
17
17
|
details: Details
|
18
18
|
inverse_data: Referred resources
|
19
19
|
index:
|
20
|
+
derivedfrom-text: "This dataset is created by editing <a href=\"%{url}\">\"%{label}\"</a>."
|
20
21
|
list: "List of %{resource}"
|
21
22
|
latest-dataset: "Latest dataset"
|
22
23
|
past-versions: "Past versions"
|
23
|
-
license-text: "This dataset is freely usable as <a href=\"%{url}\">%{label}</a
|
24
|
+
license-text: "This dataset is freely usable as <a href=\"%{url}\">%{label}</a>."
|
24
25
|
sparql-endpoint: "SPARQL Endpoint"
|
25
26
|
sparql-endpoint-text: "The SPARQL endpoint for the dataset is available at"
|
26
27
|
dataset:
|
27
|
-
|
28
|
+
derivedfrom-text: "This dataset is created by editing <a href=\"%{url}\">\"%{label}\"</a>."
|
29
|
+
license-text: "This dataset is freely usable as <a href=\"%{url}\">%{label}</a>."
|
28
30
|
layout:
|
29
31
|
rdf-data: RDF data
|
30
32
|
shape-table:
|
data/locales/ja.yml
CHANGED
@@ -17,6 +17,7 @@ ja:
|
|
17
17
|
details: 詳細情報
|
18
18
|
inverse_data: 被参照情報
|
19
19
|
index:
|
20
|
+
derivedfrom-text: "このデータセットは<a href=\"%{url}\">「%{label}」</a>を加工して作成。"
|
20
21
|
list: "%{resource} 一覧"
|
21
22
|
latest-dataset: 最新のデータセット
|
22
23
|
past-versions: 過去の更新履歴
|
@@ -24,7 +25,8 @@ ja:
|
|
24
25
|
sparql-endpoint: "SPARQLエンドポイント"
|
25
26
|
sparql-endpoint-text: "このデータセットに対するSPARQLエンドポイントは以下のURLからアクセスできます"
|
26
27
|
dataset:
|
27
|
-
|
28
|
+
derivedfrom-text: "このデータセットは<a href=\"%{url}\">「%{label}」</a>を加工して作成。"
|
29
|
+
license-text: "<a href=\"%{url}\">%{label}</a>として自由に利用できます。"
|
28
30
|
layout:
|
29
31
|
rdf-data: RDFデータ
|
30
32
|
shape-table:
|
@@ -43,4 +45,4 @@ ja:
|
|
43
45
|
blank-node-or-structure: ブランクノードの内容は以下のいずれかの内容からなる構造を持ちます。
|
44
46
|
triples:
|
45
47
|
inverse_refered: "'%{property}'としての参照元:"
|
46
|
-
blank_node: "空ノード"
|
48
|
+
blank_node: "空ノード"
|
data/templates/dataset.html.erb
CHANGED
@@ -20,6 +20,11 @@
|
|
20
20
|
<%= t("dataset.license-text", label: get_language_literal(param[:license][:label]), url: param[:license][:url]) %>
|
21
21
|
</span>
|
22
22
|
<%- end -%>
|
23
|
+
<%- if not param[:derivedfrom].empty? -%>
|
24
|
+
<span class="derivedfrom">
|
25
|
+
<%= t("dataset.derivedfrom-text", label: get_language_literal(param[:derivedfrom][:label]), url: param[:derivedfrom][:url]) %>
|
26
|
+
</span>
|
27
|
+
<%- end -%>
|
23
28
|
<%- if param[:subset].size > 0 -%>
|
24
29
|
<ul>
|
25
30
|
<%- param[:subset].each do |subset| -%>
|
data/templates/index.html.erb
CHANGED
@@ -24,13 +24,18 @@
|
|
24
24
|
<p><a href="about#versions">» <%=h t("index.past-versions") %></a></p>
|
25
25
|
<%- end -%>
|
26
26
|
<%- if param[:toplevel] and not param[:toplevel][:license].empty? -%>
|
27
|
-
<p>
|
27
|
+
<p class="license">
|
28
28
|
<%- if param[:toplevel][:license][:icon] -%>
|
29
29
|
<a href="<%=h param[:toplevel][:license][:url] %>"><img src="<%=h param[:toplevel][:license][:icon] %>"></a>
|
30
30
|
<%- end -%>
|
31
31
|
<%= t("index.license-text", label: get_language_literal(param[:toplevel][:license][:label]), url: param[:toplevel][:license][:url]) %>
|
32
32
|
</p>
|
33
33
|
<%- end -%>
|
34
|
+
<%- if param[:toplevel] and not param[:toplevel][:derivedfrom].empty? -%>
|
35
|
+
<p class="derivedfrom">
|
36
|
+
<%= t("index.derivedfrom-text", label: get_language_literal(param[:toplevel][:derivedfrom][:label]), url: param[:toplevel][:derivedfrom][:url]) %>
|
37
|
+
</p>
|
38
|
+
<%- end -%>
|
34
39
|
</div>
|
35
40
|
</div>
|
36
41
|
<div class="col-md">
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<%- param[:properties].each do |property| -%>
|
12
12
|
<tr>
|
13
13
|
<%- if property[:nodeKind] == "http://www.w3.org/ns/shacl#BlankNode" -%>
|
14
|
-
<td rowspan="2"><code><%=h property[:shorten_path] %></code></td>
|
14
|
+
<td rowspan="2" class="url"><code><%=h property[:shorten_path] %></code></td>
|
15
15
|
<%- else -%>
|
16
|
-
<td><code><%=h property[:shorten_path] %></code></td>
|
16
|
+
<td class="url"><code><%=h property[:shorten_path] %></code></td>
|
17
17
|
<%- end -%>
|
18
18
|
<td><%= property[:name] %></td>
|
19
19
|
<%- if property[:nodeKind] == "http://www.w3.org/ns/shacl#IRI" -%>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ttl2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masao Takaku
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: nokogiri
|
@@ -43,14 +43,14 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2
|
46
|
+
version: '2'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2
|
53
|
+
version: '2'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: csv
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|