<commit_before>package nl.wur.ssb.RDFSimpleCon;

import org.apache.jena.riot.Lang;

public enum RDFFormat
{
	//"RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE", (and "TTL") and "N3
	RDF_XML, RDF_XML_ABBREV, N_TRIPLE, TURTLE, N3;
	
	public String toString()
	{
		switch(this){
			case RDF_XML: return "RDF/XML";
			case RDF_XML_ABBREV: return "RDF/XML-ABBREV";
			case N_TRIPLE: return "N-TRIPLE";
			case TURTLE: return "TURTLE";
			case N3: return "N3";
		}
		return "null";
	}
	
	public Lang getLang()
	{
		switch(this){
			case RDF_XML: return Lang.RDFXML;
			case RDF_XML_ABBREV: return Lang.RDFXML;
			case N_TRIPLE: return Lang.NT;
			case TURTLE: return Lang.TURTLE;
			case N3: return Lang.N3;
		}
		return null;	
	}
	
	public static RDFFormat getFormat(String in)
	{
		if(in.equals("RDF/XML"))
			return RDF_XML;
		if(in.equals("RDF/XML-ABBREV"))
			return RDF_XML_ABBREV;
		if(in.equals("N-TRIPLE"))
			return N_TRIPLE;
		if(in.equals("TURTLE"))
			return TURTLE;
		if(in.equals("N3"))
			return N3;		
	  throw new RuntimeException("Unknow rdf format: " + in);
	}

}<commit_msg>Added support for JSON-LD plus added recognition of file extensions<commit_after>package nl.wur.ssb.RDFSimpleCon;

import org.apache.jena.riot.Lang;

public enum RDFFormat
{
	//"RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE", (and "TTL") and "N3
	RDF_XML, RDF_XML_ABBREV, N_TRIPLE, TURTLE, N3, JSONLD;
	
	public String toString()
	{
		switch(this){
			case RDF_XML: return "RDF/XML";
			case RDF_XML_ABBREV: return "RDF/XML-ABBREV";
			case N_TRIPLE: return "N-TRIPLE";
			case TURTLE: return "TURTLE";
			case N3: return "N3";
			case JSONLD: return "JSON-LD";
		}
		return "null";
	}
	
	public Lang getLang()
	{
		switch(this){
			case RDF_XML: return Lang.RDFXML;
			case RDF_XML_ABBREV: return Lang.RDFXML;
			case N_TRIPLE: return Lang.NT;
			case TURTLE: return Lang.TURTLE;
			case N3: return Lang.N3;
			case JSONLD: return Lang.JSONLD;
		}
		return null;	
	}
	
	public static RDFFormat getFormat(String in)
	{
		if(in.equals("RDF/XML") || in.toLowerCase().equals("rdf"))
			return RDF_XML;
		if(in.equals("RDF/XML-ABBREV"))
			return RDF_XML_ABBREV;
		if(in.equals("N-TRIPLE") || in.toLowerCase().equals("nt"))
			return N_TRIPLE;
		if(in.equals("TURTLE") || in.toLowerCase().equals("ttl"))
			return TURTLE;
		if(in.equals("N3") || in.toLowerCase().equals("n3"))
			return N3;		
		if(in.equals("JSON-LD") || in.toLowerCase().equals("jsonld"))
			return JSONLD;		
	  throw new RuntimeException("Unknow rdf format: " + in);
	}

}
{'fraction_non_alphanumeric': 0.1507120253164557, 'fraction_numerical': 0.006724683544303798, 'mean_word_length': 3.807984790874525, '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': '6266768', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1083, 'n_words': 222}