Add query parameters
You can add query parameters as required by using the following instructions.
Sorting the results
Use the query parameters orderMetric and order to sort entries of a result set.
orderMetricUse this parameter to specify by what metric you want to sort the result list. Valid values depend on the model that you are using:
For the resource model:
- RESOURCE_ID
- RESOURCE_CREATION_DATE
- RESOURCE_LAST_MODIFIED_DATE
- RESOURCE_TYPE_SCHEMA
- RESOURCE_SCHEME_SPECIFIC_PART
- RESOURCE_URI
- RESOURCE_TITLE
For the tag model:
- TAG_ID
- TAG_CREATION_DATE
- TAG_LAST_MODIFIED_DATE
- TAG_LOCALE
- TAG_NAME
- TAG_RESOURCE_ID
- TAG_OWNER_ID
- TAG_SCOPE
For the tag space model:
- TAG_SPACE_COUNT_REVERSE_NAME. Default.
- TAG_SPACE_NAME
- TAG_SPACE_COUNT
- TAG_SPACE_CREATION_DATE
- TAG_SPACE_LAST_MODIFIED_DATE
- TAG_SPACE_COUNT_NAME
For the rating model:
- RATING_ID
- RATING_CREATION_DATE
- RATING_LAST_MODIFIED_DATE
- RATING_VALUE
- RATING_RESOURCE_ID
- RATING_OWNER_ID
- RATING_SCOPE
For the rating space model:
- RATING_SPACE_VALUE
- RATING_SPACE_COUNT
- RATING_SPACE_CREATION_DATE
- RATING_SPACE_LAST_MODIFIED_DATE
order=ASC|DESCUse this parameter to specify whether you want to sort in ascending or descending order. Valid values are ASC and DESC.
Example:tm:ts:all&orderMetric=TAG_SPACE_COUNT_NAME&order=ASCThis returns a feed that contains all available tag spaces, that is all available tags and their names and counts. The results are sorted in ascending order, first by tag count, and, if counts are equal, by tags name.
Limiting the results
You can use the query parameters start-index and max-results to limit the query results in the feed to a subset.
start-indexUse this parameter to specify the first item from the overall result set that you want to have returned.
max-resultsUse this parameter to specify how many additional items after the start item you want to have returned.
Examples:uri=tos:typeahead&term=A&max-results=10
- This example returns a feed that contains at the most the first 10 elements of the result.
uri=tos:typeahead&term=A&start-index=20&max-results=10
- This example returns a feed that contains at the most 10 elements, starting with the 20th element from the result.
tm:name:tag_name&start-index=5&max-results=5
- This example returns a feed that contains 5 tag entries of the overall result set that match the name tag_name, leaving out the first four results, and returning the following 5 tag entries.
Use scopes
Users can apply both tags and ratings as community tags or personal tags, either public or private. For details refer to the topic about how tagging and rating works in the portal. To control whether you query only community or personal tags or ratings, or both types of tags or ratings, use the parameter scope. Valid values are as follows:
For tagging:COMMUNITY
Use this value to return only community tags.
PERSONAL_PRIVATEUse this value to return only personal private tags.
PERSONAL_PUBLICUse this value to return only personal public tags.
PERSONALUse this value to return all personal tags, both public and private. This has the same effect as using the scope parameter with both values PERSONAL_PRIVATE and PERSONAL_PUBLIC .
ALLUse this value to return all tags, community tags, and personal public and private tags. This has the same effect as using the scope parameter with multiple values PERSONAL_PRIVATE , PERSONAL_PUBLIC, and COMMUNITY .
Valid combinations of values are as follows:
- COMMUNITY and PERSONAL
- COMMUNITY and PERSONAL_PRIVATE
- COMMUNITY and PERSONAL_PUBLIC
- COMMUNITY and PERSONAL_PUBLIC and PERSONAL_PRIVATE
- PERSONAL_PUBLIC and PERSONAL_PRIVATE
For rating:COMMUNITY
Example:Use this value to return only community ratings.
PERSONAL_PRIVATEUse this value to return only personal private ratings.
PERSONAL_PUBLICUse this value to return only personal public ratings.
PERSONALUse this value to return all personal ratings, both public and private. This has the same effect as using the scope parameter with both values PERSONAL_PRIVATE and PERSONAL_PUBLIC .
ALLUse this value to return all ratings, community ratings, and personal public and private ratings. This has the same effect as using the scope parameter with multiple values PERSONAL_PRIVATE , PERSONAL_PUBLIC, and COMMUNITY .
Valid combinations of values are as follows:
- COMMUNITY and PERSONAL
- COMMUNITY and PERSONAL_PRIVATE
- COMMUNITY and PERSONAL_PUBLIC
- COMMUNITY and PERSONAL_PUBLIC and PERSONAL_PRIVATE
- PERSONAL_PUBLIC and PERSONAL_PRIVATE
tm:ts:all&scope=COMMUNITY&scope=PERSONAL_PUBLICThis returns a feed that contains all available tag spaces with community tags and the public tags of the current user.
Locale sensitive queries
You can specify that you want to search only a specific locale or set of locales. This can be useful when you work with URIs that address tags by their name locales. To do this, use the parameter locale. Examples:tm:name:tag_name&locale=deThis returns a feed that contains all tags that match the name tag_name in the locale de.
tm:name:tag_name&locale=de&locale=enThis returns a feed that contains all tags that match the name tag_name in the locale de or en.
Parent
The REST API
How tagging and rating works in the portal