Skip to content

Commit 77325fe

Browse files
authored
Merge pull request #583 from merkys/reword-filter-on-relationships
Reword filtering on relationships
2 parents 81d6b65 + d174559 commit 77325fe

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

optimade.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,18 +2317,6 @@ A filter on a nested property name consisting of two identifiers :filter-fragmen
23172317
- :filter-fragment:`identifier1` references a list of dictionaries that contain as an identifier :filter-fragment:`identifier2` and the filter matches for a flat list containing only the contents of :filter-fragment:`identifier2` for every dictionary in the list.
23182318
E.g., if :filter-fragment:`identifier1` is the list :filter-fragment:`[{"identifier2":42, "identifier3":36}, {"identifier2":96, "identifier3":66}]`, then :filter-fragment:`identifier1.identifier2` is understood in the filter as the list :filter-fragment:`[42, 96]`.
23192319

2320-
- :filter-fragment:`identifier1` references an entry type of a group of related entries each containing a property named after an identifier :filter-fragment:`identifier2` and the filter matches for a flat list containing only the values of :filter-fragment:`identifier2` properties for every related entry.
2321-
In this case, :filter-fragment:`identifier2` is restricted to the following fields:
2322-
2323-
- :field:`id`, when matching directly on the ID of the related entry.
2324-
- :field:`description`, when matching on human-readable description of the relationship.
2325-
- :field:`role`, when matching on the role of the relationship between entries (possible relationships are defined per-entry type).
2326-
- :field:`target`, which can be further nested to enable queries on the related entry's property.
2327-
2328-
Support for such queries is OPTIONAL.
2329-
E.g., :filter-fragment:`references.target.doi` is understood in the filter as the list containing values of :property:`doi` for all related entries of type :entry:`references`.
2330-
This is explained in more detail in section `Filtering on relationships`_.
2331-
23322320
The API implementation MAY allow this notation to generalize to arbitrary depth.
23332321
A nested property name that combines more than one list MUST, if accepted, be interpreted as a completely flattened list.
23342322

@@ -2357,7 +2345,7 @@ Support for queries on fields of arbitrary depth is OPTIONAL.
23572345

23582346
- Query the :endpoint:`structures` endpoint with a filter :filter-fragment:`references.id HAS ANY <list-of-IDs>`, where :filter-fragment:`<list-of-IDs>` are the IDs retrieved from the first query separated by commas.
23592347

2360-
For example, search for all structures related to a publication having DOI 10.1234/1234 could be performed with the following query:
2348+
For example, search for all structures related to a publication (described in a related references entry) having DOI 10.1234/1234 could be performed with the following query:
23612349

23622350
``/structures?filter=references.target.doi="10.1234/1234"``
23632351

0 commit comments

Comments
 (0)