<commit_before>package org.waag.histograph.reasoner;

import java.util.ArrayList;

public final class OntologyTokens {
	
	public static final String SAMEAS = "hg:sameAs";
	public static final String ABSORBED = "hg:absorbed";
	public static final String ISUSEDFOR = "hg:isUsedFor";
	public static final String LIESIN = "hg:liesIn";
	
	public final static String[] PRIMARY_RELATIONS = {SAMEAS, ABSORBED, ISUSEDFOR, LIESIN};
	
	private final static class AtomicInferences {
		private final static String[] ATOMIC_SAMEAS = {"hga:conceptIdentical", "hga:typeIdentical"};
		private final static String[] ATOMIC_ABSORBED = {"hga:conceptIn", "hga:periodBefore", "hga:typeIdentical", "hga:geometryIntersects"};
		private final static String[] ATOMIC_ISUSEDFOR = {"hga:conceptIdentical", "hga:typeIdentical"};
		private final static String[] ATOMIC_LIESIN = {"hga:geometryIntersects"};
	}
	
	public static String[] getAtomicRelationsFromLabel(String label) {
		switch (label) {
		case OntologyTokens.SAMEAS:
			return OntologyTokens.AtomicInferences.ATOMIC_SAMEAS;
		case OntologyTokens.ABSORBED:
			return OntologyTokens.AtomicInferences.ATOMIC_ABSORBED;
		case OntologyTokens.ISUSEDFOR:
			return OntologyTokens.AtomicInferences.ATOMIC_ISUSEDFOR;
		case OntologyTokens.LIESIN:
			return OntologyTokens.AtomicInferences.ATOMIC_LIESIN;
		default:
			return null;
		}
	}
	
	public static String[] getPrimaryRelationsFromAtomic(String relation) {
		ArrayList<String> labels = new ArrayList<String>();
		for (String primary : PRIMARY_RELATIONS) {
			for (String atomic : getAtomicRelationsFromLabel(primary)) {<commit_msg>helper method for all relations<commit_after>package org.waag.histograph.reasoner;

import java.util.ArrayList;

public final class OntologyTokens {
	
	public static final String SAMEAS = "hg:sameAs";
	public static final String ABSORBED = "hg:absorbed";
	public static final String ISUSEDFOR = "hg:isUsedFor";
	public static final String LIESIN = "hg:liesIn";
	
	public final static String[] PRIMARY_RELATIONS = {SAMEAS, ABSORBED, ISUSEDFOR, LIESIN};
	
	private final static class AtomicInferences {
		private final static String[] ATOMIC_SAMEAS = {"hga:conceptIdentical", "hga:typeIdentical"};
		private final static String[] ATOMIC_ABSORBED = {"hga:conceptIn", "hga:periodBefore", "hga:typeIdentical", "hga:geometryIntersects"};
		private final static String[] ATOMIC_ISUSEDFOR = {"hga:conceptIdentical", "hga:typeIdentical"};
		private final static String[] ATOMIC_LIESIN = {"hga:geometryIntersects"};
	}
	
	public static String[] getAtomicRelationsFromLabel(String label) {
		switch (label) {
		case OntologyTokens.SAMEAS:
			return OntologyTokens.AtomicInferences.ATOMIC_SAMEAS;
		case OntologyTokens.ABSORBED:
			return OntologyTokens.AtomicInferences.ATOMIC_ABSORBED;
		case OntologyTokens.ISUSEDFOR:
			return OntologyTokens.AtomicInferences.ATOMIC_ISUSEDFOR;
		case OntologyTokens.LIESIN:
			return OntologyTokens.AtomicInferences.ATOMIC_LIESIN;
		default:
			return null;
		}
	}
	
	public static String[] getAllRelations () {
		ArrayList<String> relations = new ArrayList<String>();
		for (String s : PRIMARY_RELATIONS) {
			relations.add(s);
			String[] atomics = getAtomicRelationsFromLabel(s);
			for (String a : atomics) {
				if (!relations.contains(a)) {
					relations.add(a);
				}
			}
		}
		String[] out = new String[relations.size()];
		out = relations.toArray(out);
		return out;
	}
	
	public static String[] getPrimaryRelationsFromAtomic(String relation) {
		ArrayList<String> labels = new ArrayList<String>();
		for (String primary : PRIMARY_RELATIONS) {
			for (String atomic : getAtomicRelationsFromLabel(primary)) {
{'fraction_non_alphanumeric': 0.10049288061336255, 'fraction_numerical': 0.0, 'mean_word_length': 5.752310536044362, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7390735', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1170, 'n_words': 271}