Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1755 Revert #4580

Merged
merged 5 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @author Peter Ansell
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#features">JSONLD Features</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDMode} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public enum JSONLDMode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class JSONLDSettings {
*
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#COMPACT_ARRAYS} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<Boolean> COMPACT_ARRAYS = new BooleanRioSetting(
Expand All @@ -42,7 +41,6 @@ public class JSONLDSettings {
* If specified, it is used to retrieve remote documents and contexts; otherwise the processor's built-in loader is
* used.
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#DOCUMENT_LOADER} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<DocumentLoader> DOCUMENT_LOADER = new ClassRioSetting<>(
Expand All @@ -59,7 +57,6 @@ public class JSONLDSettings {
*
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#OPTIMIZE} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<Boolean> OPTIMIZE = new BooleanRioSetting("org.eclipse.rdf4j.rio.jsonld.optimize",
Expand All @@ -77,7 +74,6 @@ public class JSONLDSettings {
*
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#PRODUCE_GENERALIZED_RDF} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<Boolean> PRODUCE_GENERALIZED_RDF = new BooleanRioSetting(
Expand All @@ -94,7 +90,6 @@ public class JSONLDSettings {
*
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#USE_NATIVE_TYPES} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<Boolean> USE_NATIVE_TYPES = new BooleanRioSetting(
Expand All @@ -110,7 +105,6 @@ public class JSONLDSettings {
*
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#data-structures">JSONLD Data Structures</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#USE_RDF_TYPE} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<Boolean> USE_RDF_TYPE = new BooleanRioSetting(
Expand All @@ -123,7 +117,6 @@ public class JSONLDSettings {
*
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#features">JSONLD Features</a>
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#JSONLD_MODE} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<JSONLDMode> JSONLD_MODE = new RioSettingImpl<>(
Expand All @@ -136,7 +129,6 @@ public class JSONLDSettings {
* <p>
* Can be overridden by setting system property {@code org.eclipse.rdf4j.rio.jsonld.hierarchical_view}.
*
* @deprecated Use {@link org.eclipse.rdf4j.rio.jsonld.JSONLDSettings#HIERARCHICAL_VIEW} instead.
*/
@Deprecated(since = "4.3.0", forRemoval = true)
public static final RioSetting<Boolean> HIERARCHICAL_VIEW = new BooleanRioSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,11 @@ public class BinaryRDFWriterSettings {
private BinaryRDFWriterSettings() {
}

static {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to have a test for this? I am not a big fan of Java asserts....

assert VERSION.equals(org.eclipse.rdf4j.rio.helpers.BinaryRDFWriterSettings.VERSION);
assert BUFFER_SIZE.equals(org.eclipse.rdf4j.rio.helpers.BinaryRDFWriterSettings.BUFFER_SIZE);
assert CHARSET.equals(org.eclipse.rdf4j.rio.helpers.BinaryRDFWriterSettings.CHARSET);
assert RECYCLE_IDS.equals(org.eclipse.rdf4j.rio.helpers.BinaryRDFWriterSettings.RECYCLE_IDS);
}

}
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
/*******************************************************************************
* Copyright (c) 2022 Eclipse RDF4J contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/
package org.eclipse.rdf4j.rio.jsonld;

/**
* Specifies constants to identify various modes that are relevant to JSONLD documents.
*
* @author Peter Ansell
* @see <a href="http://json-ld.org/spec/latest/json-ld-api/#features">JSONLD Features</a>
*
* @since 4.3.0
*/
public enum JSONLDMode {

EXPAND("Expansion", "http://json-ld.org/spec/latest/json-ld-api/index.html#expansion"),

COMPACT("Compaction", "http://json-ld.org/spec/latest/json-ld-api/index.html#compaction"),

FLATTEN("Flattening", "http://json-ld.org/spec/latest/json-ld-api/index.html#flattening"),

;

private final String label;

private final String reference;

JSONLDMode(String label, String reference) {
this.label = label;
this.reference = reference;
}

/**
* @return Returns the label.
*/
public String getLabel() {
return label;
}

/**
* @return Returns the reference URL for the given mode.
*/
public String getReference() {
return reference;
}
}
///*******************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe delete this file instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes it much easier to revert my revert when I can simply uncomment the file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

// * Copyright (c) 2022 Eclipse RDF4J contributors.
// *
// * All rights reserved. This program and the accompanying materials
// * are made available under the terms of the Eclipse Distribution License v1.0
// * which accompanies this distribution, and is available at
// * http://www.eclipse.org/org/documents/edl-v10.php.
// *
// * SPDX-License-Identifier: BSD-3-Clause
// *******************************************************************************/
//package org.eclipse.rdf4j.rio.jsonld;
//
///**
// * Specifies constants to identify various modes that are relevant to JSONLD documents.
// *
// * @author Peter Ansell
// * @see <a href="http://json-ld.org/spec/latest/json-ld-api/#features">JSONLD Features</a>
// *
// * @since 4.3.0
// */
//public enum JSONLDMode {
//
// EXPAND("Expansion", "http://json-ld.org/spec/latest/json-ld-api/index.html#expansion"),
//
// COMPACT("Compaction", "http://json-ld.org/spec/latest/json-ld-api/index.html#compaction"),
//
// FLATTEN("Flattening", "http://json-ld.org/spec/latest/json-ld-api/index.html#flattening"),
//
// ;
//
// private final String label;
//
// private final String reference;
//
// JSONLDMode(String label, String reference) {
// this.label = label;
// this.reference = reference;
// }
//
// /**
// * @return Returns the label.
// */
// public String getLabel() {
// return label;
// }
//
// /**
// * @return Returns the reference URL for the given mode.
// */
// public String getReference() {
// return reference;
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.rdf4j.rio.RDFParser;
import org.eclipse.rdf4j.rio.RioSetting;
import org.eclipse.rdf4j.rio.helpers.AbstractRDFParser;
import org.eclipse.rdf4j.rio.helpers.JSONLDSettings;
import org.eclipse.rdf4j.rio.helpers.JSONSettings;

import com.fasterxml.jackson.core.JsonFactory;
Expand Down Expand Up @@ -105,7 +106,8 @@ public void parse(final Reader reader, final String baseURI)
/**
* Parse
*
* @param nextParser
* @param in
* @param reader
* @param baseURI
* @throws IOException
* @throws RDFParseException
Expand Down
Loading