Morphbank Services - services.morphbank.net/mb3/
services.morphbank.net/mb3/ makes it possible for anyone to query the Morphbank database. In essence, it is analogous to a Keyword search query in the My Manager interface of Morphbank. The services page lets users construct the query of their choice, selecting what to look for and in what format the output appears. For example, anytime after submitting data and images to Morphbank, a Morphbank Contributor can use the services.morphbank.net/mb3/ interface to return Morphbank Ids for building links. Details about how to find and use services are next.
Services are found at services.morphbank.net/mb3/
- The application programming interface (API) for services.morphbank.net/mb3/ describes how the query is put together and reveals what search combinations are possible.
- The results of a services query may be output in XML using the Morphbank Schema.
Parts of a Service Request
In the screen shot above, there are 4 sections to constructing a services request and each section has various choices available.- Choose a search method: the user may choose from 5 options including:
- Keyword search: When choosing this search method, the keywords to search by are entered in the Other parameters section in the Keywords field.
- Find an object by its Morphbank identifier: If an identifier is known, the data and metadata about the item can be retrieved using this identifier. Select this search method and then enter the Morphbank identifier in the Other parameters section in the Morphbank or external id field.
- Taxonomic name search: To search the Morphbank database by taxon name, choose this search method and enter the taxon name in the Taxonomic name field in the Other parameters section of this page.
- Recently changed objects: This option gives users a way to query the database for only the newest or most recently modified objects. When selecting this option, use it in combination with the Beginning change date and End change date or Leave beginning date blank for most recent changes, enter number of days fields in the Other parameters section.
- Find an object by its external identifier: If Morphbank Contributors provided GUIDs for their objects in Morphbank, one can search for them using this id. Choose this option and then enter this external id in the Morphbank or external id field in the Other parameters section.
- Select object type(s).Data is associated with various objects in Morphbank. The user may wish to search data associated with Images or Specimens, or both perhaps. Check the objects of interest.
- Other parameters. These fields are used in combination with each other and with the other sections of this query constructor.
- Keywords: enter terms to be included in a keyword search.
- Geolocated items only: use this to limit the result set to image objects in Morphbank that have latitude and longitude information provided.
- Maximum number of results: in case of a possible large result set, use this to limit the number of records returned.
- Offset to first result
- User id: Using a Morphbank User id, the search can be limited to objects associated with a given user / contributor.
- Group id: as with User id, objects in Morphbank are associated with a given Morphbank Group. Using the Group id, the search
- Beginning change date as mm/dd/yy: Use this with the next field to limit search to objects changed in a given time frame. It is used with the search method Recently changed objects.
- End change date as mm/dd/yy: Use this with the above field to limit search to objects changed in a given time frame. It is used with the search method Recently changed objects.
- Leave beginning date blank for most recent changes,: Use this with the search method Recently changed objects to limit the search result set to objects changed in a specified number of days. For example, one might want to find out what is new in Morphbank for the last 5 days. This search can be added as an RSS feed and initiated at a click.
- Morphbank or external id: If a user needs / wants information for a specific Morphbank object and knows the Morphbank id or the external id (GUID), enter the id in this field and check Find an object by its Morphbank identifier in the Choose a search method section.
- Taxonomic name: Enter a taxon name here to find information about any objects in Morphbank associated with this taxon name. This field is used with the Taxonomic name search option in the Choose a search method section.
- Choose an output format: Here the query output type is selected. A user may only want Morphbank ids or an RSS feed for a given query. Some users may need the data returned in XML format. Other options include seeing the geolocated items via Google Maps and outputting the data in Morphbank XML Schema.
- IDs only in XML: outputs ids only, in XML format.
- XML using schema http://morphbank.net/schema/mbsvc3.xsd returns data in XML format that matches the current Morphbank schema.
- Thumbnail page: Using this option, Morphbank users see thumbnails of objects and a link to Google with the objects mapped.
- Basic information in XML
- RSS feed: Once a particular query is created, it can be saved and run again anytime a user desires. This is basically what an RSS feed does. If a user selects this option, an icon is saved to their Browser toolbar (for example) and they can carry out the services request by simply clicking the icon.
- Detailed information in RDF: outputs the data in Resource Description Framework (RDF) format.
A Service Request Revealed
Once a user chooses options from above and clicks Submit, a services request is sent to the database and results returned in the desired format. Each part of the request can be seen in the brower's URL display. Here is a simple example:- Choose a search method: Keyword search
- Select object type(s): Image
- Other parameters: Keywords: Magnolia acuminata fruit
Leave other fields in this section as is. - Choose an output format: Ids only in XML
- Click Submit (see results in screen shot):
Using the IDs returned
In the above example, a user wants to find out if Morphbank has any images of Magnolia acuminata fruit. The search request via services returns 3 Image Ids. On any web site the user may be building, these ids can be embedded in any web pages to construct a dynamic URL link to the images. For the 3 Ids returned, the user can construct links to the data about the image or to the image itself as shown in the following URLs. Note the formats of the URLs.- http://www.morphbank.net/?id=466838
- Returns the Image Record Show page from Morphbank which has a 400 px width image embedded and displays any data about the image.
- http://www.morphbank.net/?id=466838&imgType=jpeg
- With &imageType=jpeg, the user can specify the version of the image to be returned. The user may choose from tiff, jpeg, jpg or thumb.
- http://www.morphbank.net/?id=466838&imgType=jpeg&imgSize=200
- Adding the &imgSize=XX parameter gives the user the flexibility to specify the width of the image to be displayed.
Next |
Contents |