public Set<ATermAppl> getDifferents(ATermAppl name) { ensureConsistency(); Individual ind = abox.getIndividual( name ); if( ind == null ) { handleUndefinedEntity( name + " is not an individual!" ); return Collections.emptySet(); } boolean isIndependent = true; if( ind.isMerged() ) { isIndependent = ind.getMergeDependency( true ).isIndependent(); ind = ind.getSame(); } ATermAppl c = ATermUtils.makeNot( ATermUtils.makeValue( name ) ); Set<ATermAppl> differents = new HashSet<ATermAppl>(); for( ATermAppl x : individuals ) { Bool isType = abox.isKnownType( x, c ); if( isIndependent && isType.isKnown() ) { if( isType.isTrue() ) differents.add( x ); } else if( isType( x, c ) ) { differents.add( x ); } } return differents; }
public Set<ATermAppl> getDifferents(ATermAppl name) { ensureConsistency(); Individual ind = abox.getIndividual( name ); if( ind == null ) { handleUndefinedEntity( name + " is not an individual!" ); return Collections.emptySet(); } boolean isIndependent = true; if( ind.isMerged() ) { isIndependent = ind.getMergeDependency( true ).isIndependent(); ind = ind.getSame(); } ATermAppl c = ATermUtils.makeNot( ATermUtils.makeValue( name ) ); Set<ATermAppl> differents = new HashSet<ATermAppl>(); for( ATermAppl x : individuals ) { Bool isType = abox.isKnownType( x, c ); if( isIndependent && isType.isKnown() ) { if( isType.isTrue() ) differents.add( x ); } else if( isType( x, c ) ) { differents.add( x ); } } return differents; }
public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { if( !doExplanation ) { Bool isKnownSubClass = isKnownSubClassOf( c1, c2 ); if( isKnownSubClass.isKnown() ) { return isKnownSubClass.isTrue(); } } if( log.isLoggable( Level.FINE ) ) { long count = kb.timers.getTimer( "subClassSat" ) == null ? 0 : kb.timers.getTimer( "subClassSat" ).getCount(); log.fine( count + ") Checking subclass [" + ATermUtils.toString( c1 ) + " " + ATermUtils.toString( c2 ) + "]" ); } ATermAppl notC2 = ATermUtils.negate( c2 ); ATermAppl c = ATermUtils.makeAnd( c1, notC2 ); Timer t = kb.timers.startTimer( "subClassSat" ); boolean sub = !isSatisfiable( c, false ); t.stop(); if( log.isLoggable( Level.FINE ) ) { log.fine( " Result: " + sub + " (" + t.getLast() + "ms)" ); } return sub; }
public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { if( !doExplanation ) { Bool isKnownSubClass = isKnownSubClassOf( c1, c2 ); if( isKnownSubClass.isKnown() ) { return isKnownSubClass.isTrue(); } } if( log.isLoggable( Level.FINE ) ) { long count = kb.timers.getTimer( "subClassSat" ) == null ? 0 : kb.timers.getTimer( "subClassSat" ).getCount(); log.fine( count + ") Checking subclass [" + ATermUtils.toString( c1 ) + " " + ATermUtils.toString( c2 ) + "]" ); } ATermAppl notC2 = ATermUtils.negate( c2 ); ATermAppl c = ATermUtils.makeAnd( c1, notC2 ); Timer t = kb.timers.startTimer( "subClassSat" ); boolean sub = !isSatisfiable( c, false ); t.stop(); if( log.isLoggable( Level.FINE ) ) { log.fine( " Result: " + sub + " (" + t.getLast() + "ms)" ); } return sub; }
if( allTriplesSatisfied.isKnown() ) { querySatisfied = allTriplesSatisfied.isTrue();
if( type.isKnown() ) { return type.isTrue();
if( type.isKnown() ) { return type.isTrue();
public boolean isSatisfiable(ATermAppl c) { ensureConsistency(); if( !isClass( c ) ) { handleUndefinedEntity( c + " is not a known class!" ); return false; } c = ATermUtils.normalize( c ); if( isClassified() && !doExplanation() ) { Bool equivToBottom = builder.getTaxonomy().isEquivalent( ATermUtils.BOTTOM, c ); if( equivToBottom.isKnown() ) return equivToBottom.isFalse(); } return abox.isSatisfiable( c ); }
public boolean isSatisfiable(ATermAppl c) { ensureConsistency(); if( !isClass( c ) ) { handleUndefinedEntity( c + " is not a known class!" ); return false; } c = ATermUtils.normalize( c ); if( isClassified() && !doExplanation() ) { Bool equivToBottom = builder.getTaxonomy().isEquivalent( ATermUtils.BOTTOM, c ); if( equivToBottom.isKnown() ) return equivToBottom.isFalse(); } return abox.isSatisfiable( c ); }
public boolean hasPropertyValue(ATermAppl s, ATermAppl p, ATermAppl o) { Bool hasObviousValue = hasObviousPropertyValue( s, p, o ); if( hasObviousValue.isKnown() ) { if( hasObviousValue.isFalse() || !doExplanation() ) { return hasObviousValue.isTrue(); } } ATermAppl c = null; if( o == null ) { if( kb.isDatatypeProperty( p ) ) { c = ATermUtils.makeMin( p, 1, ATermUtils.TOP_LIT ); } else { c = ATermUtils.makeMin( p, 1, ATermUtils.TOP ); } } else { c = ATermUtils.makeHasValue( p, o ); } boolean isType = isType( s, c ); return isType; }
public boolean hasPropertyValue(ATermAppl s, ATermAppl p, ATermAppl o) { Bool hasObviousValue = hasObviousPropertyValue( s, p, o ); if( hasObviousValue.isKnown() ) { if( hasObviousValue.isFalse() || !doExplanation() ) { return hasObviousValue.isTrue(); } } ATermAppl c = null; if( o == null ) { if( kb.isDatatypeProperty( p ) ) { c = ATermUtils.makeMin( p, 1, ATermUtils.TOP_LIT ); } else { c = ATermUtils.makeMin( p, 1, ATermUtils.TOP ); } } else { c = ATermUtils.makeHasValue( p, o ); } boolean isType = isType( s, c ); return isType; }
if( type.isKnown() ) { isType = isType.and( type );
Bool cachedSat = isCachedSat( x ); t.stop(); if( cachedSat.isKnown() ) { if( cachedSat.isTrue() ) { if( log.isLoggable( Level.FINE ) )
if( type.isKnown() ) { isType = isType.and( type );
/** * Check if class c1 is subclass of class c2. * * @param c1 * @param c2 * @return */ public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { ensureConsistency(); if( !isClass( c1 ) ) { handleUndefinedEntity( c1 + " is not a known class" ); return false; } if( !isClass( c2 ) ) { handleUndefinedEntity( c2 + " is not a known class" ); return false; } if( c1.equals( c2 ) ) return true; // normalize concepts c1 = ATermUtils.normalize( c1 ); c2 = ATermUtils.normalize( c2 ); if( isClassified() && !doExplanation() ) { Bool isSubNode = builder.getTaxonomy().isSubNodeOf( c1, c2 ); if( isSubNode.isKnown() ) return isSubNode.isTrue(); } return abox.isSubClassOf( c1, c2 ); }
/** * Check if class c1 is subclass of class c2. * * @param c1 * @param c2 * @return */ public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { ensureConsistency(); if( !isClass( c1 ) ) { handleUndefinedEntity( c1 + " is not a known class" ); return false; } if( !isClass( c2 ) ) { handleUndefinedEntity( c2 + " is not a known class" ); return false; } if( c1.equals( c2 ) ) return true; // normalize concepts c1 = ATermUtils.normalize( c1 ); c2 = ATermUtils.normalize( c2 ); if( isClassified() && !doExplanation() ) { Bool isSubNode = builder.getTaxonomy().isSubNodeOf( c1, c2 ); if( isSubNode.isKnown() ) return isSubNode.isTrue(); } return abox.isSubClassOf( c1, c2 ); }
abox.isKnownSubClassOf( c2, c1 ) ); if( isEquivalent.isKnown() ) return isEquivalent.isTrue();
abox.isKnownSubClassOf( c2, c1 ) ); if( isEquivalent.isKnown() ) return isEquivalent.isTrue();