...
Name | Type |
| Used in condition | Currently implemented |
condition | string | A condition consists of a metadata element name followed directly by an operator, followed directly by a value. Valid element names are (TBD) : fedora_id, modified, created, content_size, mime_type, rdf_type Valid operators are: =, >, <, =>, <= A search URI may specify one or more conditions | N | |
fields | string | A comma separated list of fields to be returned in the search results | N | |
max_results | int | Maximum number of results to return in a single “page” | N | |
offset | int | The offset of the first result in the page. The field is used in conjunction with max_results in order to present paged results. | N | |
order_by | string | Field name to order the query by | N | |
order | string | asc or desc | N | |
format | string | The format of the results. Valid values are:
| N | |
modified | date string : Rfc 8601 | The modification date: eg 2020-05-01T20:05:14+00:00 | Y | |
created | date string : Rfc 8601 | The creation date: eg 2020-05-01T20:05:14+00:00 | Y | |
sha1 | string | The SHA-1 of the resource | Y | |
md5 | string | The MD5 of the resource | Y | |
rdf_type | string (URI) | The URI or abbreviated string representing the RDF type. Here are some examples: http://www.w3.org/ns/ldp#NonRDFSource ldp:NonRDFSource http://www.w3.org/ns/ldp#RDFSource ldp:RDFSource | Y | |
mime_type | string | The mimetype | Y | |
fedora_id | string (URI) | The fedora resource ID*. Given the resource http://localhost:8080/rest/resource1 , you may format this condition in the following three ways: fedora_id= resource1 fedora_id= /resource1 fedora_id= info:fedora/resource1 fedora_id= http://localhost:8080/rest/resource1 | Y | |
ocfl_id | string | The OCFL Object ID* | Y | |
content_size | int | The size of a resource in bytes | Y | |
ancestor | URI | URI of the ancestral resource | Y | |
ancestors | boolean | Used in conjunction with the fedora_id field. When set to true, display the ancestors. | N | |
depth | int | Indicates the depth of recursive descendents query queries. 1 would indicate just the immediate children, 2 grandchildren, 3 great-grandchildren, and so on. | N | |
descendants | boolean | Used in conjunction with the fedora_id field. When set to true, display the descendants. | Y |
...
fedora_id=/myresource where "fedora_id" is the field, "=" is the operator and "/myresource" is the object. If you specify more than one condition parameter, the query parser will assume a logical AND operator operator connects them. So if you have the following two conditions
fedora_id=/myresource*
mime_type=image/*
fedora Fedora will understand this to signify "all resources where the fedora id starts with /myresource and and matching resources have any image/* mime-type.
Wild Cards
The star wild-card signifier (*) can be used in conditions for simple string matching.
...
GET http://localhost:8080/fcrepo/rest/fcr:search ?condition=fedora_id%3D*
List
...
grandchildren of resource x
Query param value: ancestor=/resource1
GET http://localhost:8080/fcrepo/rest/fcr:search ?condition=ancestor%3Dfedora_id%3D/resource1&descendents=true&depth=2
List all ancestors of resource x
GET http://localhost:8080/fcrepo/rest/fcr:search ?condition=fedora_id%3D/my/fedora/resource1&conditionancestors=ancestors%3Dtruetrue
List
...
fedora id, mime_types for resources where content_size > 1 megabyte.
GET http://localhost:8080/fcrepo/rest/fcr:search ?condition=fedoracontent_id%3Dsize%3E/my/fedora/resource1&condition=descendants%3Dtrue&return_fields=fedora_id,mime_type
...