Examples of Bool


Examples of org.mindswap.pellet.utils.Bool

  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 );
            }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

    p = getRole( p ).getInverse().getName();
    Iterator<ATermAppl> i = candidates.iterator();
    while( i.hasNext() ) {
      ATermAppl s = i.next();

      Bool hasObviousValue = hasObviousObjectPropertyValue( s, p, null );
      candidates.update( s, hasObviousValue );
    }
  }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

    if( pNode.isMerged() ) {
      isIndependent = pNode.getMergeDependency( true ).isIndependent();
      pNode = pNode.getSame();
    }

    Bool isType = isKnownType( pNode, c, subs );

    if( isIndependent ) {
          return isType;
        }
        else if( isType.isTrue() ) {
          return Bool.UNKNOWN;
        }
        else {
          return isType;
        }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

        }
  }

  public Bool isKnownType(Individual pNode, ATermAppl concept, Collection<ATermAppl> subs) {
    // Timer t = kb.timers.startTimer( "isKnownType" );
    Bool isType = isType( pNode, concept );
    if( isType.isUnknown() ) {
      Set<ATermAppl> concepts = ATermUtils.isAnd( concept )
        ? ATermUtils.listToSet( (ATermList) concept.getArgument( 0 ) )
        : SetUtils.singleton( concept );

      isType = Bool.TRUE;
      for( ATermAppl c : concepts ) {
        Bool type = pNode.hasObviousType( c );

        if( type.isUnknown() && pNode.hasObviousType( subs ) ) {
          type = Bool.TRUE;
        }
       
        if( type.isKnown() ) {
          isType = isType.and( type );
        }
        else {
          isType = Bool.UNKNOWN;
         
//          boolean justSC = true;

          Collection<ATermAppl> axioms = kb.getTBox().getAxioms( c );
          LOOP: for( ATermAppl axiom : axioms ) {
            ATermAppl term = (ATermAppl) axiom.getArgument( 1 );

//            final AFun afun = axiom.getAFun();
//
//            if( !afun.equals( ATermUtils.SUBFUN ) ) {
//              justSC = false;
//            }

            boolean equivalent = axiom.getAFun().equals( ATermUtils.EQCLASSFUN );
            if( equivalent ) {
              Iterator<ATermAppl> i = ATermUtils.isAnd( term )
                ? new MultiListIterator( (ATermList) term.getArgument( 0 ) )
                : Collections.singleton( term ).iterator();
              Bool knownType = Bool.TRUE;
              while( i.hasNext() && knownType.isTrue() ) {
                term = i.next();
                knownType = isKnownType( pNode, term, SetUtils.<ATermAppl>emptySet() );
              }
              if( knownType.isTrue() ) {
                isType = Bool.TRUE;
                break LOOP;
              }
            }
          }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

    return isType;
  }

  private Bool isType(CachedNode pNode, ATermAppl c) {
    Bool isType = Bool.UNKNOWN;
   
    boolean isPrimitive = kb.getTBox().isPrimitive( c );
   
    if( isPrimitive && !pNode.isTop() && !pNode.isBottom() && pNode.isComplete() ) {
      DependencySet ds = pNode.getDepends().get( c );
      if( ds == null ) {
        return Bool.FALSE;
      }
      else if( ds.isIndependent() && pNode.isIndependent() ) {
        return Bool.TRUE;
      }
    }
   
    ATermAppl notC = ATermUtils.negate( c );
    CachedNode cached = getCached( notC );
    if( cached != null && cached.isComplete() ) {
      isType = cache.isMergable( kb, pNode, cached ).not();
    }

    if( PelletOptions.CHECK_NOMINAL_EDGES && isType.isUnknown() ) {
      CachedNode cNode = getCached( c );
      if( cNode != null ) {
        isType = cache.checkNominalEdges( kb, pNode, cNode )
      }
    }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

      }
            else {
              subs = SetUtils.emptySet();
            }
 
      Bool type = isKnownType( x, c, subs );
      if( type.isKnown() ) {
              return type.isTrue();
            }
    }
    // List list = (List) kb.instances.get( c );
    // if( list != null )
    // return list.contains( x );
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

    }
        else {
          subj = subj.getSame();
        }

    Bool hasValue = subj.hasDataPropertyValue( prop, value );
    if( onlyPositive && hasValue.isFalse() ) {
          return Bool.UNKNOWN;
        }

    return hasValue;
  }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

            }
    }
  }

  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 ) {
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

          return Bool.UNKNOWN;
        }

        EdgeList edges = ind.getRNeighborEdges( role );

        Bool ot = Bool.FALSE;

        for( int e = 0; e < edges.size(); e++ ) {
          Edge edge = edges.edgeAt( e );

          if( !edge.getDepends().isIndependent() ) {
            ot = Bool.UNKNOWN;
            continue;
          }

          Individual y = (Individual) edge.getNeighbor( ind );

          // TODO all this stuff in one method - this is only for
          // handling AND
          // clauses - they are implemented in abox.isKnownType
          ot = ot.or( abox.isKnownType( y, d, SetUtils.<ATermAppl>emptySet() ) );// y.hasObviousType(d));

          if( ot.isTrue() ) {
            return ot;
          }
        }
        return ot;
      }
View Full Code Here

Examples of org.mindswap.pellet.utils.Bool

    }

    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 );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.