<commit_before>package com.galactichorse;

import com.google.api.server.spi.config.*;
import com.hp.hpl.jena.rdf.model.*;
import org.apache.jena.riot.Lang;

import java.io.*;
import java.util.Collection;
import java.util.Map;

@Api(name = "ontology")
public class Ontology {
    private static final String ONTOLOGY_PATH = "WEB-INF/accessibility-ontology.ttl";
    private static final Lang ONTOLOGY_INPUT_LANGUAGE = Lang.TURTLE;
    private static final Lang ONTOLOGY_OUTPUT_LANGUAGE = Lang.JSONLD;

    @ApiMethod(name = "get", httpMethod = ApiMethod.HttpMethod.GET)
    public OntologyBean getOntologyJsonld() throws IOException {
        OntologyBean ob = new OntologyBean();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        getOntologyModel().write(baos, ONTOLOGY_OUTPUT_LANGUAGE.getLabel());
        ob.setJsonld(baos.toString());
        return ob;
    }

    public static Model getOntologyModel() throws FileNotFoundException {
        File file = new File(ONTOLOGY_PATH);
        InputStream inputStream = new FileInputStream(file);
        Model model = ModelFactory.createOntologyModel();
        model.read(inputStream, null, ONTOLOGY_INPUT_LANGUAGE.getLabel());
        return model;
    }
}

class OntologyBean {
    private String jsonld;
    private Map<String,Collection<LinkBean>> _links;

    public String getJsonld() {
        return jsonld;
    }

    public void setJsonld(String jsonld) {
        this.jsonld = jsonld;
    }
}

class LinkBean {
    private String href;
    private Boolean templated;
    private String type;
    private String deprecation;
    private String name;
    private String profile;
    private String title;
    private String hreflang;
}<commit_msg>specify ontology type<commit_after>package com.galactichorse;

import com.google.api.server.spi.config.*;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.*;
import org.apache.jena.riot.Lang;

import java.io.*;
import java.util.Collection;
import java.util.Map;

@Api(name = "ontology")
public class Ontology {
    private static final String ONTOLOGY_PATH = "WEB-INF/accessibility-ontology.ttl";
    private static final Lang ONTOLOGY_INPUT_LANGUAGE = Lang.TURTLE;
    private static final Lang ONTOLOGY_OUTPUT_LANGUAGE = Lang.JSONLD;

    @ApiMethod(name = "get", httpMethod = ApiMethod.HttpMethod.GET)
    public OntologyBean getOntologyJsonld() throws IOException {
        OntologyBean ob = new OntologyBean();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        getOntologyModel().write(baos, ONTOLOGY_OUTPUT_LANGUAGE.getLabel());
        ob.setJsonld(baos.toString());
        return ob;
    }

    public static OntModel getOntologyModel() throws FileNotFoundException {
        File file = new File(ONTOLOGY_PATH);
        InputStream inputStream = new FileInputStream(file);
        OntModel model = ModelFactory.createOntologyModel();
        model.read(inputStream, null, ONTOLOGY_INPUT_LANGUAGE.getLabel());
        return model;
    }
}

class OntologyBean {
    private String jsonld;
    private Map<String, Collection<LinkBean>> _links;

    public String getJsonld() {
        return jsonld;
    }

    public void setJsonld(String jsonld) {
        this.jsonld = jsonld;
    }
}

class LinkBean {
    private String href;
    private Boolean templated;
    private String type;
    private String deprecation;
    private String name;
    private String profile;
    private String title;
    private String hreflang;
}
{'fraction_non_alphanumeric': 0.09046941678520626, 'fraction_numerical': 0.0, 'mean_word_length': 3.525096525096525, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5042300', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1050, 'n_words': 257}