package kr.ac.kaist.lilliput.test;
import java.util.ArrayList;
import java.util.List;
import edu.stanford.smi.protegex.owl.model.OWLDatatypeProperty;
import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protegex.owl.model.RDFIndividual;
public class DummyMaker {
public static int acc = 1;
public static void makeTestSet(OWLModel owlModel, int count)
{
OWLNamedClass humanClass = owlModel.getOWLNamedClass("Human");
OWLNamedClass objectClass = owlModel.getOWLNamedClass("Object");
OWLNamedClass placeClass = owlModel.getOWLNamedClass("IndoorSpace");
OWLObjectProperty hasFriend = owlModel.getOWLObjectProperty("hasFriend");
OWLObjectProperty hasOwnership = owlModel.getOWLObjectProperty("hasOwnership");
OWLDatatypeProperty acDT = owlModel.getOWLDatatypeProperty("AC");
List<RDFIndividual> humanInds = new ArrayList<RDFIndividual>();
for(int i = 0 ; i < count ; i++)
{
RDFIndividual tempInd = humanClass.createRDFIndividual(null);
if( acc == 1 )
{
tempInd.addPropertyValue(acDT, "Public");
}
else if( acc == 2)
{
tempInd.addPropertyValue(acDT, "Friend");
}
else if( acc == 3)
{
tempInd.addPropertyValue(acDT, "Follower");
}
else if( acc == 4)
{
tempInd.addPropertyValue(acDT, "Private");
}
acc++;
if( acc == 5 ) acc = 1;
humanInds.add(tempInd);
}
for( int i = 0 ; i < humanInds.size() ; i++ )
{
RDFIndividual tempInd = humanInds.get(i);
RDFIndividual o1 = objectClass.createRDFIndividual(null);
if( acc == 1 )
{
o1.addPropertyValue(acDT, "Public");
}
else if( acc == 2)
{
o1.addPropertyValue(acDT, "Friend");
}
else if( acc == 3)
{
o1.addPropertyValue(acDT, "Follower");
}
else if( acc == 4)
{
o1.addPropertyValue(acDT, "Private");
}
acc++;
if( acc == 5 ) acc = 1;
RDFIndividual o2 = objectClass.createRDFIndividual(null);
if( acc == 1 )
{
o2.addPropertyValue(acDT, "Public");
}
else if( acc == 2)
{
o2.addPropertyValue(acDT, "Friend");
}
else if( acc == 3)
{
o2.addPropertyValue(acDT, "Follower");
}
else if( acc == 4)
{
o2.addPropertyValue(acDT, "Private");
}
acc++;
if( acc == 5 ) acc = 1;
RDFIndividual p1 = placeClass.createRDFIndividual(null);
if( acc == 1 )
{
p1.addPropertyValue(acDT, "Public");
}
else if( acc == 2)
{
p1.addPropertyValue(acDT, "Friend");
}
else if( acc == 3)
{
p1.addPropertyValue(acDT, "Follower");
}
else if( acc == 4)
{
p1.addPropertyValue(acDT, "Private");
}
acc++;
if( acc == 5 ) acc = 1;
tempInd.addPropertyValue(hasOwnership, o1);
tempInd.addPropertyValue(hasOwnership, o2);
tempInd.addPropertyValue(hasOwnership, p1);
}
long friendStart = System.nanoTime();
double total = 819840;
int p = 1;
for(int i = 0 ; i < humanInds.size() ; i++ )
{
RDFIndividual h1 = humanInds.get(i);
for( int j = i+1 ; j < humanInds.size() ; j++)
{
p++;
double u = p;
RDFIndividual h2 = humanInds.get(j);
if( p%7 == 1 )
{
h1.setPropertyValue(hasFriend, h2);
}
// else if( p%7 == 2 )
// {
// h1.setPropertyValue(arg0, arg1)
// }
System.out.println(p);
System.out.println( (u / total)*100 + "percent is processed ");
long friendCurrent = System.nanoTime();
double between = friendCurrent - friendStart;
System.out.print(between/1000000000+" is elapsed \t");
System.out.print(((between/ 100000) * ( 1 - ( u / total)))/( u/ total) + "s is expected");
}
}
}
}