ttl2html 2.1.1 → 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 +14 -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
- 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: 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
@@ -393,6 +393,7 @@ module TTL2HTML
|
|
393
393
|
subset: subset,
|
394
394
|
link: link,
|
395
395
|
license: extract_license(data),
|
396
|
+
derivedfrom: extract_derivedfrom(data),
|
396
397
|
}
|
397
398
|
end
|
398
399
|
def extract_versions
|
@@ -415,6 +416,17 @@ module TTL2HTML
|
|
415
416
|
end
|
416
417
|
versions.sort_by{|v| [ v[:date], v[:version] ] }
|
417
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
|
418
430
|
def extract_license(data)
|
419
431
|
license = {}
|
420
432
|
if data["http://purl.org/dc/terms/license"]
|
@@ -440,6 +452,7 @@ module TTL2HTML
|
|
440
452
|
data = @data[toplevel.to_s]
|
441
453
|
if toplevel
|
442
454
|
license = extract_license(data)
|
455
|
+
derivedfrom = extract_derivedfrom(data)
|
443
456
|
if data["http://purl.org/dc/terms/publisher"]
|
444
457
|
publisher_data = @data[data["http://purl.org/dc/terms/publisher"].first]
|
445
458
|
email = publisher_data["http://xmlns.com/foaf/0.1/mbox"]&.first
|
@@ -467,6 +480,7 @@ module TTL2HTML
|
|
467
480
|
license: license,
|
468
481
|
contact: contact,
|
469
482
|
endpoint: endpoint,
|
483
|
+
derivedfrom: derivedfrom,
|
470
484
|
}
|
471
485
|
end
|
472
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">
|
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
|