COEUS 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 494072030f0df3ecb04523cbb9897593d182b4ce
4
- data.tar.gz: 01958e3e6fa80e8b0c3aa99e3d9b34a7d60a4693
3
+ metadata.gz: f38a74fb7c09ee5119370d31c461d588e5ae7116
4
+ data.tar.gz: 314dced4f41da79eccb54469e0183ea85c978c56
5
5
  SHA512:
6
- metadata.gz: 787a1963f758fed2ebc2210bada96c86d6782caa38260d299f3deb79d318b464fe2bf9eafc05729353106bd79f8c97ffc086f2907da6f907dde834b392b7fecb
7
- data.tar.gz: f994fa2e2b4a4626e58d529bb877f0df996c28cf5654b42c8d85a99608870916210afdd68d7dfcad660575e40cfbcd1cf4184bc795ae70c55c4c5e8fba900909
6
+ metadata.gz: 0a52f0cfb3d253e00164386d2d2e78497fc7b3cf214382219b7ea7e66507a2981c1eb51d4ce6807d7f237e0d6c1c95be05af486806fade92ea79cb5fd5db8a39
7
+ data.tar.gz: 06cf51b3899b1264a8454274fc7b5eebf414d9439d34fb5e21179dd77cd809489b0bf941e4eb05b8ffd822089d1a42ab33d6455804fb85450f24536afeaa832d
data/coeus.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "COEUS"
8
8
  spec.version = COEUS::VERSION
9
9
  spec.authors = ["Pedro Lopes"]
10
- spec.email = ["hello@pedrolopes.net"]
10
+ spec.email = ["pedrolopes@ua.pt"]
11
11
  spec.description = %q{COEUS: semantic web application framework}
12
12
  spec.summary = %q{This. Is. Semantic.}
13
13
  spec.homepage = "http://bioinformatics.ua.pt/coeus/"
data/lib/coeus.rb CHANGED
@@ -4,11 +4,28 @@ require "json"
4
4
  require "rdf"
5
5
  require "sparql"
6
6
 
7
+ ##
8
+ # = COEUS
9
+ #
10
+ # Main COEUS gem module
7
11
  module COEUS
8
12
  class COEUS
13
+ # COEUS base host URL
9
14
  @host = 'http://bioinformatics.ua.pt/coeus/'
15
+
16
+ # COEUS API key
10
17
  @key = 'uavr'
11
18
 
19
+ ##
20
+ # This method defines the base COEUS host for the next actions
21
+ #
22
+ # ==== Parameters
23
+ #
24
+ # * +host+ - the new host settings
25
+ #
26
+ # ==== Default
27
+ # * http://bioinformatics.ua.pt/coeus/
28
+ #
12
29
  def self.host(host)
13
30
  if host.start_with?('http')
14
31
  @host = host
@@ -21,20 +38,47 @@ module COEUS
21
38
  puts @host
22
39
  end
23
40
 
41
+ ##
42
+ # This method defines the COEUS seed API key
43
+ #
44
+ # ==== Parameters
45
+ #
46
+ # * +key+ - the COEUS API key
47
+ #
48
+ # ==== Default
49
+ # * uavr
50
+ #
24
51
  def self.key(key)
25
52
  @key = key
26
53
  end
27
54
 
55
+ ##
56
+ # This method uses COEUS API to get match triples based on provided parameters
57
+ #
58
+ # ==== Parameters
59
+ #
60
+ # * +sub+ - the triple set subject
61
+ # * +pred+ - the triple set predicate
62
+ # * +obj+ - the triple set object
63
+ #
64
+ # ==== Default
65
+ # * http://bioinformatics.ua.pt/coeus/
66
+ #
28
67
  def self.triple(sub, pred, obj)
29
68
  content = URI.parse(@host + 'api/triple/' + sub + '/' + pred + '/' + obj + '/js').read
30
69
  return JSON.parse(content)['results']['bindings']
31
70
  end
32
71
 
72
+
73
+ ##
74
+ # This method performs a SPARQL query on the COEUS endpoint
75
+ #
76
+ # ==== Parameters
77
+ #
78
+ # * +query+ - the complete SPARQL query (including prefixes)
79
+ #
33
80
  def self.query(query)
34
81
  sparql = SPARQL::Client.new(@host + 'sparql')
35
- #queryable = RDF::Repository.load(@host + 'sparql')
36
- #solutions = SPARQL.execute(query, sparql)
37
- #return solutions.to_json
38
82
  return sparql.query(query)
39
83
  end
40
84
  end
data/lib/coeus/version.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  module COEUS
2
- VERSION = "0.0.4"
2
+ # COEUS gem version info
3
+ VERSION = "0.0.5"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: COEUS
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Lopes
@@ -82,14 +82,12 @@ dependencies:
82
82
  version: '0'
83
83
  description: 'COEUS: semantic web application framework'
84
84
  email:
85
- - hello@pedrolopes.net
85
+ - pedrolopes@ua.pt
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - Gemfile
91
- - LICENSE
92
- - LICENSE.txt
93
91
  - README.md
94
92
  - Rakefile
95
93
  - coeus.gemspec
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2013 Pedro Lopes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Pedro Lopes
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.