Local Information About Entities and Relationships
The offline store exposes information about whether or not entities and relationships are local.
During a read request, information about whether or not an entity or relationship is local is returned as an instance annotation; com.sap.vocabularies.Offline.v1.islocal is set to true. If the entity is not local, the annotation is note returned.
If an $expand is used, and an entity is included in the result because a locally modified relationship was expanded, an annotation for that entity shows that com.sap.vocabularies.Offline.v1.fromlocalrelationship is set to true. If the entity was expanded due to a relationship that is no local, this annotation is not returned.
Filtering on Local Information
The sap.islocal() built-in $filter function enables entities and relationships to be filtered based on whether they are local.
- The islocal function cannot be applied to expanded items. For example, ~/Customers?$expand=Orders&$filter=sap.islocal() returns all local Customers and all their Orders (not just their local Orders).
- You cannot use the islocal function to filter relationships when doing expands. For example, it cannot be used to ask, “Give me all Customers and expand only local relationships to Orders”.