code: public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel, boolean isPrimitive)
              throws ODataRenderException {
          if (ODataUriUtil.isActionCallUri(oDataUri) ||
                  ODataUriUtil.isFunctionCallUri(oDataUri)) {
              return buildContextUrlFromOperationCall(oDataUri, entityDataModel, isPrimitive);
          }
  
          Option<String> contextOption = getContextUrl(oDataUri);
          if (contextOption.isEmpty()) {
              throw new ODataRenderException("Could not construct context");
          }
          return contextOption.get();
      }
docs: This method returns odata context based on oDataUri.
  Throws ODataRenderException in case context is not defined.
  
  @param entityDataModel The entity data model.
  @param oDataUri        is object which is the root of an abstract syntax tree that describes
  @param isPrimitive     True if the context URL is for primitive.
  @return string that represents context
  @throws ODataRenderException if unable to get context from url