bioportal 2.1
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 +7 -0
- data/.gitignore +3 -0
- data/.ruby-gemset +1 -0
- data/BSD-LICENSE +23 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +30 -0
- data/README.rdoc +11 -0
- data/Rakefile +24 -0
- data/app/helpers/bio_portal_helper.rb +17 -0
- data/app/models/bioportal_concept.rb +39 -0
- data/app/views/bioportal/_bioportal_visualise.html.erb +2 -0
- data/bioportal.gemspec +11 -0
- data/generators/bioportal_migration/USAGE +8 -0
- data/generators/bioportal_migration/bioportal_migration_generator.rb +7 -0
- data/generators/bioportal_migration/templates/migration.rb +16 -0
- data/install.rb +1 -0
- data/lib/bioportal.rb +178 -0
- data/lib/bioportal/engine.rb +5 -0
- data/lib/tasks/bioportal_tasks.rake +4 -0
- data/rdoc/classes/BioPortal.html +112 -0
- data/rdoc/classes/BioPortal/Acts.html +148 -0
- data/rdoc/classes/BioPortal/Acts/ClassMethods.html +160 -0
- data/rdoc/classes/BioPortal/Acts/InstanceMethods.html +325 -0
- data/rdoc/classes/BioPortal/Acts/SingletonMethods.html +105 -0
- data/rdoc/classes/BioPortal/RestAPI.html +489 -0
- data/rdoc/classes/BioPortalHelper.html +334 -0
- data/rdoc/classes/BioportalConcept.html +251 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/BSD-LICENSE.html +134 -0
- data/rdoc/files/README.html +213 -0
- data/rdoc/files/app/helpers/bio_portal_helper_rb.html +108 -0
- data/rdoc/files/app/models/bioportal_concept_rb.html +101 -0
- data/rdoc/files/lib/bioportal_rb.html +112 -0
- data/rdoc/fr_class_index.html +34 -0
- data/rdoc/fr_file_index.html +31 -0
- data/rdoc/fr_method_index.html +53 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/test/bioportal_test.rb +60 -0
- data/test/test_helper.rb +18 -0
- data/uninstall.rb +1 -0
- metadata +84 -0
data/rdoc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Tue, 20 Jul 2010 16:52:45 +0100
|
@@ -0,0 +1,134 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: BSD-LICENSE</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>BSD-LICENSE</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>BSD-LICENSE
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon May 17 15:10:17 +0100 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
Copyright (c) 2009, University of Manchester & HITS gGmbH All rights
|
74
|
+
reserved.
|
75
|
+
</p>
|
76
|
+
<p>
|
77
|
+
Redistribution and use in source and binary forms, with or without
|
78
|
+
modification, are permitted provided that the following conditions are met:
|
79
|
+
</p>
|
80
|
+
<pre>
|
81
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
82
|
+
and the following disclaimer.
|
83
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
84
|
+
and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
85
|
+
* Neither the name of the University of Manchester or EML Research gGmbH,
|
86
|
+
nor the names of its contributors may be used to endorse or promote products
|
87
|
+
derived from this software without specific prior written permission.
|
88
|
+
</pre>
|
89
|
+
<p>
|
90
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
91
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
92
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
93
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
94
|
+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
95
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
96
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
97
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
98
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
99
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
100
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
101
|
+
</p>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<!-- if includes -->
|
113
|
+
|
114
|
+
<div id="section">
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<!-- if method_list -->
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
|
129
|
+
<div id="validator-badges">
|
130
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
</body>
|
134
|
+
</html>
|
@@ -0,0 +1,213 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: README</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>README</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon May 17 15:10:17 +0100 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h1>Bioportal Plugin Documentation</h1>
|
73
|
+
<p>
|
74
|
+
A plugin that supports linking of Models within a RoR application to a
|
75
|
+
Concept and Ontology within the <a
|
76
|
+
href="../classes/BioPortal.html">BioPortal</a>
|
77
|
+
</p>
|
78
|
+
<p>
|
79
|
+
Also includes a Mixin and a Helper to facilitate making use of the Rest API
|
80
|
+
without linking to a Model.
|
81
|
+
</p>
|
82
|
+
<p>
|
83
|
+
More information about <a href="../classes/BioPortal.html">BioPortal</a>,
|
84
|
+
and its Rest API, may be found at:
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
<a href="http://bioportal.bioontology.org">bioportal.bioontology.org</a>/
|
88
|
+
(main Portal)
|
89
|
+
</p>
|
90
|
+
<p>
|
91
|
+
<a
|
92
|
+
href="http://www.bioontology.org/wiki/index.php/BioPortal_REST_services">www.bioontology.org/wiki/index.php/BioPortal_REST_services</a>
|
93
|
+
(Rest services).
|
94
|
+
</p>
|
95
|
+
<h2>Installing the plugin</h2>
|
96
|
+
<p>
|
97
|
+
Install the plugin from <a
|
98
|
+
href="https://sysmo-db.googlecode.com/hg/vendor/plugins/bioportal">sysmo-db.googlecode.com/hg/vendor/plugins/bioportal</a>
|
99
|
+
</p>
|
100
|
+
<p>
|
101
|
+
Since the rails plugin scripts don‘t work happily with Mercurial,
|
102
|
+
until we extract this plugin the simplest way of adding the plugin is as
|
103
|
+
follows:
|
104
|
+
</p>
|
105
|
+
<pre>
|
106
|
+
cd vendor/plugins
|
107
|
+
hg clone https://sysmo-db.googlecode.com/hg/vendor/plugins/bioportal bioportal
|
108
|
+
rm -rf bioportal/.hg/
|
109
|
+
cd -
|
110
|
+
</pre>
|
111
|
+
<p>
|
112
|
+
Generate the database migration by running
|
113
|
+
</p>
|
114
|
+
<pre>
|
115
|
+
./script/generate bioportal_migration
|
116
|
+
</pre>
|
117
|
+
<p>
|
118
|
+
This generates a table that maps to the <a
|
119
|
+
href="../classes/BioportalConcept.html">BioportalConcept</a> entity, though
|
120
|
+
you don‘t need to know about this in your application.
|
121
|
+
</p>
|
122
|
+
<h2>Usage</h2>
|
123
|
+
<h3>Linking to a Model</h3>
|
124
|
+
<p>
|
125
|
+
To link to a model in your RoR application, add the following line to your
|
126
|
+
Model class
|
127
|
+
</p>
|
128
|
+
<pre>
|
129
|
+
class MyThing < ActiveRecord::Base
|
130
|
+
linked_to_bioportal :email=>"fred.bloggs@email.com"
|
131
|
+
...
|
132
|
+
end
|
133
|
+
</pre>
|
134
|
+
<p>
|
135
|
+
adding :email is optional, but recommended as you will be notified of
|
136
|
+
changes to the REST API.
|
137
|
+
</p>
|
138
|
+
<p>
|
139
|
+
You can also use :base_url to indicate a different deployment of <a
|
140
|
+
href="../classes/BioPortal.html">BioPortal</a> than the default, which is
|
141
|
+
<a
|
142
|
+
href="http://rest.bioontology.org/bioportal">rest.bioontology.org/bioportal</a>/
|
143
|
+
</p>
|
144
|
+
<p>
|
145
|
+
This then provides your model with the attributes:
|
146
|
+
</p>
|
147
|
+
<p>
|
148
|
+
ontology_id ontology_version_id concept_uri
|
149
|
+
</p>
|
150
|
+
<p>
|
151
|
+
which once set allows you to call the method concept to retreive
|
152
|
+
information about that concept, such as its synonyms, parents and children.
|
153
|
+
</p>
|
154
|
+
<p>
|
155
|
+
and you can also call the method ‘ontology’ to reteive
|
156
|
+
information about the ontology.
|
157
|
+
</p>
|
158
|
+
<p>
|
159
|
+
More information about this can be found in the API documentation.
|
160
|
+
</p>
|
161
|
+
<h3>Using the REST API stand-alone</h3>
|
162
|
+
<p>
|
163
|
+
by adding the include
|
164
|
+
</p>
|
165
|
+
<pre>
|
166
|
+
include BioPortal::RestAPI
|
167
|
+
</pre>
|
168
|
+
<p>
|
169
|
+
you can find out more by reading <a
|
170
|
+
href="../classes/BioPortal/RestAPI.html">BioPortal::RestAPI</a>
|
171
|
+
</p>
|
172
|
+
<h3>View Helpers</h3>
|
173
|
+
<p>
|
174
|
+
Some view helpers are automatically injected into your application and you
|
175
|
+
don‘t need to do anything to use them.
|
176
|
+
</p>
|
177
|
+
<p>
|
178
|
+
You can find out more about these by reading about <a
|
179
|
+
href="../classes/BioPortalHelper.html">BioPortalHelper</a>
|
180
|
+
</p>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
<!-- if includes -->
|
192
|
+
|
193
|
+
<div id="section">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<!-- if method_list -->
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div id="validator-badges">
|
209
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
</body>
|
213
|
+
</html>
|
@@ -0,0 +1,108 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: bio_portal_helper.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>bio_portal_helper.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>app/helpers/bio_portal_helper.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon May 17 15:10:17 +0100 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
To change this template, choose Tools | Templates and open the template in
|
74
|
+
the editor.
|
75
|
+
</p>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<!-- if includes -->
|
87
|
+
|
88
|
+
<div id="section">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if method_list -->
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<div id="validator-badges">
|
104
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</body>
|
108
|
+
</html>
|