public String toString() { return isTrue() ? "true" : isFalse() ? "false" : "unknown"; } }
public String toString() { return isTrue() ? "true" : isFalse() ? "false" : "unknown"; } }
public void update( T obj, Bool isCandidate ) { if( isCandidate.isTrue() ) { // do nothing } else if( isCandidate.isFalse() ) { remove( obj ); } else { if( knowns.contains( obj ) ) { knowns.remove( obj ); unknowns.add( obj ); } } }
public void update( T obj, Bool isCandidate ) { if( isCandidate.isTrue() ) { // do nothing } else if( isCandidate.isFalse() ) { remove( obj ); } else { if( knowns.contains( obj ) ) { knowns.remove( obj ); unknowns.add( obj ); } } }
public void getObviousSubjects(ATermAppl p, ATermAppl o, CandidateSet<ATermAppl> candidates) { Iterator<ATermAppl> i = candidates.iterator(); while( i.hasNext() ) { ATermAppl s = i.next(); Bool hasObviousValue = hasObviousPropertyValue( s, p, o ); if( hasObviousValue.isFalse() ) { i.remove(); } else { candidates.update( s, hasObviousValue ); } } }
public void getObviousSubjects(ATermAppl p, ATermAppl o, CandidateSet<ATermAppl> candidates) { Iterator<ATermAppl> i = candidates.iterator(); while( i.hasNext() ) { ATermAppl s = i.next(); Bool hasObviousValue = hasObviousPropertyValue( s, p, o ); if( hasObviousValue.isFalse() ) { i.remove(); } else { candidates.update( s, hasObviousValue ); } } }
/** * Retrieve individuals which possibly have a property value for the given * property. */ public List<ATermAppl> retrieveIndividualsWithProperty(ATermAppl r) { ensureConsistency(); Role role = rbox.getRole( r ); if( role == null ) { handleUndefinedEntity( r + " is not a known property!" ); return Collections.emptyList(); } List<ATermAppl> result = new ArrayList<ATermAppl>(); for( ATermAppl ind : individuals ) { if( !abox.hasObviousPropertyValue( ind, r, null ).isFalse() ) result.add( ind ); } return result; }
/** * Retrieve individuals which possibly have a property value for the given * property. */ public List<ATermAppl> retrieveIndividualsWithProperty(ATermAppl r) { ensureConsistency(); Role role = rbox.getRole( r ); if( role == null ) { handleUndefinedEntity( r + " is not a known property!" ); return Collections.emptyList(); } List<ATermAppl> result = new ArrayList<ATermAppl>(); for( ATermAppl ind : individuals ) { if( !abox.hasObviousPropertyValue( ind, r, null ).isFalse() ) result.add( ind ); } return result; }
else if( tripleSatisfied.isFalse() ) {
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; }
public Bool hasObviousDataPropertyValue(ATermAppl s, ATermAppl p, Object value) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual( s ); Role prop = getRole( p ); if( prop.isTop() ) { return Bool.TRUE; } else if( prop.isBottom() ) { return Bool.FALSE; } // if onlyPositive is set then the answer returned is sound but not // complete so we cannot return negative answers boolean onlyPositive = false; if( !subj.getMergeDependency( true ).isIndependent() ) { onlyPositive = true; subj = getIndividual( s ); } else { subj = subj.getSame(); } Bool hasValue = subj.hasDataPropertyValue( prop, value ); if( onlyPositive && hasValue.isFalse() ) { return Bool.UNKNOWN; } return hasValue; }
public Bool hasObviousDataPropertyValue(ATermAppl s, ATermAppl p, Object value) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual( s ); Role prop = getRole( p ); if( prop.isTop() ) { return Bool.TRUE; } else if( prop.isBottom() ) { return Bool.FALSE; } // if onlyPositive is set then the answer returned is sound but not // complete so we cannot return negative answers boolean onlyPositive = false; if( !subj.getMergeDependency( true ).isIndependent() ) { onlyPositive = true; subj = getIndividual( s ); } else { subj = subj.getSame(); } Bool hasValue = subj.hasDataPropertyValue( prop, value ); if( onlyPositive && hasValue.isFalse() ) { return Bool.UNKNOWN; } return hasValue; }
defineObjectProperty( pt ); else if( isObjectRestriction.isFalse() ) { c = node2term( qualification ); defineDatatypeProperty( pt );