ontopia-tldr 0.0.1-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,61 @@
1
+ body {
2
+ font-family: sans-serif;
3
+ }
4
+
5
+ th, td {
6
+ vertical-align: top;
7
+ }
8
+
9
+ #content td strong {
10
+ font-family: monospace;
11
+ }
12
+
13
+ #content td.label {
14
+ font-family: monospace;
15
+ text-align: right;
16
+ }
17
+
18
+ #header {
19
+ margin: 1em 0;
20
+ }
21
+
22
+ #header form {
23
+ display: inline;
24
+ }
25
+
26
+ #content form {
27
+ float: left;
28
+ width: 45%;
29
+ }
30
+
31
+ #content form > pre {
32
+ margin-top: 0;
33
+ }
34
+
35
+ #content form + div {
36
+ margin-left: 45%;
37
+ padding-left: 1em;
38
+ border-left: 1px solid black;
39
+ }
40
+
41
+ .error {
42
+ color: red;
43
+ }
44
+
45
+ .debug {
46
+ color: gray;
47
+ font-size: 80%;
48
+ overflow: auto;
49
+ }
50
+
51
+ #footer {
52
+ border-style: solid;
53
+ border-color: black;
54
+ border-width: 1px 0;
55
+ padding: 4px;
56
+ margin-top: 2em;
57
+ }
58
+
59
+ #footer a {
60
+ font-weight: bold;
61
+ }
@@ -0,0 +1,24 @@
1
+ var _sample = {};
2
+
3
+ function sample(name) {
4
+ var element = document.getElementsByName(name)[0];
5
+ if (element && element.value === '') {
6
+ element.value = _sample[name];
7
+ element.focus();
8
+ }
9
+ }
10
+
11
+ function filter(value, name) {
12
+ var ul = document.getElementById(name);
13
+ if (ul) {
14
+ var lis = ul.getElementsByTagName('li');
15
+ for (var i = 0, l = lis.length; i < l; i++) {
16
+ var li = lis[i];
17
+ var a = li.getElementsByTagName('a')[0];
18
+ if (a) {
19
+ var t = a.innerHTML + '|' + a.href.split('/').pop();
20
+ li.style.display = t.toLowerCase().indexOf(value.toLowerCase()) < 0 ? 'none' : '';
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,52 @@
1
+ #--
2
+ ###############################################################################
3
+ # #
4
+ # ontopia-tldr -- Tolog Document Retrieval with Ontopia. #
5
+ # #
6
+ # Copyright (C) 2013 Jens Wille #
7
+ # #
8
+ # ontopia-tldr is free software: you can redistribute it and/or modify it #
9
+ # under the terms of the GNU Affero General Public License as published by #
10
+ # the Free Software Foundation, either version 3 of the License, or (at your #
11
+ # option) any later version. #
12
+ # #
13
+ # ontopia-tldr is distributed in the hope that it will be useful, but WITHOUT #
14
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
15
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License #
16
+ # for more details. #
17
+ # #
18
+ # You should have received a copy of the GNU Affero General Public License #
19
+ # along with ontopia-tldr. If not, see <http://www.gnu.org/licenses/>. #
20
+ # #
21
+ ###############################################################################
22
+ #++
23
+
24
+ module Ontopia
25
+ class TLDR
26
+
27
+ module Version
28
+
29
+ MAJOR = 0
30
+ MINOR = 0
31
+ TINY = 1
32
+
33
+ class << self
34
+
35
+ # Returns array representation.
36
+ def to_a
37
+ [MAJOR, MINOR, TINY]
38
+ end
39
+
40
+ # Short-cut for version string.
41
+ def to_s
42
+ to_a.join('.')
43
+ end
44
+
45
+ end
46
+
47
+ end
48
+
49
+ VERSION = Version.to_s
50
+
51
+ end
52
+ end
@@ -0,0 +1,14 @@
1
+ <table>
2
+ <% for k, v in @document %>
3
+ <tr>
4
+ <td class="label"><%=h k %>:</td>
5
+ <td>
6
+ <% if settings.topic_keys.include?(k) %>
7
+ <%= Array(v).map { |i| link_to_topic(i) }.join(' | ') %>
8
+ <% else %>
9
+ <%=h Array(v).join(' | ') %>
10
+ <% end %>
11
+ </td>
12
+ </tr>
13
+ <% end %>
14
+ </table>
@@ -0,0 +1 @@
1
+ <p><%= render_documents %></p>
@@ -0,0 +1,52 @@
1
+ <script type="text/javascript">
2
+ <% for name, value in settings.tolog_sample %>
3
+ _sample['<%=h name %>'] = decodeURI('<%= value.tr("'", '"').gsub("\n", '%0A') %>');
4
+ <% end %>
5
+ </script>
6
+
7
+ <form action="<%= url('/') %>" method="POST">
8
+ <pre><%= h(settings.tolog) % [
9
+ %Q{<strong>#{h(settings.title_rules)}</strong>},
10
+ %Q{<strong>$</strong><input type="text" name="p" size="4" value="#{h(@param || settings.title_topic)}" />},
11
+ %Q{<strong>#{h(settings.title_query)}</strong>}
12
+ ] %></pre>
13
+ <table>
14
+ <tr>
15
+ <td colspan="2">
16
+ <strong><%=h settings.title_query %></strong> [<a href="javascript:sample('q')">sample</a>]:<br />
17
+ <textarea name="q" rows="10" cols="50"><%=h @query %></textarea>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td colspan="2">
22
+ <strong><%=h settings.title_rules %></strong> [<a href="javascript:sample('r')">sample</a>]:<br />
23
+ <textarea name="r" rows="10" cols="50"><%=h @rules %></textarea>
24
+ </td>
25
+ </tr>
26
+ <tr>
27
+ <td>
28
+ [ <a href="http://ontopia.net/omnigator/docs/query/tutorial.html" target="_blank">tolog tutorial</a> |
29
+ <a href="http://ontopia.net/omnigator/docs/query/predicate-reference.html" target="_blank">tolog reference</a> ]
30
+ </td>
31
+ <td align="right">
32
+ <input type="submit" />
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </form>
37
+
38
+ <% if @query && !@error %>
39
+ <div>
40
+ <% if @topics %>
41
+ <p>Topics (<%= @topics.size %>): <%= render_topics %></p>
42
+
43
+ <% if @documents %>
44
+ <p>Documents (<%= @documents.size %>): <%= render_documents %></p>
45
+ <% else %>
46
+ <p class="error">No matching documents found!</p>
47
+ <% end %>
48
+ <% else %>
49
+ <p class="error">No matching topics found!</p>
50
+ <% end %>
51
+ </div>
52
+ <% end %>
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <title><%=h title = [settings.title, @title].compact.join(' : ') %></title>
8
+ <link rel="stylesheet" type="text/css" href="<%= url('/site.css') %>" />
9
+ <script type="text/javascript" src="<%= url('/site.js') %>"></script>
10
+ </head>
11
+ <body>
12
+ <h1><%=h title %></h1>
13
+
14
+ <div id="header">
15
+ <%= _a 'Topics', href: url('/topics') %> (<%= _a 'XTM', href: url('/xtm') %>) |
16
+ <%= _a 'Documents', href: url('/documents') %> (<%= _a 'DBM', href: url('/dbm') %>) |
17
+ <%= _a 'New query', href: url('/') %>
18
+ <% if @filter && !instance_variable_get("@#{@filter}").empty? %>
19
+ | <form><input onkeyup="filter(this.value, '<%=h @filter %>');" placeholder="Filter <%=h @filter %>..." /></form>
20
+ <% end %>
21
+ </div>
22
+
23
+ <% if @error %>
24
+ <p class="error"><%=h @error %></p>
25
+ <% end %>
26
+
27
+ <div id="content"><%= yield %></div>
28
+
29
+ <br style="clear: both" />
30
+
31
+ <div id="footer">
32
+ <em>powered by</em> <a href="http://ontopia.net">Ontopia</a>
33
+ <em>and</em> <a href="http://sinatrarb.com">Sinatra</a>
34
+ -- <a href="http://blackwinter.github.com/ontopia-tldr">ontopia-tldr</a>
35
+ <strong>v<%= Ontopia::TLDR::VERSION %></strong>
36
+ </div>
37
+ </body>
38
+ </html>
@@ -0,0 +1,15 @@
1
+ <% unless @documents.empty? %>
2
+ <p>Documents (<%= @documents.size %>): <%= render_documents %></p>
3
+ <% end %>
4
+
5
+ <% unless @relations.empty? %>
6
+ <p>Relations (<%= @relations.size %>): <%= render_topics_hash(@relations) %></p>
7
+ <% end %>
8
+
9
+ <% unless @roles.empty? %>
10
+ <p>Roles (<%= @roles.size %>): <%= render_topics_hash(@roles) %></p>
11
+ <% end %>
12
+
13
+ <% unless @types.empty? %>
14
+ <p>Types (<%= @types.size %>): <%= render_topics_hash(@types) %></p>
15
+ <% end %>
@@ -0,0 +1 @@
1
+ <p><%= render_topics %></p>
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ontopia-tldr
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: java
7
+ authors:
8
+ - Jens Wille
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: json
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ none: false
22
+ requirement: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ none: false
28
+ prerelease: false
29
+ type: :runtime
30
+ - !ruby/object:Gem::Dependency
31
+ name: ontopia-topicmaps
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ none: false
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ none: false
44
+ prerelease: false
45
+ type: :runtime
46
+ - !ruby/object:Gem::Dependency
47
+ name: ruby-nuggets
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ none: false
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ none: false
60
+ prerelease: false
61
+ type: :runtime
62
+ - !ruby/object:Gem::Dependency
63
+ name: sinatra
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ none: false
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ none: false
76
+ prerelease: false
77
+ type: :runtime
78
+ description: Tolog Document Retrieval with Ontopia.
79
+ email: jens.wille@gmail.com
80
+ executables: []
81
+ extensions: []
82
+ extra_rdoc_files:
83
+ - README
84
+ - COPYING
85
+ - ChangeLog
86
+ files:
87
+ - lib/ontopia-tldr.rb
88
+ - lib/ontopia/tldr.rb
89
+ - lib/ontopia/tldr/version.rb
90
+ - config.ru.sample
91
+ - lib/ontopia/tldr/public/site.css
92
+ - lib/ontopia/tldr/public/site.js
93
+ - lib/ontopia/tldr/views/document.erb
94
+ - lib/ontopia/tldr/views/documents.erb
95
+ - lib/ontopia/tldr/views/index.erb
96
+ - lib/ontopia/tldr/views/layout.erb
97
+ - lib/ontopia/tldr/views/topic.erb
98
+ - lib/ontopia/tldr/views/topics.erb
99
+ - COPYING
100
+ - ChangeLog
101
+ - README
102
+ - Rakefile
103
+ homepage: http://github.com/blackwinter/ontopia-tldr
104
+ licenses:
105
+ - AGPL
106
+ post_install_message:
107
+ rdoc_options:
108
+ - --charset
109
+ - UTF-8
110
+ - --line-numbers
111
+ - --all
112
+ - --title
113
+ - ontopia-tldr Application documentation (v0.0.1)
114
+ - --main
115
+ - README
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ none: false
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ none: false
130
+ requirements: []
131
+ rubyforge_project:
132
+ rubygems_version: 1.8.24
133
+ signing_key:
134
+ specification_version: 3
135
+ summary: Tolog Document Retrieval with Ontopia.
136
+ test_files: []