<commit_before>package edu.harvard.iq.dataverse.export;

import com.google.auto.service.AutoService;
import edu.harvard.iq.dataverse.DatasetVersion;
import edu.harvard.iq.dataverse.export.spi.Exporter;
import edu.harvard.iq.dataverse.util.BundleUtil;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.logging.Logger;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;

@AutoService(Exporter.class)
public class SchemaDotOrgExporter implements Exporter {

    private static final Logger logger = Logger.getLogger(SchemaDotOrgExporter.class.getCanonicalName());

    public static final String NAME = "schema.org";

    @Override
    public void exportDataset(DatasetVersion version, JsonObject json, OutputStream outputStream) throws ExportException {
        String jsonLdAsString = version.getJsonLd();
        StringReader stringReader = new StringReader(jsonLdAsString);
        JsonReader jsonReader = Json.createReader(stringReader);
        JsonObject jsonLdJsonObject = jsonReader.readObject();
        try {
            outputStream.write(jsonLdJsonObject.toString().getBytes("UTF8"));
        } catch (IOException ex) {
            logger.info("IOException calling outputStream.write: " + ex);
        }
        try {
            outputStream.flush();
        } catch (IOException ex) {
            logger.info("IOException calling outputStream.flush: " + ex);
        }
    }

    @Override
    public String getProviderName() {
        return NAME;
    }

    @Override
    public String getDisplayName() {
        return BundleUtil.getStringFromBundle("dataset.exportBtn.itemLabel.schemaDotOrg");<commit_msg>fixing the Issue 4669<commit_after>package edu.harvard.iq.dataverse.export;

import com.google.auto.service.AutoService;
import edu.harvard.iq.dataverse.DatasetVersion;
import edu.harvard.iq.dataverse.export.spi.Exporter;
import edu.harvard.iq.dataverse.util.BundleUtil;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.logging.Logger;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;

@AutoService(Exporter.class)
public class SchemaDotOrgExporter implements Exporter {

    private static final Logger logger = Logger.getLogger(SchemaDotOrgExporter.class.getCanonicalName());

    public static final String NAME = "schema.org";

    @Override
    public void exportDataset(DatasetVersion version, JsonObject json, OutputStream outputStream) throws ExportException {
        String jsonLdAsString = version.getJsonLd();
        try (JsonReader jsonReader = Json.createReader(new StringReader(jsonLdAsString));) {
            JsonObject jsonLdJsonObject = jsonReader.readObject();
            try {
                outputStream.write(jsonLdJsonObject.toString().getBytes("UTF8"));
            } catch (IOException ex) {
                logger.info("IOException calling outputStream.write: " + ex);
            }
            try {
                outputStream.flush();
            } catch (IOException ex) {
                logger.info("IOException calling outputStream.flush: " + ex);
            }
        }
    }

    @Override
    public String getProviderName() {
        return NAME;
    }

    @Override
    public String getDisplayName() {
        return BundleUtil.getStringFromBundle("dataset.exportBtn.itemLabel.schemaDotOrg");
{'fraction_non_alphanumeric': 0.09551543389633081, 'fraction_numerical': 0.0017472335468841002, 'mean_word_length': 3.3869731800766285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '260007', 'n_tokens_mistral': 950, 'n_tokens_neox': 924, 'n_words': 192}