function tripal_get_remote_content_context
3.x tripal_ws.api.inc | tripal_get_remote_content_context($site_id, $context_url, $bundle_accession, $field_accession = '') |
Retrieves the JSON-LD context for a bundle or field on a remote Tripal site.
The $site_id, $bundle_accession and $field_accession variables are not needed to retrieve the context, but are used for caching the context to make subsequent calls execute faster. This function is meant to be used only for the 'content' service provided by Tripal.
Parameters
$site_id: The numeric site ID for the remote Tripal site.
$context_url: The Full URL for the context file on the remote Tripal site. This URL can be found in the '@context' key of any response from a remote Tripal web services call.
$bundle_accession: The controlled vocabulary term accession for the content type on the remote Tripal site.
$field_accession: The controlled vocabulary term accession for the property (i.e. field) of the Class (i.e. content type).
Return value
The JSON-LD context mapping array.
Related topics
- tripal_load_remote_entities in tripal_ws/
api/ tripal_ws.api.inc - Queries a remote site for an array of bulk entity ids.
- tripal_load_remote_entity in tripal_ws/
api/ tripal_ws.api.inc - Queries a remote site for an entity.
File
- tripal_ws/
api/ tripal_ws.api.inc, line 346 - This file provides the Tripal Web Services API: a set of functions for interacting with the Tripal Web Services.
Code
function tripal_get_remote_content_context($site_id, $context_url, $bundle_accession, $field_accession = '') {
$cache_id = substr('trp_ws_context_' . $site_id . '-' . $bundle_accession . '-' . $field_accession, 0, 254);
$context = tripal_get_remote_context($context_url, $cache_id);
return $context;
}