The LuciadFusion data processing engine consumes data resources with associated metadata. GIS applications can use that metadata information to identify, organize, analyze, store, visualize, and query data resources. This article describes how you can use the REST API to query LuciadFusion Studio for data resources based on the associated metadata.
To allow you to search for data resources in LuciadFusion, the REST API extensively uses the RSQL specification for the definition of metadata property filters.
To get the most out of the filter REST API, it’s recommended to define custom metadata properties by following these steps.
See Create a custom property decoder for details. |
See the REST API Console and REST API documentation for more information on working with custom metadata properties using the REST API. If an instance of LuciadFusion is running, you can find them at http://localhost:8081/api/console and http://localhost:8081/api/documentation respectively.
RSQL logical and comparison operator support
The filter REST API supports a rich collection of comparison and logical operators. You can use them to create property filters to query data resources based on the defined queryable properties. See Table 1, “Supported RSQL comparison Operators” and Table 2, “Supported RSQL logical Operators” for an overview with example RSQL strings and supported property value types.
Operator | Description | Example RSQL String | Property types |
---|---|---|---|
|
Equal to. The asterisk (*) wildcard character allows for the substitution of one or more characters. |
|
|
|
Not equal to. The asterisk (*) wildcard character allows for the substitution of one or more characters. |
|
|
|
Greater than |
|
|
|
Greater than or equal |
|
|
|
Less than |
|
|
|
Less than or equal |
|
|
|
In |
|
|
|
Not in |
|
|
|
Is null |
|
|
|
Is not null |
|
|
|
Ignore case. This operator doesn’t support any of the fuzzy string/text matching. This also means that you can’t use the wildcard characters
|
|
|
|
Between |
|
|
|
Not between |
|
|
Operator | Description | Example RSQL String |
---|---|---|
|
Logical AND |
|
|
Logical OR |
|
Operator Precedence
The AND
logical operator takes precedence over OR
.
You can use a parenthesized expression to change the precedence, though, yielding whatever the contained expression yields.
Example Expression | Interpretation |
---|---|
prop1==foobar || prop1==foo && prop2==foobar |
prop1==foobar || (prop1==foo && prop2==foobar) |
prop1==foobar && prop2==foo || prop2==foobar && prop1==foo |
(prop1==foobar && prop2==foo) || (prop2==foobar && prop1==foo) |
prop1==foobar && prop2==foo && prop2==foobar || prop1==foo |
((prop1==foobar && prop2==foo) && prop2==foobar) || prop1==foo |
Fuzzy string matching
Fuzzy matching of Texts/Strings is supported through the ==
and !=
RSQL operators.
Wildcard character | Description |
---|---|
|
Represents zero or more characters. |
|
Represents a single character. |
|
Represents that the search is case-insensitive when placed at the beginning of the text or string. |
|
Represents that the character following the |
LuciadFusion metadata property categories
LuciadFusion can work with two categories of metadata properties :
-
Standard metadata properties: the properties in this category are available out-of-the-box for any data resource processed by LuciadFusion Studio.
-
Custom metadata properties: users define these metadata properties and associate them with data resources managed by LuciadFusion. See Create a custom property decoder and a custom properties definition for details on defining custom properties.
|
Here is a list of standard properties that you can use in the filter REST API:
Property | Queryable name | Example RSQL String |
---|---|---|
ID |
|
|
Creation Time |
|
|
Update Time |
|
|
File Path |
|
|
Type |
|
|
Title |
|
|
Abstract Text |
|
|
Supported property comparisons
The GET /api/data/filter
REST API endpoint supports three types of comparisons.
Comparison Type | Example RSQL String | Explanation |
---|---|---|
Comparing properties with literal values |
|
The left operand is a property name, the right operand is a literal value. The value of the property referred to by the left operand will be compared to the literal value of the right operand. The
property name expression |
Comparing properties with other properties |
|
The left operand is a property name, and the right operand is a property name expression. The value of the property referred to by the left operand will be compared to the value of the property name expression of the right operand. |
Comparing properties with a both literal values and other properties |
|
This approach is a mix of previous approaches where the left operand is a property name, and the right hand side is a list of operands of one or more property name expressions and one or more literal value that are to be compared. |
In a |
Sample querying example
This example shows how you can use the GET /api/data/filter
endpoint to search for LuciadFusion data resources with a custom property prop1
and a standard property lfn.creationTime
. The properties are part of an RSQL query string to retrieve the matching data resources.
Sample RSQL query string used: (prop1=gt=10);(lfn.creationTime=gt=2022-11-09T00:00:00+05:30)
Step 1 |
Launch the REST API console at http://localhost:8081/api/console |
Step 2 |
Expand the |
Step 3 |
Click the Try it out button to enable the user interaction with the REST API console. |
Step 4 |
Fill in the query parameters. |
-
page: the page of the returned response.
-
pageSize: the maximum number of results on each page as part of the response.
-
rsqlQuery: the RSQL query string for filtering data resources based on queryable properties.
-
sortBy: the order of the results returned as part of the response. The result can be sorted by attributes such as
title
,type
,creationTime
andupdateTime
. -
sortOrder: the order in which results are sorted. The possible values can be ascending (
ASC
) or descending (DESC
).
Step 5 |
Click the The sample response is: |