/** * Compaction Algorithm * * http://json-ld.org/spec/latest/json-ld-api/#compaction-algorithm * * @param activeCtx * The Active Context * @param activeProperty * The Active Property * @param element * The current element * @return The compacted JSON-LD object. * @throws JsonLdError * If there was an error during compaction. */ public Object compact(Context activeCtx, String activeProperty, Object element) throws JsonLdError { return compact(activeCtx, activeProperty, element, JsonLdOptions.DEFAULT_COMPACT_ARRAYS); }
/** * Compaction Algorithm * * http://json-ld.org/spec/latest/json-ld-api/#compaction-algorithm * * @param activeCtx * The Active Context * @param activeProperty * The Active Property * @param element * The current element * @return The compacted JSON-LD object. * @throws JsonLdError * If there was an error during compaction. */ public Object compact(Context activeCtx, String activeProperty, Object element) throws JsonLdError { return compact(activeCtx, activeProperty, element, true); }
/** * Compaction Algorithm * * http://json-ld.org/spec/latest/json-ld-api/#compaction-algorithm * * @param activeCtx * The Active Context * @param activeProperty * The Active Property * @param element * The current element * @return The compacted JSON-LD object. * @throws JsonLdError * If there was an error during compaction. */ public Object compact(Context activeCtx, String activeProperty, Object element) throws JsonLdError { return compact(activeCtx, activeProperty, element, JsonLdOptions.DEFAULT_COMPACT_ARRAYS); }
activeCtx = activeCtx.parse(context); Object compacted = new JsonLdApi(opts).compact(activeCtx, null, flattened, opts.getCompactArrays()); if (!(compacted instanceof List)) {
activeCtx = activeCtx.parse(context); Object compacted = new JsonLdApi(opts).compact(activeCtx, null, flattened, opts.getCompactArrays()); if (!(compacted instanceof List)) {
activeCtx = activeCtx.parse(context); Object compacted = new JsonLdApi(opts).compact(activeCtx, null, flattened, opts.getCompactArrays()); if (!(compacted instanceof List)) {
final Object compactedItem = compact(activeCtx, activeProperty, item, compactArrays); final Map<String, Object> compactedValue = (Map<String, Object>) compact( activeCtx, "@reverse", expandedValue, compactArrays); Object compactedItem = compact(activeCtx, itemActiveProperty, isList ? list : expandedItem, compactArrays);
activeCtx = activeCtx.parse(context); Object compacted = new JsonLdApi(opts).compact(activeCtx, null, expanded, opts.getCompactArrays());
activeCtx = activeCtx.parse(context); Object compacted = new JsonLdApi(opts).compact(activeCtx, null, expanded, opts.getCompactArrays());
final Object compactedItem = compact(activeCtx, activeProperty, item, compactArrays); final Map<String, Object> compactedValue = (Map<String, Object>) compact( activeCtx, JsonLdConsts.REVERSE, expandedValue, compactArrays); Object compactedItem = compact(activeCtx, itemActiveProperty, isList ? list : expandedItem, compactArrays);
final Object compactedItem = compact(activeCtx, activeProperty, item, compactArrays); final Map<String, Object> compactedValue = (Map<String, Object>) compact( activeCtx, JsonLdConsts.REVERSE, expandedValue, compactArrays); Object compactedItem = compact(activeCtx, itemActiveProperty, isList ? list : expandedItem, compactArrays);
activeCtx = activeCtx.parse(context); Object compacted = new JsonLdApi(opts).compact(activeCtx, null, expanded, opts.getCompactArrays());
final Context activeCtx = api.context.parse(((Map<String, Object>) frame).get("@context")); Object compacted = api.compact(activeCtx, null, framed); if (!(compacted instanceof List)) { final List<Object> tmp = new ArrayList<>();
JsonLdUtils.pruneBlankNodes(framed); Object compacted = api.compact(activeCtx, null, framed, opts.getCompactArrays()); final Map<String, Object> rval = activeCtx.serialize(); final boolean addGraph = ((!(compacted instanceof List)) && !opts.getOmitGraph());
JsonLdUtils.pruneBlankNodes(framed); Object compacted = api.compact(activeCtx, null, framed, opts.getCompactArrays()); final Map<String, Object> rval = activeCtx.serialize(); final boolean addGraph = ((!(compacted instanceof List)) && !opts.getOmitGraph());