Table of Contents
2. The request form
http://kn.ndl.go.jp/api/sru? [Argument] = [the price]
An argument, more than one, when using, I connect by&.
http://kn.ndl.go.jp/api/sru? [Argument 1] = [the price] and [argument 2]= [the price]&.
I'm answering to the following argument with a main system. (About the argument by which abbreviation is possible, [,], when abbreviating to inside, the price of the default you fit is mentioned.).
- Indispensable." searchRetrieve" it's being drunk and supported.
- The version of SRU is designated. 1.1 or 1.2 is being supported. There is difference in how to give it the sorting condition of the search result by version 1.1 and 1.2. [1.2]
- Indispensable. A search query by the CQL form is described. It's mentioned later for details.
- The starting order of the search result can be designated at the reach of 1-1000. 
- The number of the returned search result record can be designated at the reach of 1-200. 
- When you'd like to receive "xml" as the character string which cut <,>,& etc. when I'd like to receive each record included in a search result in XML of a plastic surgery way, please designate "string". [string]
- The metadata schema in which a returned search result record is written can be chosen. Designate "dc" as output by the Simple DC form and please designate "ndlkn" as output by the NDL great earthquake archive original form respectively. [dc]
- The sorting condition of the search result can be designated. Only when designating 1.1 in version, it becomes practicable.
- The attribute of the material used for sorting can be designated. " score" (the degree of adaptation to the search query)," title" (the title of the material)," creator" (author and photographer)" please designate one from one of publisher" (publication person and opening to the public person) and "date" (photo date and opening to the public day). [score]
- It can be chosen whether it's output by an ascending order whether a sorting result is output by descending order." When designating descending order and "1" when designating 0", it's output by an ascending order. But, when designating "score" in path, it's possible to designate only 0. 
4. Search query (CQL: Contextual Query Language)
4.1. The form of the search query
query= [search formula]
A search formula is described using CQL.
A search formula, more than one, when having that, I connect by△ and△ (for△, one-byte space).
query= [search formula 1],△ and△ [search formula 2]
But, the following case is removed.
- When other reference name is connected to sortBy.I connect by△.
- When more than one reference which can be used name is connected in the identical search query.△and△It can be held and I don't go out.△or△But you can connect.
※ query and the [price] will be [search formula], so [argument] will be request Uniform Resource Locator as follows in [argument ] of request Uniform Resource Locator= a part of [the price].
An argument is case http://kn.ndl only in query. go.jp/api/sru? query= [search formula]
http://kn.ndl.go.jp/api/sru? query= [search formula 1],△ and△ [search formula 2]
When an argument besides query is included.
http://kn.ndl.go.jp/api/sru? [Argument 1] = [the price] and [argument 2]= [the price] &query= [search formula]
http://kn.ndl.go.jp/api/sru? [Argument 1] = [the price] and [argument 2]= [the price] &query= [search formula 1]△and△[Search formula 2]
4.2. The CQL item which can be designated
|Referring a name||The contents||Search formula|
|title||The title.||4.4 or 4.5 referring|
|creator||An author and a photographer.||4.4 or 4.5 referring|
|publisher||A publication person and an opening to the public person.||4.4 or 4.5 referring|
|subject||Subject and classification||4.4 or 4.5 referring|
|place||Place.||4.4 or 4.5 referring|
|from||The starting date when doing a narrow search by a date. YYYY - MM - DD It's designated by the form.|
YYYY or YYYY - MM It's possible to designate the form.
You consider YYYY to have designated YYYY-MM-01 as YYYY-01-01 and YYYY - MM in that case.
|from= [the price]|
|until||The end date when doing a narrow search by a date. YYYY - MM - DD It's designated by the form.|
YYYY or YYYY - MM The designation is also possible by the form.
You consider YYYY to have designated YYYY-MM-01 as YYYY-01-01 and YYYY - MM in that case.
|until= [the price]|
|anywhere||It's equal to a simple search.||4.5 referring|
|identifier||Identifier. The earthquake disaster ID is designated.|
The earthquake disaster ID is a part in xxxx in URL:http://kn.ndl.gojp/xxxx of a in-depth screen.
|identifier= [the price]|
|mediatype||Material designation. Material designation is designated by the price.|
The price which can be designated, 1 Documentary material and 2 Web site and 3 Picture and 4 Sound and animation , 99 Others.
|mediatype= [the price]|
|dpid||Search target data base. The repository ID is designated.||dpid= [the price]|
|language||Language. It's designated by ISO639-2 form.||language= [the price]|
|openAccess||" When designating it, "it's possible" to do web reading of 1", only data is returned.||openAccess= [the price]|
|sortBy||The reference name used for sorting is designated.|
The reference name which can be used is one of 1 of "title","creator","publisher","date" and "score".
The line order condition is ascending order sort.ascending and descending order... sort. descending.
|sortBy△ [referring a name which becomes the sorting standard]/[the line order condition]|
4.3. Search condition of each CQL item
|Referring a name||The parallel condition (^,exact)||More than one value specification||It's designated more than one times.|
|from||x (Lower limit designation)||X||X|
|until||x (The upper limit value specification)||X||X|
|anywhere||x (Partial agreement)||Circle||Circle|
|identifier||x (Perfect matching)||X||X|
|mediatype||x (Perfect matching)||X||Circle|
|dpid||x (Perfect matching)||X||Circle|
|language||x (Perfect matching)||X||Circle|
|openAccess||x (Perfect matching)||X||Circle|
4.4. Designation of the search parallel condition
Reference name As it indicates the item of the "title","creator","publisher","place","subject" in 4.3.
The parallel condition of one of the right truncation (^), the partial agreement and the perfect matching (exact) can be designated.
When not designating it, it's regarded as partial agreement.
The description method of a search formula is as follows.
Right truncation: [Reference name] =^ [price] example :title=^ tidal wave
Partial agreement: [Referring a name] = [the price] Example :title= tidal wave
Perfect matching: [Referring a name]△exact△[The price] (△HA one-byte space is same in the following) Example :title exact Tidal wave.
4.5. Designation method of more than one value
In the search query, to a reference name, the price, more than one, when I'd like to designate it, the following one of ways are used.
- More than one value specification in the identical reference valueThe price of the [more than one value specification] of presenting is possible by only something of "o".
- Reference great more than one time designation in the identical search query The price of more than one [time designation] of presenting is possible by only something of "o".
4.5.1. More than one value specification
Reference name The item of the "title","creator","publisher","place","subject","anywhere" can designate the price of the plural as search condition without repeating a reference name.
It's made the logic condition during the value, and, and, or can be chosen again, and all and any are employed as an operator which corresponds.
A description method of a search formula?
and : [referring a name],△ all" [the price] △ [The price]" example :title all " tidal wave Earthquake"
or : [referring a name]△any " [the price] △[The price]" example :title or " a tidal wave Earthquake".
4.5.2. It's designated more than one times.
Reference name In addition to "title","creator","publisher","place","subject","anywhere".
"mediatype", "dpid", "language", "openAccess"
NITSUI, since, a reference name can be used more than one times in the identical search query.
Connection between the reference names can also use△ or△ as well as△ and△.
Example 1:title= tidal wave or title= earthquake
Example 2:title= tidal wave or creator= Yamada
Example 3:title= tidal wave or title= earthquake and from=2011-03-11 and until=2011-03-30 sortBy title/sort.ascending
4.6. More than one designation of search condition
The case when the search parallel condition of the plural is used at the same time and the search parallel condition and san more than one value specification are performed at the same time makes a search query by designating a reference name more than one times.
(Example) when a character string of "volcano" is included by a line head in the title with the character string as "tidal wave" or the title.
title=^ tidal wave or title= volcano
(Example) when still a character string of "volcano" or "earthquake" is included by a line head in the title by the title with the character string as "tidal wave".
title=^ tidal wave and title any " volcanic earthquake "
5. The data return form
- The version of SRU." The price designated at the time of among the 1.1" or the "1.2" and a request is returned.
- The search result general number.
- Search result record list
- Search result record.
- XML schema of a record.
- " The price designated at the time of among the xml" or the "string" and a request is returned.
- Bibliographic information of a record.
- The order in the search result of the record.
- The starting order of the next record. When making it example : startRecord=1, maximumRecords=200, when there are more than 201 search results, it's returned as nextRecordPosition=201.
- Error message list
- The additional information which are fa sets
6. A request example and the return
I'll make the title output 2 new marks including "library" and "Sendai" by an ascending order of the title as an example of a request to SRU. The search query which shows "output by an ascending order of the title of the record which includes "library" and "Sendai" in the title"?
query=title= library and title= Sendai sortBy title/sort.ascending
Over the search query above-mentioned and the part where CQL was used and described
title= library and title= Sendai sortBy title/sort.ascending
Following Uniform Resource Locator which encoded O Uniform Resource Locator and designated "2" as the price of maximumRecords
When I do NI access, it's possible to get a record of the purpose.