public class BibleReligionPredictionExperiment {
private final static String DATA_DIR = "datasets/";
private final static int NUMBER_OF_PROC = 4;
public static void main(String[] args) {
RDFFileDataSet testSetA = new RDFFileDataSet(DATA_DIR + "NTN-individuals.owl", RDFFormat.RDFXML);
testSetA.addFile(DATA_DIR + "NTNames.owl", RDFFormat.RDFXML);
List<URI> instancesJ = new ArrayList<URI>();
List<URI> instancesC = new ArrayList<URI>();
List<String> labels = new ArrayList<String>();
Map<Resource, List<Statement>> blacklists = new HashMap<Resource, List<Statement>>();
List<Statement> triples = testSetA.getStatementsFromStrings(null, "http://semanticbible.org/ns/2006/NTNames#ethnicity", "http://semanticbible.org/ns/2006/NTNames#Jewish", true);
for (Statement triple: triples) {
List<Statement> triples2 = testSetA.getStatementsFromStrings(triple.getSubject().toString(), "http://semanticbible.org/ns/2006/NTNames#religiousBelief", "http://semanticbible.org/ns/2006/NTNames#Christianity", true);
if (triples2.size() == 0) {
instancesJ.add((URI)triple.getSubject());
labels.add("J");
List<Statement> bl = testSetA.getStatementsFromStrings(triple.getSubject().toString(), "http://semanticbible.org/ns/2006/NTNames#ethnicity", null, true);
bl.addAll(testSetA.getStatementsFromStrings(triple.getSubject().toString(), "http://semanticbible.org/ns/2006/NTNames#religiousBelief", null, true));
bl.addAll(testSetA.getStatementsFromStrings(null, "http://semanticbible.org/ns/2006/NTNames#ethnicityOf", triple.getSubject().toString(), true));
blacklists.put((URI)triple.getSubject(), bl);
}
}
triples = testSetA.getStatementsFromStrings(null, "http://semanticbible.org/ns/2006/NTNames#religiousBelief", "http://semanticbible.org/ns/2006/NTNames#Christianity", true);
for (Statement triple: triples) {
List<Statement> triples2 = testSetA.getStatementsFromStrings(triple.getSubject().toString(), "http://semanticbible.org/ns/2006/NTNames#ethnicity", "http://semanticbible.org/ns/2006/NTNames#Jewish", true);
if (triples2.size() == 0) {
instancesC.add((URI)triple.getSubject());
labels.add("C");
List<Statement> bl = testSetA.getStatementsFromStrings(triple.getSubject().toString(), "http://semanticbible.org/ns/2006/NTNames#ethnicity", null, true);
bl.addAll(testSetA.getStatementsFromStrings(triple.getSubject().toString(), "http://semanticbible.org/ns/2006/NTNames#religiousBelief", null, true));
bl.addAll(testSetA.getStatementsFromStrings(null, "http://semanticbible.org/ns/2006/NTNames#ethnicityOf", triple.getSubject().toString(), true));
blacklists.put((URI)triple.getSubject(), bl);
}
}