familysearch-gedcomx 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -653,13 +653,92 @@ module FamilySearch
653
653
  property :databaseVersion
654
654
  property :platformVersion
655
655
  end
656
+
657
+ class Tag < SuperDash
658
+ property :resource
659
+ end
656
660
 
657
- class ResultConfidence < SuperDash
658
- # Here to give a number 1-5. Not really a significant piece of the model.
661
+ class AtomCommonAttributes < SuperDash
662
+ property :base
663
+ property :lang
659
664
  end
660
665
 
661
- class Tag < SuperDash
662
- property :resource
663
- end
666
+ class AtomExtensibleElement < AtomCommonAttributes
667
+ include SuperCoercion
668
+ end
669
+
670
+ class AtomPerson < AtomExtensibleElement
671
+ property :name
672
+ property :uri
673
+ property :email
674
+ end
675
+
676
+ class AtomGenerator < SuperDash
677
+ property :base
678
+ property :uri
679
+ property :lang
680
+ property :version
681
+ property :value
682
+ end
683
+
684
+ class AtomCategory < AtomCommonAttributes
685
+ property :scheme
686
+ property :term
687
+ property :label
688
+ end
689
+
690
+ class AtomContent < SuperDash
691
+ include SuperCoercion
692
+ property :type
693
+ property :gedcomx
694
+
695
+ coerce_key :gedcomx, Gedcomx
696
+ end
697
+
698
+ class AtomEntry < AtomExtensibleElement
699
+ property :authors
700
+ property :categories
701
+ property :confidence
702
+ property :content
703
+ property :contributors
704
+ property :id
705
+ property :links
706
+ property :published
707
+ property :rights
708
+ property :score
709
+ property :title
710
+ property :updated
711
+
712
+ coerce_key :authors, [AtomPerson]
713
+ coerce_key :categories, [AtomCategory]
714
+ coerce_key :content, AtomContent
715
+ coerce_key :contributors, [AtomPerson]
716
+ coerce_key :links, {'key' => Link}
717
+ end
718
+
719
+ class AtomFeed < AtomExtensibleElement
720
+ property :authors
721
+ property :contributors
722
+ property :generator
723
+ property :icon
724
+ property :id
725
+ property :results
726
+ property :index
727
+ property :links
728
+ property :logo
729
+ property :rights
730
+ property :subtitle
731
+ property :title
732
+ property :updated
733
+ property :entries
734
+ property :facets
735
+
736
+ coerce_key :authors, [AtomPerson]
737
+ coerce_key :contributors, [AtomPerson]
738
+ coerce_key :generator, AtomGenerator
739
+ coerce_key :links, {'key' => Link}
740
+ coerce_key :entries, [AtomEntry]
741
+ coerce_key :facets, [Facet]
742
+ end
664
743
  end
665
744
  end
@@ -1,6 +1,6 @@
1
1
  # A structured object model for the application/x-fs-v1+json media type.
2
2
  module FamilySearch
3
3
  module Gedcomx
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
6
6
  end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+
4
+ describe FamilySearch::Gedcomx::AtomFeed do
5
+ it 'should have a version number' do
6
+ FamilySearch::Gedcomx::VERSION.should_not be_nil
7
+ end
8
+
9
+ context "populating from hashes" do
10
+ it 'should be able to parse a person file' do
11
+ person_json = File.read 'spec/familysearch/gedcomx/fixtures/search.json'
12
+ search_hash = JSON.parse person_json
13
+ atom = FamilySearch::Gedcomx::AtomFeed.new search_hash
14
+ atom.links['next'].href.should == 'https://sandbox.familysearch.org/platform/tree/search?context=AQATNTk5NDY4MzUzOTQ4Njk1NzQyMQAAAAZTMWTrAABfbQA%3D&start=4'
15
+ atom.results.should == 4
16
+ atom.entries[0].should be_instance_of FamilySearch::Gedcomx::AtomEntry
17
+ atom.entries[0].content.should be_instance_of FamilySearch::Gedcomx::AtomContent
18
+ atom.entries[0].content.gedcomx.persons[0].should be_instance_of FamilySearch::Gedcomx::Person
19
+ atom.entries[0].content.gedcomx.persons[0].full_name.should == 'John Smith'
20
+ atom.entries[0].confidence.should == 5
21
+ atom.entries[0].score.should == 512.5161
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,423 @@
1
+ {
2
+ "results" : 4,
3
+ "index" : 0,
4
+ "links" : {
5
+ "next" : {
6
+ "href" : "https://sandbox.familysearch.org/platform/tree/search?context=AQATNTk5NDY4MzUzOTQ4Njk1NzQyMQAAAAZTMWTrAABfbQA%3D&start=4",
7
+ "title" : "Person Search"
8
+ },
9
+ "self" : {
10
+ "href" : "https://sandbox.familysearch.org/platform/tree/search?q=givenName:John+surname:Smith+gender:male",
11
+ "title" : "Person Search"
12
+ },
13
+ "first" : {
14
+ "href" : "https://sandbox.familysearch.org/platform/tree/search?context=AQATNTk5NDY4MzUzOTQ4Njk1NzQyMQAAAAZTMWTrAABfbQA%3D&start=0",
15
+ "title" : "Person Search"
16
+ }
17
+ },
18
+ "subtitle" : "Results of searching for persons.",
19
+ "title" : "Results",
20
+ "entries" : [ {
21
+ "content" : {
22
+ "gedcomx" : {
23
+ "persons" : [ {
24
+ "id" : "KW7M-6SD",
25
+ "links" : {
26
+ "person" : {
27
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW7M-6SD",
28
+ "title" : "Person"
29
+ }
30
+ },
31
+ "living" : false,
32
+ "gender" : {
33
+ "type" : "http://gedcomx.org/Male"
34
+ },
35
+ "names" : [ {
36
+ "type" : "http://gedcomx.org/BirthName",
37
+ "nameForms" : [ {
38
+ "fullText" : "John Smith"
39
+ } ]
40
+ } ],
41
+ "facts" : [ {
42
+ "type" : "http://gedcomx.org/Birth",
43
+ "date" : {
44
+ "original" : "1 January 1900"
45
+ },
46
+ "place" : {
47
+ "original" : "Jericho, Queensland, Australia"
48
+ }
49
+ } ],
50
+ "display" : {
51
+ "name" : "John Smith",
52
+ "gender" : "Male",
53
+ "birthDate" : "1 January 1900",
54
+ "birthPlace" : "Jericho, Queensland, Australia"
55
+ }
56
+ }, {
57
+ "id" : "KW7M-6S6",
58
+ "links" : {
59
+ "person" : {
60
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW7M-6S6",
61
+ "title" : "Person"
62
+ }
63
+ },
64
+ "living" : false,
65
+ "gender" : {
66
+ "type" : "http://gedcomx.org/Female"
67
+ },
68
+ "names" : [ {
69
+ "type" : "http://gedcomx.org/BirthName",
70
+ "nameForms" : [ {
71
+ "fullText" : "Mary Hawkins"
72
+ } ]
73
+ } ],
74
+ "facts" : [ {
75
+ "type" : "http://gedcomx.org/Marriage",
76
+ "date" : {
77
+ "original" : "2 Feb 1930"
78
+ },
79
+ "place" : {
80
+ "original" : "Melbourne, Victoria, Australia"
81
+ }
82
+ } ],
83
+ "display" : {
84
+ "name" : "Mary Hawkins",
85
+ "gender" : "Female"
86
+ }
87
+ } ],
88
+ "relationships" : [ {
89
+ "type" : "http://gedcomx.org/Couple",
90
+ "person1" : {
91
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KW7M-6SD",
92
+ "resourceId" : "KW7M-6SD"
93
+ },
94
+ "person2" : {
95
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KW7M-6S6",
96
+ "resourceId" : "KW7M-6S6"
97
+ }
98
+ } ]
99
+ }
100
+ },
101
+ "id" : "KW7M-6SD",
102
+ "score" : 512.5161,
103
+ "confidence" : 5,
104
+ "links" : {
105
+ "person" : {
106
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW7M-6SD",
107
+ "title" : "Person"
108
+ }
109
+ },
110
+ "title" : "Person KW7M-6SD (John Smith)"
111
+ }, {
112
+ "content" : {
113
+ "gedcomx" : {
114
+ "persons" : [ {
115
+ "id" : "KW73-8G5",
116
+ "links" : {
117
+ "person" : {
118
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8G5",
119
+ "title" : "Person"
120
+ }
121
+ },
122
+ "living" : false,
123
+ "gender" : {
124
+ "type" : "http://gedcomx.org/Male"
125
+ },
126
+ "names" : [ {
127
+ "type" : "http://gedcomx.org/BirthName",
128
+ "nameForms" : [ {
129
+ "fullText" : "John SMITH"
130
+ } ]
131
+ } ],
132
+ "facts" : [ {
133
+ "type" : "http://gedcomx.org/Birth",
134
+ "date" : {
135
+ "original" : "28 May 1687"
136
+ }
137
+ } ],
138
+ "display" : {
139
+ "name" : "John SMITH",
140
+ "gender" : "Male",
141
+ "birthDate" : "28 May 1687"
142
+ }
143
+ }, {
144
+ "id" : "KW73-8GR",
145
+ "links" : {
146
+ "person" : {
147
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8GR",
148
+ "title" : "Person"
149
+ }
150
+ },
151
+ "living" : false,
152
+ "gender" : {
153
+ "type" : "http://gedcomx.org/Female"
154
+ },
155
+ "names" : [ {
156
+ "type" : "http://gedcomx.org/BirthName",
157
+ "nameForms" : [ {
158
+ "fullText" : "Elizabeth BRYCE"
159
+ } ]
160
+ } ],
161
+ "display" : {
162
+ "name" : "Elizabeth BRYCE",
163
+ "gender" : "Female"
164
+ }
165
+ }, {
166
+ "id" : "KW73-8GV",
167
+ "links" : {
168
+ "person" : {
169
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8GV",
170
+ "title" : "Person"
171
+ }
172
+ },
173
+ "living" : false,
174
+ "gender" : {
175
+ "type" : "http://gedcomx.org/Male"
176
+ },
177
+ "names" : [ {
178
+ "type" : "http://gedcomx.org/BirthName",
179
+ "nameForms" : [ {
180
+ "fullText" : "Francis SMITH"
181
+ } ]
182
+ } ],
183
+ "display" : {
184
+ "name" : "Francis SMITH",
185
+ "gender" : "Male"
186
+ }
187
+ } ],
188
+ "relationships" : [ {
189
+ "type" : "http://gedcomx.org/Couple",
190
+ "person1" : {
191
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8G5",
192
+ "resourceId" : "KW73-8G5"
193
+ },
194
+ "person2" : {
195
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8GR",
196
+ "resourceId" : "KW73-8GR"
197
+ }
198
+ }, {
199
+ "type" : "http://gedcomx.org/ParentChild",
200
+ "person1" : {
201
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8G5",
202
+ "resourceId" : "KW73-8G5"
203
+ },
204
+ "person2" : {
205
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8GV",
206
+ "resourceId" : "KW73-8GV"
207
+ }
208
+ } ]
209
+ }
210
+ },
211
+ "id" : "KW73-8G5",
212
+ "score" : 512.516,
213
+ "confidence" : 5,
214
+ "links" : {
215
+ "person" : {
216
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KW73-8G5",
217
+ "title" : "Person"
218
+ }
219
+ },
220
+ "title" : "Person KW73-8G5 (John SMITH)"
221
+ }, {
222
+ "content" : {
223
+ "gedcomx" : {
224
+ "persons" : [ {
225
+ "id" : "KWQB-VJS",
226
+ "links" : {
227
+ "person" : {
228
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KWQB-VJS",
229
+ "title" : "Person"
230
+ }
231
+ },
232
+ "living" : false,
233
+ "gender" : {
234
+ "type" : "http://gedcomx.org/Male"
235
+ },
236
+ "names" : [ {
237
+ "type" : "http://gedcomx.org/BirthName",
238
+ "nameForms" : [ {
239
+ "fullText" : "John Smith"
240
+ } ]
241
+ } ],
242
+ "facts" : [ {
243
+ "type" : "http://gedcomx.org/Death",
244
+ "date" : {
245
+ "original" : "1776"
246
+ },
247
+ "place" : {
248
+ "original" : "United States"
249
+ }
250
+ }, {
251
+ "type" : "http://gedcomx.org/Birth",
252
+ "date" : {
253
+ "original" : "1735"
254
+ },
255
+ "place" : {
256
+ "original" : "England"
257
+ }
258
+ } ],
259
+ "display" : {
260
+ "name" : "John Smith",
261
+ "gender" : "Male",
262
+ "birthDate" : "1735",
263
+ "birthPlace" : "England",
264
+ "deathDate" : "1776",
265
+ "deathPlace" : "United States"
266
+ }
267
+ } ],
268
+ "relationships" : [ ]
269
+ }
270
+ },
271
+ "id" : "KWQB-VJS",
272
+ "score" : 512.51575,
273
+ "confidence" : 5,
274
+ "links" : {
275
+ "person" : {
276
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KWQB-VJS",
277
+ "title" : "Person"
278
+ }
279
+ },
280
+ "title" : "Person KWQB-VJS (John Smith)"
281
+ }, {
282
+ "content" : {
283
+ "gedcomx" : {
284
+ "persons" : [ {
285
+ "id" : "KWQZ-8LK",
286
+ "links" : {
287
+ "person" : {
288
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KWQZ-8LK",
289
+ "title" : "Person"
290
+ }
291
+ },
292
+ "living" : false,
293
+ "gender" : {
294
+ "type" : "http://gedcomx.org/Male"
295
+ },
296
+ "names" : [ {
297
+ "type" : "http://gedcomx.org/BirthName",
298
+ "nameForms" : [ {
299
+ "fullText" : "* John SMITH"
300
+ } ]
301
+ } ],
302
+ "facts" : [ {
303
+ "type" : "http://gedcomx.org/Death",
304
+ "date" : {
305
+ "original" : "12 Jun 1712"
306
+ },
307
+ "place" : {
308
+ "original" : "Haddam, Middlesesx, Connecticut"
309
+ }
310
+ }, {
311
+ "type" : "http://gedcomx.org/Christening",
312
+ "date" : {
313
+ "original" : "21 Mar 1670"
314
+ },
315
+ "place" : {
316
+ "original" : "Beckford, Herefordshire, Engl"
317
+ }
318
+ }, {
319
+ "type" : "http://gedcomx.org/Birth",
320
+ "date" : {
321
+ "original" : "ABT 1660"
322
+ },
323
+ "place" : {
324
+ "original" : "Haddam, Middlesex, Connecticut, United States"
325
+ }
326
+ } ],
327
+ "display" : {
328
+ "name" : "* John SMITH",
329
+ "gender" : "Male",
330
+ "birthDate" : "ABT 1660",
331
+ "birthPlace" : "Haddam, Middlesex, Connecticut, United States",
332
+ "deathDate" : "12 Jun 1712",
333
+ "deathPlace" : "Haddam, Middlesesx, Connecticut"
334
+ }
335
+ }, {
336
+ "id" : "KWQZ-8FD",
337
+ "links" : {
338
+ "person" : {
339
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KWQZ-8FD",
340
+ "title" : "Person"
341
+ }
342
+ },
343
+ "living" : false,
344
+ "gender" : {
345
+ "type" : "http://gedcomx.org/Female"
346
+ },
347
+ "names" : [ {
348
+ "type" : "http://gedcomx.org/BirthName",
349
+ "nameForms" : [ {
350
+ "fullText" : "Sarah White"
351
+ } ]
352
+ } ],
353
+ "facts" : [ {
354
+ "type" : "http://gedcomx.org/Marriage",
355
+ "date" : {
356
+ "original" : "ABT 1682"
357
+ },
358
+ "place" : {
359
+ "original" : "Middletown, Middlesex, Connecticut, United States"
360
+ }
361
+ } ],
362
+ "display" : {
363
+ "name" : "Sarah White",
364
+ "gender" : "Female"
365
+ }
366
+ }, {
367
+ "id" : "KWQX-5TJ",
368
+ "links" : {
369
+ "person" : {
370
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KWQX-5TJ",
371
+ "title" : "Person"
372
+ }
373
+ },
374
+ "living" : false,
375
+ "gender" : {
376
+ "type" : "http://gedcomx.org/Female"
377
+ },
378
+ "names" : [ {
379
+ "type" : "http://gedcomx.org/BirthName",
380
+ "nameForms" : [ {
381
+ "fullText" : "LA Verna Coleman"
382
+ } ]
383
+ } ],
384
+ "display" : {
385
+ "name" : "LA Verna Coleman",
386
+ "gender" : "Female"
387
+ }
388
+ } ],
389
+ "relationships" : [ {
390
+ "type" : "http://gedcomx.org/Couple",
391
+ "person1" : {
392
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KWQZ-8LK",
393
+ "resourceId" : "KWQZ-8LK"
394
+ },
395
+ "person2" : {
396
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KWQZ-8FD",
397
+ "resourceId" : "KWQZ-8FD"
398
+ }
399
+ }, {
400
+ "type" : "http://gedcomx.org/ParentChild",
401
+ "person1" : {
402
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KWQZ-8LK",
403
+ "resourceId" : "KWQZ-8LK"
404
+ },
405
+ "person2" : {
406
+ "resource" : "https://sandbox.familysearch.org/platform/tree/persons/KWQX-5TJ",
407
+ "resourceId" : "KWQX-5TJ"
408
+ }
409
+ } ]
410
+ }
411
+ },
412
+ "id" : "KWQZ-8LK",
413
+ "score" : 412.3539,
414
+ "confidence" : 4,
415
+ "links" : {
416
+ "person" : {
417
+ "href" : "https://sandbox.familysearch.org/platform/tree/persons/KWQZ-8LK",
418
+ "title" : "Person"
419
+ }
420
+ },
421
+ "title" : "Person KWQZ-8LK (* John SMITH)"
422
+ } ]
423
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: familysearch-gedcomx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-28 00:00:00.000000000 Z
12
+ date: 2013-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
@@ -98,6 +98,7 @@ files:
98
98
  - lib/familysearch/gedcomx/super_coercion.rb
99
99
  - lib/familysearch/gedcomx/super_dash.rb
100
100
  - lib/familysearch/gedcomx/version.rb
101
+ - spec/familysearch/gedcomx/atom_spec.rb
101
102
  - spec/familysearch/gedcomx/fact_spec.rb
102
103
  - spec/familysearch/gedcomx/familysearch_spec.rb
103
104
  - spec/familysearch/gedcomx/fixtures/ancestry-query.json
@@ -105,6 +106,7 @@ files:
105
106
  - spec/familysearch/gedcomx/fixtures/person-with-relationships-mother.json
106
107
  - spec/familysearch/gedcomx/fixtures/person-with-relationships.json
107
108
  - spec/familysearch/gedcomx/fixtures/person.json
109
+ - spec/familysearch/gedcomx/fixtures/search.json
108
110
  - spec/familysearch/gedcomx/graph_person_spec.rb
109
111
  - spec/familysearch/gedcomx/graph_spec.rb
110
112
  - spec/familysearch/gedcomx/person_spec.rb
@@ -126,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
128
  version: '0'
127
129
  segments:
128
130
  - 0
129
- hash: 1290558280724314510
131
+ hash: 1520665764010235973
130
132
  required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  none: false
132
134
  requirements:
@@ -135,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  version: '0'
136
138
  segments:
137
139
  - 0
138
- hash: 1290558280724314510
140
+ hash: 1520665764010235973
139
141
  requirements: []
140
142
  rubyforge_project:
141
143
  rubygems_version: 1.8.23
@@ -143,6 +145,7 @@ signing_key:
143
145
  specification_version: 3
144
146
  summary: A structured object model for the application/x-fs-v1+json media type
145
147
  test_files:
148
+ - spec/familysearch/gedcomx/atom_spec.rb
146
149
  - spec/familysearch/gedcomx/fact_spec.rb
147
150
  - spec/familysearch/gedcomx/familysearch_spec.rb
148
151
  - spec/familysearch/gedcomx/fixtures/ancestry-query.json
@@ -150,6 +153,7 @@ test_files:
150
153
  - spec/familysearch/gedcomx/fixtures/person-with-relationships-mother.json
151
154
  - spec/familysearch/gedcomx/fixtures/person-with-relationships.json
152
155
  - spec/familysearch/gedcomx/fixtures/person.json
156
+ - spec/familysearch/gedcomx/fixtures/search.json
153
157
  - spec/familysearch/gedcomx/graph_person_spec.rb
154
158
  - spec/familysearch/gedcomx/graph_spec.rb
155
159
  - spec/familysearch/gedcomx/person_spec.rb