Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad committed Oct 28, 2024
1 parent d66ac9b commit 2582602
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ private void parse(InputStream in, Reader reader, String baseURI)
BasicParserSettings.FAIL_ON_UNKNOWN_LANGUAGES);
}

assert checkSupportedRioSettings(getParserConfig());

boolean secureMode = getParserConfig().get(JSONLDSettings.SECURE_MODE);
Set<String> whitelist = getParserConfig().get(JSONLDSettings.WHITELIST);
boolean documentLoaderCache = getParserConfig().get(JSONLDSettings.DOCUMENT_LOADER_CACHE);
Expand Down Expand Up @@ -273,24 +271,6 @@ public Literal createLangString(String value, String lang) {
}
}

private boolean checkSupportedRioSettings(RioConfig config) {
Map<RioSetting<Object>, Object> settings = config.getSettings();

for (RioSetting<Object> objectRioSetting : settings.keySet()) {
if (objectRioSetting.equals(BasicParserSettings.PROCESS_ENCODED_RDF_STAR))
continue;
if (objectRioSetting.equals(BasicWriterSettings.ENCODE_RDF_STAR))
continue;
if (objectRioSetting.equals(BasicWriterSettings.BASE_DIRECTIVE))
continue;

assert getSupportedSettings().contains(objectRioSetting) : "Setting " + objectRioSetting.getKey()
+ " is not supported.";
}

return true;
}

/**
* This method is overridden by the NDJSONLDParser
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.RDFHandlerException;
import org.eclipse.rdf4j.rio.RioConfig;
import org.eclipse.rdf4j.rio.RioSetting;
import org.eclipse.rdf4j.rio.WriterConfig;
import org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter;
import org.eclipse.rdf4j.rio.helpers.BasicParserSettings;
import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings;
import org.eclipse.rdf4j.rio.helpers.StatementCollector;

Expand Down Expand Up @@ -150,8 +148,6 @@ public void endRDF() throws RDFHandlerException {
JsonLdOptions opts = new JsonLdOptions();
WriterConfig writerConfig = getWriterConfig();

assert checkSupportedRioSettings(writerConfig);

if (writerConfig.get(JSONLDSettings.HIERARCHICAL_VIEW)) {
throw new UnsupportedOperationException(
"Hierarchical view is not supported by this JSON-LD processor. Use org.eclipse.rdf4j.rio.jsonld.legacy.JSONLDWriter instead.");
Expand Down Expand Up @@ -300,24 +296,6 @@ public int size() {
}
}

private boolean checkSupportedRioSettings(RioConfig config) {
Map<RioSetting<Object>, Object> settings = config.getSettings();

for (RioSetting<Object> objectRioSetting : settings.keySet()) {
if (objectRioSetting.equals(BasicParserSettings.PROCESS_ENCODED_RDF_STAR))
continue;
if (objectRioSetting.equals(BasicWriterSettings.ENCODE_RDF_STAR))
continue;
if (objectRioSetting.equals(BasicWriterSettings.CONVERT_RDF_STAR_TO_REIFICATION))
continue;

assert getSupportedSettings().contains(objectRioSetting) : "Setting " + objectRioSetting.getKey()
+ " is not supported.";
}

return true;
}

private JSONLDMode mapJsonLdMode(Object jsonldMode) {
if (jsonldMode instanceof JSONLDMode) {
return (JSONLDMode) jsonldMode;
Expand Down

0 comments on commit 2582602

Please sign in to comment.