1010 *******************************************************************************/
1111package org .eclipse .rdf4j .rio .helpers ;
1212
13- import java .util .List ;
1413import java .util .Set ;
1514
1615import org .eclipse .rdf4j .rio .RioSetting ;
@@ -38,7 +37,7 @@ public class JSONLDSettings {
3837 * @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
3938 *
4039 */
41- public static final RioSetting < Boolean > COMPACT_ARRAYS = new BooleanRioSetting (
40+ public static final BooleanRioSetting COMPACT_ARRAYS = new BooleanRioSetting (
4241 "org.eclipse.rdf4j.rio.jsonld.compact_arrays" , "Compact arrays" , Boolean .TRUE );
4342
4443 /**
@@ -69,7 +68,7 @@ public class JSONLDSettings {
6968 * The JSON-LD processor will throw an exception if a warning is encountered during processing.
7069 *
7170 */
72- public static final RioSetting < Boolean > EXCEPTION_ON_WARNING = new ClassRioSetting <> (
71+ public static final BooleanRioSetting EXCEPTION_ON_WARNING = new BooleanRioSetting (
7372 "org.eclipse.rdf4j.rio.jsonld.exception_on_warning" ,
7473 "Throw an exception when logging a warning." ,
7574 Boolean .FALSE );
@@ -86,7 +85,7 @@ public class JSONLDSettings {
8685 * @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
8786 *
8887 */
89- public static final RioSetting < Boolean > OPTIMIZE = new BooleanRioSetting ("org.eclipse.rdf4j.rio.jsonld.optimize" ,
88+ public static final BooleanRioSetting OPTIMIZE = new BooleanRioSetting ("org.eclipse.rdf4j.rio.jsonld.optimize" ,
9089 "Optimize output" , Boolean .FALSE );
9190
9291 /**
@@ -102,7 +101,7 @@ public class JSONLDSettings {
102101 * @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
103102 *
104103 */
105- public static final RioSetting < Boolean > PRODUCE_GENERALIZED_RDF = new BooleanRioSetting (
104+ public static final BooleanRioSetting PRODUCE_GENERALIZED_RDF = new BooleanRioSetting (
106105 "org.eclipse.rdf4j.rio.jsonld.produce_generalized_rdf" , "Produce generalized RDF" , Boolean .FALSE );
107106
108107 /**
@@ -117,7 +116,7 @@ public class JSONLDSettings {
117116 * @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
118117 *
119118 */
120- public static final RioSetting < Boolean > USE_NATIVE_TYPES = new BooleanRioSetting (
119+ public static final BooleanRioSetting USE_NATIVE_TYPES = new BooleanRioSetting (
121120 "org.eclipse.rdf4j.rio.jsonld.use_native_types" , "Use Native JSON Types" , Boolean .FALSE );
122121
123122 /**
@@ -131,7 +130,7 @@ public class JSONLDSettings {
131130 * @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
132131 *
133132 */
134- public static final RioSetting < Boolean > USE_RDF_TYPE = new BooleanRioSetting (
133+ public static final BooleanRioSetting USE_RDF_TYPE = new BooleanRioSetting (
135134 "org.eclipse.rdf4j.rio.jsonld.use_rdf_type" , "Use RDF Type" , Boolean .FALSE );
136135
137136 /**
@@ -153,17 +152,19 @@ public class JSONLDSettings {
153152 * Can be overridden by setting system property {@code org.eclipse.rdf4j.rio.jsonld.hierarchical_view}.
154153 *
155154 */
156- public static final RioSetting < Boolean > HIERARCHICAL_VIEW = new BooleanRioSetting (
155+ public static final BooleanRioSetting HIERARCHICAL_VIEW = new BooleanRioSetting (
157156 "org.eclipse.rdf4j.rio.jsonld.hierarchical_view" , "Hierarchical representation of the JSON" , Boolean .FALSE );
158157
159158 /**
160- * Whitelist of remote/local resources that the JSON-LD parser can retrieve. Set of URIs as strings.
159+ * Whitelist of remote/local resources that the JSON-LD parser can retrieve. Set of URIs as strings. This can be
160+ * overridden by setting a system property with the key {@code org.eclipse.rdf4j.rio.jsonld_whitelist} and a JSON
161+ * array of the desired values.
161162 * <p>
162163 * Default:
163164 * {@code Set.of("http://www.w3.org/ns/anno.jsonld", "http://www.w3.org/ns/activitystreams.jsonld", "http://www.w3.org/ns/ldp.jsonld", "http://www.w3.org/ns/oa.jsonld", "http://www.w3.org/ns/hydra/context.jsonld", "http://schema.org/", "https://w3id.org/security/v1", "https://w3c.github.io/json-ld-rc/context.jsonld", "https://www.w3.org/2018/credentials/v1", "https://health-lifesci.schema.org/", "https://auto.schema.org/", "https://bib.schema.org/", "http://xmlns.com/foaf/spec/index.jsonld", "https://pending.schema.org/", "https://schema.org/", "https://schema.org/docs/jsonldcontext.jsonld", "https://schema.org/version/latest/schemaorg-current-https.jsonld", "https://schema.org/version/latest/schemaorg-all-http.jsonld", "https://schema.org/version/latest/schemaorg-all-https.jsonld", "https://schema.org/version/latest/schemaorg-current-http.jsonld", "https://schema.org/version/latest/schemaorg-all.jsonld", "https://schema.org/version/latest/schemaorg-current.jsonld", "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld", "https://geojson.org/geojson-ld/geojson-context.jsonld", "https://www.w3.org/2019/wot/td/v1");
164165 *
165166 */
166- public static final RioSetting < Set < String >> WHITELIST = new RioSettingImpl <>(
167+ public static final SetRioSetting < String > WHITELIST = new SetRioSetting <>(
167168 "org.eclipse.rdf4j.rio.jsonld_whitelist" ,
168169 "Whitelist of remote/local resources that the JSON-LD parser can retrieve. Set of URIs as strings." ,
169170 Set .of (
@@ -195,11 +196,13 @@ public class JSONLDSettings {
195196 ));
196197
197198 /**
198- * Secure mode only allows loading remote/local resources (ex. context from url) that are whitelisted.
199+ * Secure mode only allows loading remote/local resources (ex. context from url) that are whitelisted. This can be
200+ * overridden by setting a system property with the key {@code org.eclipse.rdf4j.rio.jsonld_secure_mode} and a
201+ * boolean value.
199202 * <p>
200203 * Default: true
201204 */
202- public static final RioSetting < Boolean > SECURE_MODE = new RioSettingImpl <> (
205+ public static final BooleanRioSetting SECURE_MODE = new BooleanRioSetting (
203206 "org.eclipse.rdf4j.rio.jsonld_secure_mode" ,
204207 "Secure mode only allows loading remote/local resources (ex. context from url) that are whitelisted." ,
205208 Boolean .TRUE );
@@ -211,7 +214,7 @@ public class JSONLDSettings {
211214 * <p>
212215 * Default: true
213216 */
214- public static final RioSetting < Boolean > DOCUMENT_LOADER_CACHE = new RioSettingImpl <> (
217+ public static final BooleanRioSetting DOCUMENT_LOADER_CACHE = new BooleanRioSetting (
215218 "org.eclipse.rdf4j.rio.jsonld_document_loader_cache" ,
216219 "The document loader cache is enabled by default. All loaded documents, such as remote contexts, are cached for 1 hour, or until the cache is full. The cache holds up to 1000 documents. The cache is shared between all JSONLDParsers. The cache can be disabled by setting this value to false." ,
217220 Boolean .TRUE );
0 commit comments