ttl2html 0.2.3 → 0.2.8

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: f61674c828bb05145bfc847961c29c8cdbfd7bbc1c72ea0f824cb96b5cc91fb7
4
- data.tar.gz: 0e42ed788ef65a35b7ec0b2a236a8ff4dcaf36abf7d84e6e8ad62ab3b5d17307
3
+ metadata.gz: 7f3895e8f7c7544e6ef6bcb0cf966787d51a49de0db77a6a0a0b72a70a54b9cb
4
+ data.tar.gz: 7f33f34c40179683953a920a516712051c7a2e3078c4220cdbf21e7df14dbdbb
5
5
  SHA512:
6
- metadata.gz: 8c8fe5054f90d912cc4c258b551a35ca9c657ae569fcf9358aa9552066553650d1975849f57433280beec638a920840bffd5dd6d8dd08b46cf16bce45b12bfb4
7
- data.tar.gz: bacc84f374426cc75b4f5a78c7231e98a19b5ba3bed22784e14a5390f449b72e1e8617d376d430cea646b513ef44727e6f822dd44bc43c66c8e24d0065cb0ab8
6
+ metadata.gz: 86c6e71196827df531740ecb603889b99bbc44118ed106e4831472ccde702f162648cdcafd3eb43d19ebb9cf9dd6c3ec379cb68b55d78eca585d17fbe605ebe7
7
+ data.tar.gz: a708b14927d1a8332aa48004f7f61f8ba379623556d3348e356f9dd72c0c8641b9e14f7ccf33c29be51f121d8c300da0e7cce780585ed0fd9a15d75de4b66fc6
@@ -7,5 +7,6 @@ if ARGV.size == 0
7
7
  exit
8
8
  end
9
9
 
10
- turtle = XLSX2Shape.xlsx2shape(ARGV[0])
10
+ include XLSX2Shape
11
+ turtle = xlsx2shape(ARGV[0])
11
12
  puts turtle
@@ -126,6 +126,8 @@ module TTL2HTML
126
126
  param[:title] = template.get_title(v)
127
127
  if @data.keys.find{|e| e.start_with?(uri + "/") }
128
128
  file = uri + "/index.html"
129
+ elsif uri.end_with?("/")
130
+ file = uri + "index.html"
129
131
  else
130
132
  file = uri + ".html"
131
133
  end
@@ -150,7 +152,7 @@ module TTL2HTML
150
152
  template = Template.new("index.html.erb", @config)
151
153
  param = @config.dup
152
154
  param[:data_global] = @data
153
- subjects.each do |subject|
155
+ subjects.sort.each do |subject|
154
156
  param[:index_data] ||= []
155
157
  param[:index_data] << subject.to_s
156
158
  end
@@ -128,7 +128,7 @@ module TTL2HTML
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
+ http://www.w3.org/2000/01/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
@@ -1 +1 @@
1
- TTL2HTML::VERSION = "0.2.3"
1
+ TTL2HTML::VERSION = "0.2.8"
@@ -5,12 +5,12 @@ require "roo"
5
5
  module XLSX2Shape
6
6
  def xlsx2shape(filename)
7
7
  shapes = {}
8
- prefix = { "sh:": "http://www.w3.org/ns/shacl#" }
8
+ prefix = { sh: "http://www.w3.org/ns/shacl#" }
9
9
  xlsx = Roo::Excelx.new(filename)
10
10
  xlsx.each_with_pagename do |name, sheet|
11
11
  if name =~ /\Aprefix\z/i
12
12
  sheet.each do |row|
13
- prefix[row[0]] = row[1] if not row[1].empty?
13
+ prefix[row[0].to_s.intern] = row[1] if not row[1].empty?
14
14
  end
15
15
  else
16
16
  headers = sheet.row(1)
@@ -59,8 +59,8 @@ module XLSX2Shape
59
59
  end
60
60
  end
61
61
  result = ""
62
- prefix.sort.each do |prefix, val|
63
- result << "@prefix #{prefix} <#{val}>.\n"
62
+ prefix.sort_by{|k,v| [k,v] }.each do |prefix, val|
63
+ result << "@prefix #{prefix}: <#{val}>.\n"
64
64
  end
65
65
  shapes.sort_by{|uri, val| uri }.each do |uri, val|
66
66
  result << "\n"
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.3
4
+ version: 0.2.8
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-21 00:00:00.000000000 Z
11
+ date: 2020-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri