}
}
}
for( final ATermAppl p : properties ) {
Role role = kb.getRBox().getRole( p );
int knownSize = 0;
if( role.isObjectRole() ) {
Set<ATermAppl> knowns = new HashSet<ATermAppl>();
Set<ATermAppl> unknowns = new HashSet<ATermAppl>();
kb.getABox().getObjectPropertyValues( ind, role, knowns, unknowns,
true );
knownSize = knowns.size();
}
else {
List<ATermAppl> knowns = kb.getABox().getObviousDataPropertyValues( ind, role, null );
knownSize = knowns.size();
}
if( knownSize > 0 ) {
if( log.isLoggable( Level.FINER ) )
log.finer( "Update " + p + " by " + knownSize );
pairsPP.put( p, size( p ) + knownSize );
pSubj.put( p, pSubj.get( p ) + 1 );
}
if( role.isObjectRole() ) {
role = role.getInverse();
Set<ATermAppl> knowns = new HashSet<ATermAppl>();
Set<ATermAppl> unknowns = new HashSet<ATermAppl>();
kb.getABox().getObjectPropertyValues( ind, role, knowns, unknowns,
true );
if( !knowns.isEmpty() ) {
pObj.put( p, pObj.get( p ) + 1 );
}
}
}
}
if( !computed ) {
avgClassesPI = average( classesPI.values() );
avgDirectClassesPI = average( directClassesPI.values() );
}
if( !kb.isRealized() ) {
for( final ATermAppl c : concepts ) {
int size = instancesPC.get( c );
// post processing in case of sampling
if( size == 0 )
instancesPC.put( c, 1 );
else
instancesPC.put( c, (int) (size / PelletOptions.SAMPLING_RATIO) );
size = directInstancesPC.get( c );
// postprocessing in case of sampling
if( size == 0 )
directInstancesPC.put( c, 1 );
else
directInstancesPC.put( c, (int) (size / PelletOptions.SAMPLING_RATIO) );
}
final int avgCPI = Double.valueOf( avgClassesPI ).intValue();
final int avgDCPI = Double.valueOf( avgDirectClassesPI ).intValue();
for( final ATermAppl i : kb.getIndividuals() ) {
Integer size = classesPI.get( i );
if( size == null ) {
size = avgCPI;
}
// postprocessing in case of sampling
if( size == 0 )
classesPI.put( i, 1 );
else
classesPI.put( i, (int) (size / PelletOptions.SAMPLING_RATIO) );
size = directClassesPI.get( i );
if( size == null ) {
size = avgDCPI;
}
// postprocessing in case of sampling
if( size == 0 )
directClassesPI.put( i, 1 );
else
directClassesPI.put( i, (int) (size / PelletOptions.SAMPLING_RATIO) );
}
}
for( final ATermAppl p : properties ) {
int size = size( p );
if( size == 0 )
pairsPP.put( p, 1 );
else
pairsPP.put( p, (int) (size / PelletOptions.SAMPLING_RATIO) );
Role role = kb.getRBox().getRole( p );
ATermAppl invP = (role.getInverse() != null)
? role.getInverse().getName()
: null;
int subjCount = pSubj.get( p );
if( subjCount == 0 )
subjCount = 1;
int objCount = pObj.get( p );