static private JsonLdOptions defaultJsonLdOptions(String baseURI) { JsonLdOptions opts = new JsonLdOptions(baseURI); opts.useNamespaces = true ; // this is NOT jsonld-java's default // opts.setUseRdfType(true); // false -> use "@type" opts.setUseNativeTypes(true); // this is NOT jsonld-java's default opts.setCompactArrays(true); // this is jsonld-java's default return opts; }
@Activate protected void activate(ComponentContext ctx) { opts = new JsonLdOptions(); @SuppressWarnings("unchecked") final Dictionary<String, Object> config = ctx.getProperties(); // boolean properties opts.setUseRdfType(getState(config.get(PROP_USE_RDF_TYPE), false)); opts.setUseNativeTypes(getState(config.get(PROP_USE_NATIVE_TYPES), false)); prettyPrint = getState(config.get(PROP_PRETTY_PRINT), true); // parse the string mode final Object value = config.get(PROP_MODE); mode = value == null ? null : value.toString(); }
@Activate protected void activate(ComponentContext ctx) { opts = new JsonLdOptions(); @SuppressWarnings("unchecked") Dictionary<String,Object> config = ctx.getProperties(); //boolean properties opts.setUseRdfType(getState(config.get(PROP_USE_RDF_TYPE), false)); opts.setUseNativeTypes(getState(config.get(PROP_USE_NATIVE_TYPES), false)); prettyPrint = getState(config.get(PROP_PRETTY_PRINT),true); //parse the string mode Object value = config.get(PROP_MODE); mode = value == null ? null : value.toString(); }
@Activate protected void activate(ComponentContext ctx) { opts = new JsonLdOptions(); @SuppressWarnings("unchecked") Dictionary<String,Object> config = ctx.getProperties(); //boolean properties opts.setUseRdfType(getState(config.get(PROP_USE_RDF_TYPE), false)); opts.setUseNativeTypes(getState(config.get(PROP_USE_NATIVE_TYPES), false)); prettyPrint = getState(config.get(PROP_PRETTY_PRINT),true); //parse the string mode Object value = config.get(PROP_MODE); mode = value == null ? null : value.toString(); }
options.setUseNativeTypes((Boolean) test_opts.get("useNativeTypes"));
opts.setUseNativeTypes(getWriterConfig().get(JSONLDSettings.USE_NATIVE_TYPES));
opts.setUseNativeTypes(getWriterConfig().get(JSONLDSettings.USE_NATIVE_TYPES));
opts.setUseNativeTypes(getWriterConfig().get(JSONLDSettings.USE_NATIVE_TYPES));