String getTypeMapping(String property) { return context.getTypeMapping(property); }
private Object _toFieldValue(String term, @Nullable Object input) { Object type = context.getTypeMapping(term); if (input instanceof String && Objects.equals(type, JsonLdConsts.ID)) { // IRI input = ImmutableMap.of(type, input); } if (input != null) { return valueMapper.toFieldValue(type, input, this::isEmbedded); } else { // Scalar null return input; } }
private Stream<Object> _fromFieldValue(String term, @Nullable Object input) { // The input will be coming out of the JSON-LD API so we should only be looking at lists, maps and literals if (input instanceof List<?>) { // Recursively process list object return ((List<?>) input).stream().flatMap(e -> _fromFieldValue(term, e)); } else if (input instanceof Map<?, ?>) { // Value object or relationship return Stream.of(valueMapper.fromFieldValue((Map<?, ?>) input)); } else { String type = context.getTypeMapping(term); if (type != null && input != null) { // Compacted value return _fromFieldValue(term, ImmutableMap.of(JsonLdConsts.TYPE, type, JsonLdConsts.VALUE, input)); } else { // Scalar (including null) return Stream.of(input); } } }
final String typeMapping = getTypeMapping(activeProperty); final String languageMapping = getLanguageMapping(activeProperty); if (value.containsKey("@id")) {
final String typeMapping = getTypeMapping(activeProperty); final String languageMapping = getLanguageMapping(activeProperty); if (value.containsKey(JsonLdConsts.ID)) {
final String typeMapping = getTypeMapping(activeProperty); final String languageMapping = getLanguageMapping(activeProperty); if (value.containsKey(JsonLdConsts.ID)) {