Project

General

Profile

CdmRestServices2 » History » Version 59

Niels Hoffmann, 11/23/2010 01:11 PM

1 59 Niels Hoffmann
~~~
2
<code class="html">
3
<div style="font-size:300%; color: #600;">Outdated!</div> 
4
~~~
5
	 	 
6
This documentation will move to http://wp5.e-taxonomy.eu/cdmlib/rest-api.html. 
7
8
	 	 
9
10
---- 
11
12
13 1 Andreas Kohlbecker
14
15
16 54 Niels Hoffmann
17 41 Andreas Kohlbecker
_Developers implementation notes are found in [[CdmRestServicesImplementationNotes]]._
18 1 Andreas Kohlbecker
19
20 36 Andreas Kohlbecker
21
----
22
23
24
25 2 Andreas Kohlbecker
# CDM REST Services 2.0
26 1 Andreas Kohlbecker
27
28 52 Ben Clark
The CDM REST Services are a web based interface to resources stored in a [[CommunityServer|CDM Community Server]]. The RESTful architecture allows accessing the various resources like Taxa, Names, References, Media, etc by stable URIs. Due to security constraints and to assure the integration of data, currently only read operations (= HTTP GET) are permitted, [[CdmServerReadWriteRest|write operations]] will be available in the near future.
29 1 Andreas Kohlbecker
30 3 Andreas Kohlbecker
31 1 Andreas Kohlbecker
In contrast to the former [[CdmRestServices1|CDM REST Services 1.0]] the new architecture directly exposes domain model entities. Whereas the version 1.0 still was build using the  [DTO/Assembler pattern](http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)  the new implementation provides direct serializations of the objects as they are stored in the CDM where ever possible. For the external representations, like LSIDs and TDWG data exchange schema like TCS however using DTOs is unavoidable. Now for the **API Service** there is no longer a difference between the data model used to store and manage CDM objects and another one used to transfer them to web based clients. Thereby it has become much easier to use the web service. The same account also for the **Portal Service** except that this service adds some fields like localized representations and to the pure CDM entities.
32 54 Niels Hoffmann
33
34
{{>toc}}
35
36 3 Andreas Kohlbecker
37 1 Andreas Kohlbecker
38
39 16 Andreas Kohlbecker
## Service Sections
40 1 Andreas Kohlbecker
41 16 Andreas Kohlbecker
42 56 Andreas Kohlbecker
The CDM REST Services architecture is functionally separated into four different parts:
43 16 Andreas Kohlbecker
44
45 18 Andreas Kohlbecker
* The **API Service** a clean RESTful bit, which will expose data in a modular, normalized way. It is a more-or-less one-to-one concordance between URIs and service api methods.
46 16 Andreas Kohlbecker
47 18 Andreas Kohlbecker
* The **Portal Service** which is specially taliored for the needs of dataportals which will primarily display "Species Page". Thus this service will be provide denormalized pages which contain a specific assemblys of information. 
48 1 Andreas Kohlbecker
49 56 Andreas Kohlbecker
* The **External Services** are supporting non CDM applications and services like for example a map generation service, LSID Services.
50 1 Andreas Kohlbecker
51 56 Andreas Kohlbecker
* The **Classification Service** exposes special DTOs which combine data from the `TaxonBase@, @TaxonNode` and from the `Classification` entities.
52
53 16 Andreas Kohlbecker
 
54 17 Andreas Kohlbecker
Detailed descriptions of the services are available [[CdmRestServices2#ServiceDescriptions|below]].
55 16 Andreas Kohlbecker
56
57
58 1 Andreas Kohlbecker
## Object Boundaries
59 14 Andreas Kohlbecker
60 16 Andreas Kohlbecker
61 1 Andreas Kohlbecker
Nearly all CDM entities are related to each other more or less dicrectly or indirectly and thus forming a huge object graph. A web services however should only deliver a specific object perhaps with some attached associated objects, so it id crucial to draw the line quite sensible between the objects in question and the full object graph. The CDM Service solves this by selectively initializing CDM entities.
62
63
64 56 Andreas Kohlbecker
The primary idea is that the **API Service** delivers the requested object with all its *toOne relations. Associated objects of the requested object which are at the many side of the *toMany relations are available through URIs which map the fieldname of the *toMany relation. Transient fields are not serialized except of the `titleCache` property, this one and serialized and thus initialized for each `IdentifiableEntity@. The initialization of the @titleCache` property is performed by the `CacheStrategie` of the specific cdm class and usually spans multiple associated entities of variable depth of object nesting.
65 14 Andreas Kohlbecker
66 18 Andreas Kohlbecker
67 56 Andreas Kohlbecker
In contrast the *Portal Service*, often adds *toMany relations and transient fields to the requested objects. It even may deliver sub object graphs with a depth of an arbitrary number of levels for specific branches.
68 19 Andreas Kohlbecker
69
70 26 Andreas Kohlbecker
The extend of objects, i.e the initialization depth of CDM entities is documented in the [[CdmRestServices2#ServiceDescriptions|ServiceDescriptions]] below. The extend is explained using a _property path syntax_ which indicates the properties and transient getters of a specific CDM entity bean which are being initialized by the service. 
71 16 Andreas Kohlbecker
72 1 Andreas Kohlbecker
73 20 Andreas Kohlbecker
* Simple (name) - The specified name identifies an individual property of a particular CDM entity bean. The name of the actual getter method is determined using standard JavaBeans instrospection, so that a property named "xyz" will have a getter method named getXyz() or (for boolean properties only) isXyz(), and a setter method named setXyz().
74 1 Andreas Kohlbecker
75 20 Andreas Kohlbecker
* Nested (name1.name2.name3) The first name element is used to select a property getter, as for simple references above. The object returned for this property is then consulted, using the same approach, for a property getter for a property named name2, and so on. The property value that is ultimately retrieved or modified is the one identified by the last name element.
76 1 Andreas Kohlbecker
77 20 Andreas Kohlbecker
* Indexed (name[index]) - The underlying property value is assumed to be an array, or this JavaBean is assumed to have indexed property getter and setter methods. The appropriate (zero-relative) entry in the array is selected. List objects are now also supported for read/write. You simply need to define a getter that returns the List
78
79 22 Andreas Kohlbecker
* *toOne-Wildcard ($) This wildcard is used to select all property getters which reference to one associated bean. A wildcard subsequently terminates a 'property path'.
80 20 Andreas Kohlbecker
81 22 Andreas Kohlbecker
* *toAny-Wildcard (*) This wildcard is used to select all property getters which reference to one associated bean and to to many associated bean. A wildcard subsequently terminates a 'property path'.
82 1 Andreas Kohlbecker
83 23 Andreas Kohlbecker
* Combined (name1.name2[index].$) - Combining mapped, nested, and indexed and wildcard references is also supported.
84
85 1 Andreas Kohlbecker
	
86 26 Andreas Kohlbecker
~This syntax description partially is lend from  [Apache Commons BeanUtils](http://commons.apache.org/beanutils/commons-beanutils-1.7.0/docs/api/org/apache/commons/beanutils/PropertyUtilsBean.html) ~
87
88
89 27 Andreas Kohlbecker
In fact the actual extend of serialized CDM entities may exceed the extend indicated by the property path syntax. This especially happens when a transient getter is to be initialized. Due to potential internal logic in the transient getter it is unpredictable which properties actually are being initialized when only looking at the property path. A common candidate for this is the `getTaggedName()` property of source:"trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java".
90 26 Andreas Kohlbecker
91 1 Andreas Kohlbecker
92
93 24 Andreas Kohlbecker
*Developer Hints*:
94 20 Andreas Kohlbecker
95 22 Andreas Kohlbecker
96 53 Andreas Kohlbecker
The initialization od CDM entities is performed by implementations of the  source:"trunk/cdmlib/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/BeanInitializer.java" Interface. In order to find out more on this topic please refer to [[CdmEntityInitalization]].
97 20 Andreas Kohlbecker
98
99 1 Andreas Kohlbecker
100 20 Andreas Kohlbecker
101 49 Andreas Kohlbecker
## Localization
102 6 Andreas Kohlbecker
103
104 56 Andreas Kohlbecker
I order to provide the client with localized resources all services respect the  [Accept-Language HTTP header](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) #sec14.4.
105 1 Andreas Kohlbecker
106 49 Andreas Kohlbecker
For example the Portal service returns localized representations according to the Language tags supplied in the  Accept-Language HTTP header. 
107 6 Andreas Kohlbecker
108 49 Andreas Kohlbecker
The service tries finding the best matching representation. If no representation in any preferred language is found the service falls back to return the representation in source:"trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java#L126" and if necessary further falls back to return the first representation found if any exists.
109 9 Andreas Kohlbecker
110 1 Andreas Kohlbecker
111 49 Andreas Kohlbecker
Instances of the folowing CDM classes or subclasses of them potentially have multiple internationalized representations in different languages:
112 1 Andreas Kohlbecker
113
114 50 Andreas Kohlbecker
* **source:"trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java"** - language dependent representation through source:"trunk/cdmlib/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/model/common/Representation.java"; The localized reresentation string is added to the TermBase entities by adding the aaditional field: *representation_L10n*.
115 1 Andreas Kohlbecker
116 51 Andreas Kohlbecker
* **source:"trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextData.java"** - language dependent representation through source:"trunk/cdmlib/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/model/common/MultilanguageText.java"; The localized multilanguage text string is added to the TextData entities by adding the aaditional field: *multilanguageText_L10n*.
117 49 Andreas Kohlbecker
118
119
Localization is handeled a bit differently by various service sections the **API Service** just adds the localized representations. The **Portal Service** which focuses in representation, not only adds the localized representations but also hides the source:"trunk/cdmlib/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/model/common/Representation.java" or source:"trunk/cdmlib/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/model/common/MultilanguageText.java" fields from serialization in order to reduce complexity and to improve performance.
120
121
122 1 Andreas Kohlbecker
 **Developer Hints** 
123 7 Andreas Kohlbecker
124 1 Andreas Kohlbecker
125 11 Andreas Kohlbecker
126 49 Andreas Kohlbecker
Classes involved in Content Localization:
127 9 Andreas Kohlbecker
128 1 Andreas Kohlbecker
129 49 Andreas Kohlbecker
* source:"trunk/cdmlib/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/interceptor/LocaleContextHandlerInterceptor.java"
130
131 1 Andreas Kohlbecker
Configuration in: 
132
133 49 Andreas Kohlbecker
* source:"trunk/cdmlib/cdmlib-remote/src/main/webapp/WEB-INF/jsonConfigurations.xml"
134 1 Andreas Kohlbecker
135 49 Andreas Kohlbecker
 
136 1 Andreas Kohlbecker
137 49 Andreas Kohlbecker
## Content Negotiation
138 20 Andreas Kohlbecker
139 12 Andreas Kohlbecker
140 49 Andreas Kohlbecker
There are two ways to demand a special content type:
141 12 Andreas Kohlbecker
142 11 Andreas Kohlbecker
143 49 Andreas Kohlbecker
1. by file extension (*.json or *.xml)
144 1 Andreas Kohlbecker
145 49 Andreas Kohlbecker
1. by  [Accept HTTP request header](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) #sec14.1 - Accepted mime types are: `application/json@, @text/xml`    
146 1 Andreas Kohlbecker
147 49 Andreas Kohlbecker
1. Default: XML
148 12 Andreas Kohlbecker
149
150 49 Andreas Kohlbecker
The [[CdmRestServices2|CDM REST Services 2.0]] primarily trys using the file extension, then the Accept HTTP request header is taken into account. If whether the file extension or not the  Accept HTTP request header specify valid content types the default XML will be used. 
151 9 Andreas Kohlbecker
152
153 1 Andreas Kohlbecker
 **Developer Hints** 
154
155
156 6 Andreas Kohlbecker
Classes involved in Content Negotiation:
157
158
159 56 Andreas Kohlbecker
*  [org.springframework.web.servlet.view.ContentNegotiatingViewResolver](http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.html) 
160 3 Andreas Kohlbecker
161 56 Andreas Kohlbecker
Configuration files involved: 
162 1 Andreas Kohlbecker
163 56 Andreas Kohlbecker
* source:"trunk/cdmlib/cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmrest-servlet.xml"
164 1 Andreas Kohlbecker
165 10 Andreas Kohlbecker
166 1 Andreas Kohlbecker
167
## Character Encoding
168
169
170
All data is returned in UTF-8 character encoding.
171
172
173
174
## Service Descriptions
175
176
177 56 Andreas Kohlbecker
The syntax of the mapped service URIs contains the the {datasource-bean-name} path element. The available {datasource-bean-name}s are taken from a configuration file which is loaded by the CDM-Server during startup. The "datasources.xml" file is loaded by default from the following locations depending on the operation system in which the cdm-server is installed:
178
179
* Linux: `/opt/cdm-server/.cdmLibrary/datasources.xml` 
180
181
* Windows: `"%PROGRAMFILES%/EDIT CDM-Server/.cdmLibrary/datasources.xml"` 
182
183
The actual location of the [datasources.xml" can specified and thus be overridden using a specific commandline parameter for EDIT CDM-Server. For more information please refer to the  "EDIT CDM-Server documentation](http://wp5.e-taxonomy.eu/cdm-server.)
184
185
186
 
187
_NOTE:
188
189
_
190
191
1. _Former versions of the EDIT CDM-Server where using @ {USER_HOME}./cdmLibrary/datasources.xml@ this is now being only used by the EDIT Taxonomic Editor. _
192
193
1. _The `UpdatableRoutingDataSource` is no longer being used by the EDIT CDM-Server._
194 28 Andreas Kohlbecker
195
196 25 Andreas Kohlbecker
197 1 Andreas Kohlbecker
### API Service
198
199
200 36 Andreas Kohlbecker
The are a clean RESTful webservice, which will expose data in a modular, normalized way. 
201 1 Andreas Kohlbecker
202 36 Andreas Kohlbecker
It is a more-or-less one-to-one concordance between URIs and service api methods. 
203 1 Andreas Kohlbecker
204 36 Andreas Kohlbecker
Due to its generic architecture the URIs are also generic and follow a common pattern which is repeated in each controller. 
205 1 Andreas Kohlbecker
206 39 Andreas Kohlbecker
In the following the generic URIs are documented first followed by type specific implementations. The pathelement {base-type} is frequently used in generid URIs.
207 1 Andreas Kohlbecker
208
209 38 Andreas Kohlbecker
_Valid Values for {base-type} are_:
210
211
212 36 Andreas Kohlbecker
* *agent*: Service URIs returning AgentBase or sub type entities.
213 1 Andreas Kohlbecker
214 36 Andreas Kohlbecker
* *description*: Service URIs returning DescriptionBase or sub type entities. 
215 1 Andreas Kohlbecker
216 36 Andreas Kohlbecker
* *feature*: Service URIs returning DescriptionBase or sub type entities
217 1 Andreas Kohlbecker
218 36 Andreas Kohlbecker
* *media*: Service URIs returning Media or sub type entities
219 1 Andreas Kohlbecker
220 36 Andreas Kohlbecker
* *name*: Service URIs returning TaxonNameBase or sub type entities
221 1 Andreas Kohlbecker
222 36 Andreas Kohlbecker
* *occurrence*: Service URIs returning SpecimenOrObservationBase or sub type entities
223
224
* *reference*: Service URIs returning ReferenceBase or sub type entities
225
226
* *taxon*: Service URIs returning TaxonBase or sub type entities
227
228
* *term*: Service URIs returning DefinedTermBase or sub type entities
229
230
231
Most services are using the **default initialisation strategy** which is:
232
233
~~~
234
"$"
235
~~~
236
237
238
#### /{datasource-name}/{base-type}/
239
240
241
Depending on the URI parameters used, this service returns either a Pager on or a List of the {base-type} entities identified by the {uuid}. 
242
243 40 Andreas Kohlbecker
The returned {base-type} instances are initialized by the _default initialisation strategy_. 
244 1 Andreas Kohlbecker
245 37 Andreas Kohlbecker
246 38 Andreas Kohlbecker
_URI Parameters to return a Pager_:
247 36 Andreas Kohlbecker
248 38 Andreas Kohlbecker
249 37 Andreas Kohlbecker
* _pageNumber_ the number of the page to be returned, the first page has the pageNumber = 1 - _optional parameter_ 
250
251 36 Andreas Kohlbecker
* _pageSize_ the maximum number of entities returned per page (can be null to return all entities in a single page) - _optional parameter_ 
252 37 Andreas Kohlbecker
253 40 Andreas Kohlbecker
* _type_  Further restricts the type of entities to be returned. If null the type mapped by {base-type} is being used. - _optional parameter_ 
254 36 Andreas Kohlbecker
255
256 38 Andreas Kohlbecker
_URI Parameters to return a List_:
257 36 Andreas Kohlbecker
258
259 41 Andreas Kohlbecker
* _start_ The offset index from the start of the list. The first entity has the index = 0 - _required parameter_ **The start parameter is used to distinguish between the List and Pager variants! ** 
260 36 Andreas Kohlbecker
261 37 Andreas Kohlbecker
* _limit_ The maximum number of entities returned. - _optional parameter_ 
262 36 Andreas Kohlbecker
263 40 Andreas Kohlbecker
* _type_ Further restricts the type of entities to return. If null the type mapped by {base-type} is being used. - _optional parameter_ 
264 36 Andreas Kohlbecker
265
266
267
#### /{datasource-name}/{base-type}/name/{uuid}
268
269
270
Get the {base-type} entity identified by the {uuid}. 
271
272
273
_Returns:_
274
275
276 40 Andreas Kohlbecker
The returned {base-type} entity is initialized by the _default initialisation strategy_. 
277 36 Andreas Kohlbecker
278
279
280
####  /{datasource-name}/{base-type}/name/{uuid}/annotation
281
282
283
Get the a Pager on the Annotations for the {base-type} entity identified by the {uuid}. 
284
285
286
_Returns:_
287
288
289
Pager on the Annotations for the {base-type} entity identified by the {uuid}. 
290
291 40 Andreas Kohlbecker
The returned {base-type} entity are initialized by the _default initialisation strategy_. 
292 1 Andreas Kohlbecker
293
294
295 44 Andreas Kohlbecker
----
296
297
298
299 43 Andreas Kohlbecker
#### /{datasource-name}/name/{name-uuid}/typeDesignations
300
301
302
Get the list of TypeDesignationBases of the TaxonNameBase instance identified by the {name-uuid}. 
303
304
305
 _Returns:_
306
307
308
a List of TypeDesignationBase entities which are initialized using the following initialization strategy: 
309
310
311
~~~
312
"$",
313
"citation.authorTeam",
314
"typifiedNames.taggedName"
315
~~~
316
317
318 42 Andreas Kohlbecker
#### /{datasource-name}/taxon/{taxon-uuid}/accepted
319
320
321
Get the set of accepted Taxon entities for a given {@link TaxonBase} entity identified by the <code>{taxon-uuid}</code>.
322
323
324
 _Returns:_
325
326 1 Andreas Kohlbecker
327 43 Andreas Kohlbecker
a set of Taxon entities which are initialized using the _default initialisation strategy_..
328 42 Andreas Kohlbecker
329
330
331 25 Andreas Kohlbecker
### Portal Service
332 28 Andreas Kohlbecker
333
334
335 35 Andreas Kohlbecker
#### /{datasource-name}/portal/name/{name-uuid}
336 28 Andreas Kohlbecker
337 35 Andreas Kohlbecker
338
The TaxonNameBase instance identified by the {name-uuid}. 
339
340
The returned TaxonNameBase is initialized by the following strategy 
341
342
343
~~~
344
~~~
345
346
347
#### /{datasource-name}/portal/name/{name-uuid}/descriptions
348
349
350
Get the list of TaxonNameDescriptions of the Name associated with the TaxonNameBase instance identified by the {name-uuid}.
351
352
353
_Returns:_
354
355
356
a List of TaxonNameDescription entities which are initialized using the following initialization strategy:
357
358
359
~~~
360
"uuid",
361
"feature",
362
"elements.$",
363
"elements.multilanguageText",
364
"elements.media.representations.parts"
365
~~~
366
367
368
#### /{datasource-name}/portal/name/{name-uuid}/typeDesignations
369
370
371
Get the list of TypeDesignationBases of the TaxonNameBase instance identified by the {name-uuid}. 
372
373
374
_Returns:_
375
376
377
a List of TypeDesignationBase entities which are initialized using the following initialization strategy:
378
379
380
~~~
381
"citation.authorTeam",
382
"typeName.$",
383
"typeName.taggedName",
384
"typeStatus.representations",
385
"typeSpecimen.media.representations.parts"
386
~~~
387
388
389
390
#### /{datasource-name}/portal/taxon/{taxon-uuid}
391
392
393
Get the TaxonBase instance identified by the {taxon-uuid}. 
394
395
The returned Taxon is initialized by the following strategy TAXON_INIT_STRATEGY 
396
397
 
398
~~~
399
"*",
400
"relationsToThisName.fromTaxon.name.taggedName",
401
"name.$",
402
"name.taggedName",
403
"name.rank.representations",
404
"name.status.type.representations",
405
"descriptions.elements.$",
406
"descriptions.elements.area",
407
"descriptions.elements.area.$",
408
"descriptions.elements.multilanguageText",
409
"descriptions.elements.media.representations.parts",
410
~~~
411
412
413 28 Andreas Kohlbecker
#### /{datasource-name}/portal/taxon/find
414
415
416
Find Taxa, Synonyms, Common Names by name, either globally or in a specific geographic area. 
417
418
419 29 Andreas Kohlbecker
_URI Parameters:_
420 1 Andreas Kohlbecker
421 29 Andreas Kohlbecker
422 33 Andreas Kohlbecker
* **query** the string to query for. Since the wildcard character '*' internally always is appended to the query string, a search always compares the query string with the beginning of a name. - _required parameter_
423 28 Andreas Kohlbecker
424 33 Andreas Kohlbecker
* **treeUuid** the UUID of a TaxonomicTree to which the search is to be restricted. - _optional parameter_
425 28 Andreas Kohlbecker
426 33 Andreas Kohlbecker
* **areas** restrict the search to a set of geographic NamedAreas. The parameter currently takes a list of TDWG area labels.  - _optional parameter_
427 28 Andreas Kohlbecker
428 33 Andreas Kohlbecker
* **page** the number of the page to be returned, the first page has the pageNumber = 1 - _optional parameter_
429 28 Andreas Kohlbecker
430 33 Andreas Kohlbecker
* **pageSize** the maximum number of entities returned per page (can be null to return all entities in a single page) - _optional parameter_
431 28 Andreas Kohlbecker
432 33 Andreas Kohlbecker
* **doTaxa** weather to search for instances of Taxon - _optional parameter_
433 28 Andreas Kohlbecker
434 33 Andreas Kohlbecker
* **doSynonyms** weather to search for instances of Synonym - _optional parameter_
435 28 Andreas Kohlbecker
436 33 Andreas Kohlbecker
* **doTaxaByCommonNames** for instances of Taxon by a common name used - _optional parameter_
437 28 Andreas Kohlbecker
438
 
439
_Returns:_
440
441
442
a pager on a list of IdentifiableEntitys initialized by the following strategy:
443
444
445
~~~
446
"*",
447
"relationsToThisName.fromTaxon.name.taggedName",
448
"name.$",
449
"name.taggedName",
450
"name.rank.representations",
451
"name.status.type.representations"
452
~~~
453 25 Andreas Kohlbecker
454
455 31 Andreas Kohlbecker
#### /{datasource-name}/portal/taxon/{taxon-uuid}/synonymy
456
457
458
Get the synonymy for a taxon identified by the {taxon-uuid}. The synonymy consists of two parts: The group of homotypic synonyms of the taxon and the heterotypic synonymy groups of the taxon. The synonymy is ordered historically by the type designations and by the publication date of the nomenclatural reference 
459
460
461
_Returns:_
462
463
464
a Map with to entries which are mapped by the following keys: "homotypicSynonymsByHomotypicGroup", "heterotypicSynonymyGroups", containing lists of Synonyms which are initialized using the following initialization strategy:
465
466
467
~~~
468 32 Andreas Kohlbecker
"synonymRelations.$",
469
"synonymRelations.synonym.$",
470
"synonymRelations.synonym.name.taggedName",
471
"synonymRelations.synonym.name.nomenclaturalReference.inBook.authorTeam",
472
"synonymRelations.synonym.name.nomenclaturalReference.inJournal",
473
"synonymRelations.synonym.name.nomenclaturalReference.inProceedings",
474
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.$",
475
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.name.taggedName",
476
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.$",
477
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.name.taggedName",
478
479
"name.homotypicalGroup.$",
480
"name.homotypicalGroup.typifiedNames.$",
481
"name.homotypicalGroup.typifiedNames.name.taggedName",
482
483
"name.homotypicalGroup.typifiedNames.taxonBases.$",
484
"name.homotypicalGroup.typifiedNames.taxonBases.name.taggedName"
485
~~~
486
487 1 Andreas Kohlbecker
488 32 Andreas Kohlbecker
#### /{datasource-name}/portal/taxon/{taxon-uuid}/accepted
489
490 1 Andreas Kohlbecker
491 42 Andreas Kohlbecker
Get the set of accepted Taxon entities for a given {@link TaxonBase} entity identified by the <code>{taxon-uuid}</code>.
492 32 Andreas Kohlbecker
493
494
 _Returns:_
495
496
497 42 Andreas Kohlbecker
a Set of Taxon entities which are initialized using the following initialization strategy:
498 32 Andreas Kohlbecker
499
500
~~~
501
"synonymRelations.$",
502
"synonymRelations.synonym.$",
503
"synonymRelations.synonym.name.taggedName",
504
"synonymRelations.synonym.name.nomenclaturalReference.inBook.authorTeam",
505
"synonymRelations.synonym.name.nomenclaturalReference.inJournal",
506
"synonymRelations.synonym.name.nomenclaturalReference.inProceedings",
507
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.$",
508
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.name.taggedName",
509
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.$",
510
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.name.taggedName",
511
512
"name.homotypicalGroup.$",
513
"name.homotypicalGroup.typifiedNames.$",
514
"name.homotypicalGroup.typifiedNames.name.taggedName",
515
516
"name.homotypicalGroup.typifiedNames.taxonBases.$",
517
"name.homotypicalGroup.typifiedNames.taxonBases.name.taggedName"
518
~~~
519
520
521
####  /{datasource-name}/portal/taxon/{taxon-uuid}/taxonRelationships
522
523
524
Get the list of TaxonRelationships for the given TaxonBase instance identified by the {taxon-uuid}. 
525
526
527
_Returns:_
528
529
530
a List of TaxonRelationship entities which are initialized using the following initialization strategy:
531
532
533
~~~
534
"$",
535
"type.inverseRepresentations",
536
"fromTaxon.sec.authorTeam",
537
"fromTaxon.name.taggedName"
538
~~~
539
540
541
#### /{datasource-name}/portal/taxon/{taxon-uuid}/nameRelationships
542
543
544
Get the list of NameRelationships of the Name associated with the TaxonBase instance identified by the {taxon-uuid}. 
545
546
547
_Returns:_
548
549
550
a List of NameRelationship entities which are initialized using the following initialization strategy:
551
552
553
~~~
554
"$",
555
"type.inverseRepresentations",
556
"fromName.taggedName"
557
~~~
558
559
560
#### /{datasource-name}/portal/taxon/{taxon-uuid}/nameTypeDesignations
561
562
563
Get the list of TypeDesignationBases of the TaxonBase instance identified by the {taxon-uuid}. 
564
565
566
_Returns:_
567
568
569
a List of TypeDesignationBase entities which are initialized using the following initialization strategy:
570
571
:
572
573
574
~~~
575
"typeSpecimen.$",
576
"typeStatus.representations",
577
"citation.authorTeam",
578
"typeName.taggedName"
579
~~~
580
581 1 Andreas Kohlbecker
582 32 Andreas Kohlbecker
#### /{datasource-name}/portal/taxon/{taxon-uuid}/descriptions
583
584
585
Get the list of TaxonDescriptions of the Taxon instance identified by the {taxon-uuid}. 
586
587
588 1 Andreas Kohlbecker
_Returns:_
589 32 Andreas Kohlbecker
590
591
a List of TaxonDescription entities which are initialized using the following initialization strategy:
592
593
594
~~~
595
"$",
596
"elements.$",
597
"elements.citation.authorTeam",
598
"elements.multilanguageText",
599
"elements.media.representations.parts"
600
~~~
601
602
603 48 Andreas Kohlbecker
#### /{datasource-name}/portal/taxon/{taxon-uuid}/media/{mime type list}/{size}[,[widthOrDuration}][,{height}]/ 
604 32 Andreas Kohlbecker
605
606
Get the list of TaxonDescriptions of the Taxon instance identified by the {taxon-uuid}. 
607
608
609
_Usage:_
610
611 48 Andreas Kohlbecker
 /{datasource-name}/portal/taxon/{taxon-uuid}/media/{mime type list}/{size}[,[widthOrDuration}][,{height}]/ 
612 32 Andreas Kohlbecker
613
 
614
_Whereas_ 
615
616
* *{mime type list}*: a comma separated list of mime types, in the order of preference. The forward slashes contained in the mime types must be replaced by a colon. Regular expressions can be used. Each media associated with this given taxon is being searched whereas the first matching mime type matching a representation always rules. 
617
618
* *{size}*,*{widthOrDuration}*,*{height}*: (not jet implemented) valid values are an integer or the asterisk '*' as a wildcard 
619
620
621
_Returns:_
622
623
624
a List of Media entities which are initialized using the following initialization strategy:
625
626
627
~~~
628
"$",
629
"elements.$",
630
"elements.citation.authorTeam",
631
"elements.multilanguageText",
632
"elements.media.representations.parts"
633 31 Andreas Kohlbecker
~~~
634 1 Andreas Kohlbecker
635
636 46 Andreas Kohlbecker
#### /{datasource-name}/portal/taxontree
637 41 Andreas Kohlbecker
638
639
Lists all available TaxonomicTrees. 
640
641
642
_Returns:_
643
644
645
A list of TaxonomicTrees initialized by the following initialization strategy:
646
647
648
~~~
649
"reference.authorTeam.titleCache"
650
~~~
651
652
653 46 Andreas Kohlbecker
#### /{datasource-name}/portal/taxontree/{tree-uuid},{rank-uuid}
654 41 Andreas Kohlbecker
655
656
Lists all TaxonNodes of the specified TaxonomicTree for a given Rank. If a branch does not contain a TaxonNode with a TaxonName at the given Rank the node associated with the next lower Rank is taken as root node. If the rank is null the absolute root nodes will be returned. 
657
658
659
_URI elements_: 
660
661
* _{tree-uuid}_ identifies the TaxonomicTree by its UUID. 
662
663
* _{rank-uuid}_ identifies the Rank by its UUID. May be left out. 
664
665
666
_Returns:_
667
668
669
A List of TaxonNode entities initialized by the following initialization strategy:
670
671
672
~~~
673
"taxon.sec", 
674
"taxon.name.taggedName"
675
~~~
676
677
678 46 Andreas Kohlbecker
####  /{datasource-name}/portal/taxontree/{tree-uuid},{rank- uuid}/{taxon-uuid}
679 41 Andreas Kohlbecker
680
681
Lists all child-TaxonNodes of the specified Taxon in the TaxonomicTree. The a given Rank is ignored in this method but for consistency reasons it has been allowed to included it into the URI. 
682
683
684
_URI elements_: 
685
686
* _{tree-uuid}_ identifies the TaxonomicTree by its UUID. 
687
688
* _{rank-uuid}_ identifies the Rank by its UUID. May be left out. 
689
690
* _{taxon-uuid}_ identifies the Taxon by its UUID. - _required_. 
691
692
693
_Returns:_
694
695
696
A List of TaxonNode entities initialized by the following initialization strategy:
697
698
699
~~~
700
"taxon.sec", 
701
"taxon.name.taggedName"
702
~~~
703
704
705 46 Andreas Kohlbecker
####  /{datasource-name}/portal/taxontree/{tree-uuid},{rank-uuid}/{taxon-uuid}/path
706 41 Andreas Kohlbecker
707
708
Provides path of TaxonNodes from the base node to the node of the specified taxon. 
709
710
711
_URI elements_: 
712
713
* _{tree-uuid}_ identifies the TaxonomicTree by its UUID. 
714
715
* _{rank-uuid}_ identifies the Rank by its UUID. May be left out. 
716
717
* _{taxon-uuid}_ identifies the Taxon by its UUID. - _required_. 
718
719
720
_Returns:_
721
722
723
A List of TaxonNode entities initialized by the following initialization strategy:
724
725
726
~~~
727
"taxon.sec", 
728
"taxon.name.taggedName"
729
~~~
730
731
732 1 Andreas Kohlbecker
### External Service
733 41 Andreas Kohlbecker
734
735
736
#### /{datasource-name}/geo/map/distribution/{taxon-uuid}
737
738
739
Assembles and returns URI parameter Strings for the EDIT Map Service. 
740
741
The distribution areas for the Taxon instance identified by the {taxon-uuid} are found and are translated into an valid URI parameter String. 
742
743
Higher level distribiution areas are expanded in order to include all nested sub-areas.