openbel-api 1.0.1-java → 1.0.2-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e9889f26f0fe2102a6731cb21901452059261a0
4
- data.tar.gz: f6ffae2fd408292c5e46114d819abe0bc0eea3a3
3
+ metadata.gz: 4b87c630e974a44f066e87080bc5eaa36fbad8b9
4
+ data.tar.gz: 7b3868b183369a508d18a3a7fc230f1c3f881d52
5
5
  SHA512:
6
- metadata.gz: 6ebc671c7af97f0aee5075378edfe03bc7fc143a25c5df323a859415c398fc1050845cb966348c05d10c8a935dc6c71b9280c605f990cf263468198506ee88b1
7
- data.tar.gz: f2e63fbcc6824cde47ce0c4133d218f6651f13ced35b608120d66c04a2a3c1c432218ff137f34deb1f7d3e0e1850fc3808f64c58a733f14ca026a1c9686862f8
6
+ metadata.gz: e170f818a3c1e31e07af75cdfd05ecbeda514fe21e314335369e9f8ff88ab62452c5cd10e11b49bcfc1a80f6633b0040f662eebc0e82d4648dc5a8d03c9c0f97
7
+ data.tar.gz: 2dfcc8de40f092e7b31e23c4064e311ec6a9e934d43f401d2f30e4b3829aa833a78b3f8f51963fdf7865ebcaf7be226cd2091dd54b0ec88725cadf3ec2514af5
@@ -3,6 +3,19 @@ All notable changes to openbel-api will be documented in this file. The curated
3
3
 
4
4
  This project adheres to [Semantic Versioning][Semantic Versioning].
5
5
 
6
+ ## [1.0.1][1.0.1] - 2016-06-08
7
+ ### Added
8
+ - Renaming APIs and code on [new terminology][new terminology].
9
+
10
+ - BEL specification version can be set in configuration file which controls the BEL version used as input/output. Affected APIs:
11
+
12
+ - */api/datasets*
13
+ - */api/expressions*
14
+ - */api/nanopubs*
15
+
16
+ - Support storage of BEL 2.0 nanopubs.
17
+ - Added */api/expressions/validation* API that returns syntax and signature validations for a BEL expression.
18
+
6
19
  ## [1.0.0][1.0.0] - TBD
7
20
  ### Added
8
21
  - Support JWT authentication via *token* query parameter ([PR #108][108]).
@@ -74,6 +87,7 @@ Datasets are stored with a URI computed from the scheme and host that is serving
74
87
  - Retrieve equivalent namespace values from the individual.
75
88
  - Retrieve orthologous namespace values from the individual.
76
89
 
90
+ [1.0.1]: https://github.com/OpenBEL/openbel-api/compare/0.6.2...1.0.1
77
91
  [1.0.0]: https://github.com/OpenBEL/openbel-api/compare/0.6.2...1.0.0
78
92
  [0.6.2]: https://github.com/OpenBEL/openbel-api/compare/0.6.1...0.6.2
79
93
  [0.6.1]: https://github.com/OpenBEL/openbel-api/compare/0.6.0...0.6.1
@@ -91,3 +105,5 @@ Datasets are stored with a URI computed from the scheme and host that is serving
91
105
  [102]: https://github.com/OpenBEL/openbel-api/issues/102
92
106
  [105]: https://github.com/OpenBEL/openbel-api/issues/105
93
107
  [108]: https://github.com/OpenBEL/openbel-api/issues/108
108
+ [new terminology]: https://github.com/OpenBEL/openbel-api#vocabulary
109
+
data/README.md CHANGED
@@ -223,6 +223,40 @@ server {
223
223
 
224
224
  API documentation with *Try it* functionality is available here [OpenBEL API documentation][OpenBEL API documentation]. You can download the [RAML 0.8][RAML] or Swagger specification files, try it on the webpage or generate curl, httpie, and various language templates for using the API.
225
225
 
226
+ ## Development
227
+
228
+ ### branches
229
+
230
+ - master branch
231
+ - Contains stable code. Releases are created from this branch using a tag (e.g. `MAJOR.MINOR.PATCH`).
232
+
233
+ - next branch
234
+ - Contains unstable code. Commits should be merged into master after it stabilizes.
235
+
236
+ ### releases
237
+
238
+ Releases of *openbel-api* should follow these steps:
239
+
240
+ 1. Update the version in the `VERSION` file.
241
+
242
+ 2. Add changes for this version to the `CHANGELOG` file. This file is modelled after http://keepachangelog.com/.
243
+
244
+ 3. Push the changes for `VERSION` and `CHANGELOG` on the master branch.
245
+
246
+ 4. Ensure the *master* branch has all of the required changes.
247
+
248
+ 5. Create a git tag, named after the version, on the *master* branch. Push this tag to GitHub.
249
+
250
+ 6. Create the Ruby and Java RubyGem for *openbel-api*.
251
+
252
+ `gem build .gemspec`
253
+
254
+ 7. Create a release on GitHub for this version and attach the gem file.
255
+
256
+ 8. Push gems to RubyGems.
257
+
258
+ `gem push openbel-api-VERSION-java.gem`
259
+
226
260
  -----
227
261
 
228
262
  Built with collaboration and a lot of :heart: by the [OpenBEL][OpenBEL] community.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -71,6 +71,19 @@ module OpenBEL
71
71
 
72
72
  def check_dataset(io, type)
73
73
  begin
74
+
75
+ # See https://github.com/OpenBEL/openbel-api/issues/120
76
+ BEL.nanopub(io, type, :language => @bel_version).each do |nanopub|
77
+ BEL.object_convert(String, nanopub.to_h) { |str|
78
+ unless str.valid_encoding?
79
+ msg = 'Invalid encoding. UTF-8 is required.'
80
+ response = render_json({:status => 415, :msg => msg})
81
+ halt(415, { 'Content-Type' => 'application/json' }, response)
82
+ end
83
+ }
84
+ end
85
+ io.rewind
86
+
74
87
  nanopub = BEL.nanopub(io, type).each.first
75
88
 
76
89
  unless nanopub
@@ -97,9 +97,7 @@ module OpenBEL
97
97
  references = @collection.aggregate(
98
98
  [
99
99
  {
100
- :$project => {
101
- "references.namespaces" => 1
102
- }
100
+ :$project => {"references.namespaces" => 1}
103
101
  },
104
102
  {
105
103
  :$unwind => "$references.namespaces"
@@ -107,22 +105,30 @@ module OpenBEL
107
105
  {
108
106
  :$project => {
109
107
  keyword: "$references.namespaces.keyword",
110
- uri: "$references.namespaces.uri"
108
+ type: "$references.namespaces.type",
109
+ domain: "$references.namespaces.domain"
111
110
  }
112
111
  },
113
112
  {
114
113
  :$group => {
115
- _id: "$keyword", uri: {
116
- :$addToSet => "$uri"
114
+ _id: "$keyword",
115
+ type: {
116
+ :$addToSet => "$type"
117
+ },
118
+ domain: {
119
+ :$addToSet => "$domain"
117
120
  }
118
121
  }
119
122
  },
120
123
  {
121
- :$unwind => "$uri"
124
+ :$unwind => "$type"
125
+ },
126
+ {
127
+ :$unwind => "$domain"
122
128
  },
123
129
  {
124
130
  :$project => {
125
- keyword: "$_id", uri: "$uri", _id: 0
131
+ keyword: "$_id", type: "$type", domain: "$domain", _id: 0
126
132
  }
127
133
  }
128
134
  ],
@@ -135,10 +141,19 @@ module OpenBEL
135
141
  union = []
136
142
  remap = {}
137
143
  references.each do |obj|
138
- obj = obj.to_h
139
- obj[:keyword] = obj.delete("keyword")
140
- obj[:uri] = obj.delete("uri")
141
- union, new_remap = BEL::Nanopub.union_namespace_references(union, [obj], 'incr')
144
+ keyword = obj['keyword']
145
+ type = obj['type']
146
+ domain = obj['domain']
147
+ uri = url = nil
148
+ if type == :url
149
+ url = domain
150
+ elsif type == :uri
151
+ uri = domain
152
+ end
153
+ args = [keyword, uri, url]
154
+ namespace = BELParser::Expression::Model::Namespace.new(*args)
155
+ union, new_remap =
156
+ BEL::Nanopub.union_namespace_references(union, [namespace], 'incr')
142
157
  remap.merge!(new_remap)
143
158
  end
144
159
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openbel-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: java
6
6
  authors:
7
7
  - Anthony Bargnesi