filter parameter
- Last Updated: May 29, 2026
- 3 minute read
- Semaphore
- Documentation
You can use the filter parameter to restrict the set of objects returned by the concepts server. For instance,
If you want to return only concepts with a Cospar Id, then you can add a filter in to select them, i.e.
http://<<Base URL>>/models/SpaceMissions/concepts?limit=3&filter=altLabels/propertyUri="http%3A%2F%2Fmodels.smartlogic.com%2FSpaceMissions%23cosparId"&extracts=id,alternativeLabels[./propertyUri="http%3A%2F%2Fmodels.smartlogic.com%2FSpaceMissions%23cosparId"]
which returns
[{
"id" : "3c954707-cd33-4c60-b14d-f765cf936370",
"alternativeLabels" : [ {
"propertyUri" : "http://models.smartlogic.com/SpaceMissions#cosparId",
"value" : "2019-011A",
"lang" : "en"
} ]
},{
"id" : "1967c914-aed4-44e4-a107-4239e7abc77b",
"altLabels" : [ {
"propertyUri" : "http://models.smartlogic.com/SpaceMissions#cosparId",
"value" : "2007-008A",
"lang" : ""
} ]
},{
"id" : "6c5e6b3d-19f3-4791-9695-c98b76579cec",
"alternativeLabels" : [ {
"propertyUri" : "http://models.smartlogic.com/SpaceMissions#cosparId",
"value" : "1998-047A",
"lang" : ""
} ]
}]
If you want to filter to return only the concepts with an alternative label with a particular value, then
<<Base URL>>/models/SpaceMissions/concepts?limit=10&filter=altLabels/value="1971-063A"&extracts=prefLabels[./lang=%22en%22]
will give you the preferred label in English, of any concept which has an alternative label with value “1971-063A”
The filtering is done by defining the particular path within the JSON that is to match. Further details are given below
Filter by identifier
To request particular concepts, you can use the full rest URL with no parameters
http://<<Base URL>>/models/SpaceMissions/concepts/<<Identifier of Concept>>
for instance
http://<<Base URL>>/models/SpaceMissions/concepts/d6d0f340-fac0-44c8-8ec9-9140cfb53c97
However, you can also use the filter to get the same data.
http://<<Base URL>>/models/SpaceMissions/concepts?filter=id="<<Identifier of concept>>"
This method becomes more relevant when you actually want multiple concepts returned by identifier, viz
http://<<Base URL>>/models/SpaceMissions/concepts?filter=id="d6d0f340-fac0-44c8-8ec9-9140cfb53c97" or id="1a872cb8-61f1-456e-8238-c03c54e450e3"
Filter by URI
To request particular concepts, you can use the full rest URL with no parameters
http://<< Base URL>>/models/SpaceMissions/concepts?filter=uri="<<URL encoded URI of concept>>"
for instance
http://<< Base URL>>/models/SpaceMissions/concepts?filter=uri="http%3A%2F%2Fmodels.smartlogic.com%2FSpaceMissions%23POIs"
Filter by type
Filter the results list to concepts of a particular class
filter=typeUris="<<URL encoded URI of selected class>"
for instance
filter=typeUris="http%3A%2F%2Fmodels.smartlogic.com%2FSpaceMissions%23Astronaut"
Filter by Preferred Label
There are a number of ways of filtering by preferred label, the simplest is just to match on a particular label value, for instance
http://<<Base URI>>/models/SpaceMissions/concepts?filter=prefLabels/value=%22Neil%20Armstrong%22
Note, there are many filterOptions values that you can use to tune this matching process.
If you want to match a particular preferred label value in a particular language, then
http://<<Base URI>>/models/SpaceMissions/concepts?filter=prefLabels[value="Soyuz 19" and lang="en"]
Filter by Alternative Label
Filtering by alternative label is very similar to filtering by preferred label, for instance
http://<<Base URI>>/models/SpaceMissions/concepts?filter=altLabels/value=%22moon%20buggy%22
However, with the alternative labels you can specify the type of alternative label, for instance
http://<<Base URL>>/models/SpaceMissions/concepts?filter=altLabels[propertyUri="http://models.smartlogic.com/SpaceMissions%23cosparId" and value="1975-065A"]
Filter by Metadata Value
The structure of metadata filtering is very similar to that for labels, but for instances
http://<<Base URI>>/models/SpaceMissions/concepts?filter=metadata[value="http://www.wikidata.org/entity/Q1724109" and propertyUri="http%3A%2F%2Fmodels.smartlogic.com%2FSpaceMissions%23Wikidata-URI"]
will return all concepts that have their Wikidata URI set to http://www.wikidata.org/entity/q1724109.
Note, internally dates and integers are stored as strings, so
http://<<Base URL>>/models/SpaceMissions/concepts?filter=metadata[value="1975-07-15" and propertyUri="http://models.smartlogic.com/SpaceMissions%23launch_date"]
Returns the concepts with a launch date of 15th July 1975. </code>
Filter by relationship
Again the structure for relation filters means specifying the values within the related object. So
http://<<Base URI>>/models/SpaceMissions/concepts?filter=broaderConcepts/objectId="e28a2406-dff0-49aa-82d9-9a5fb7bc8cd1"
returns all the concepts that have the concept with the identifier “e28a2406-dff0-49aa-82d9-9a5fb7bc8cd1” as a broader concept.
Filter by path - get descendant terms
If you want to return all concepts with a particular concept higher in their hierarchy, you can use a paths filter. For instance
http://<<Base URI>>/models/SpaceMissions/concepts?filter=paths/objectId="e28a2406-dff0-49aa-82d9-9a5fb7bc8cd1"
will return all concepts lower in the hierarchy than “e28a2406-dff0-49aa-82d9-9a5fb7bc8cd1”