Package org.mindswap.pellet

Examples of org.mindswap.pellet.DependencySet


    ruleAtomAsserter = new RuleAtomAsserter();
    atomTester = new TrivialSatisfactionHelpers( abox );
  }
 
  public void addUnsafeRule(Rule rule, Set<ATermAppl> explain) {
    unsafeRules.add(new PartialBinding(rule, new VariableBinding(abox), new DependencySet(explain)));
  }
View Full Code Here


  private int createDisjunctionsFromBinding(VariableBinding binding, Rule rule, DependencySet ds) {
    List<RuleAtom> atoms = new ArrayList<RuleAtom>();

    for( RuleAtom atom : rule.getBody() ) {
      DependencySet atomDS = atomTester.isAtomTrue( atom, binding );
      if( atomDS != null ) {
        ds = ds.union( atomDS, abox.doExplanation() );
      }
      else {
        atoms.add( atom );
      }
    }
   
    // all the atoms in the body are true
    if( atoms.isEmpty() ) {
      if( rule.getHead().isEmpty() ) {
        if( log.isLoggable( Level.FINE ) )
          log.fine( "Empty head for rule " + rule );
        abox.setClash( Clash.unexplained( null, ds ) );       
      }
      else {
        for( RuleAtom atom : rule.getHead() ) {
          ruleAtomAsserter.assertAtom( atom, binding, ds, false, abox, this );
        }
      }
      return -1;
    }
   
    int bodyAtomCount = atoms.size();

    for( RuleAtom atom : rule.getHead() ) {
      DependencySet atomDS = atomTester.isAtomTrue( atom, binding );
      if( atomDS == null ) {
        atoms.add( atom );
      }
    }
   
View Full Code Here

      if( ind1.isSame( ind2 ) ) {
        // we might be returning a super set of the actual dependency
        // set for the sameness since it is not straight-forward to come
        // up with the exact dependency set if there are other
        // individuals involved in this sameAs inference
        DependencySet ds1 = ind1.getMergeDependency( true );
        DependencySet ds2 = ind2.getMergeDependency( true );

        return ds1 == null
          ? ds2
          : ds2 == null
            ? ds1
View Full Code Here

    addType( ind, cls );
  }

  private void addType(ATermAppl ind, ATermAppl cls) {
    DependencySet nodeDS = ds;
    Individual node = abox.getIndividual( ind );
   
    if (node.isMerged()) {
      nodeDS = node.getMergeDependency(true);
      node = node.getSame();
View Full Code Here

    strategy.addType( node, cls, nodeDS );
  }

  private void addEdge(ATermAppl p, ATermAppl s, ATermAppl o) {
    DependencySet edgeDS = ds;
    Individual node1 = abox.getIndividual( s );
   
    if (node1.isMerged()) {
      edgeDS = node1.getMergeDependency(true);
      node1 = node1.getSame();
View Full Code Here

            log.fine( "Stop cached " + x );
          mayNeedExpanding.remove( 0 );
        }
        else {
          // set the clash information to be the union of all types
          DependencySet ds = DependencySet.EMPTY;
          for( Iterator<ATermAppl> i = x.getTypes().iterator(); i.hasNext(); ) {
            ATermAppl c = i.next();
            ds = ds.union( x.getDepends( c ), abox.doExplanation() );
          }
          abox.setClash( Clash.atomic( x, ds ) );
        }
        return;
      }
View Full Code Here

      cachedEdges.addEdge( cachedEdge );
     
      if( PelletOptions.CHECK_NOMINAL_EDGES ) {
        Node neighbor = edge.getNeighbor( node );
        Map<Node,DependencySet> mergedNodes = neighbor.getAllMerged();
          DependencySet edgeDepends = edge.getDepends();
          for( Entry<Node,DependencySet> entry : mergedNodes.entrySet() ) {
            Node mergedNode = entry.getKey();
            if( mergedNode.isRootNominal() && !mergedNode.equals( neighbor ) ) {
              Role r = edge.getRole();
              ATermAppl n = mergedNode.getName();
              DependencySet ds = edgeDepends.union( entry.getValue(), false ).cache();
              Edge e = out
                ? new CachedOutEdge( r, n, ds )
                : new CachedInEdge( r, n, ds );
              cachedEdges.addEdge( e );
            }
View Full Code Here

      }
    }
  }

  void applyFunctionality(Individual subj, Role pred, Node obj) {
    DependencySet maxCardDS = pred.isFunctional() ? pred.getExplainFunctional() : subj.hasMax1(pred);

    if (maxCardDS != null) {
      maxRule.applyFunctionalMaxRule(subj, pred, ATermUtils.getTop(pred), maxCardDS);
    }
View Full Code Here

    if (neighbors.size() <= 1) {
      return;// continue;
    }

    Individual head = null;
    DependencySet headDS = null;
    // find a nominal node to use as the head
    for (int edgeIndex = 0; edgeIndex < edges.size(); edgeIndex++) {
      Edge edge = edges.edgeAt(edgeIndex);
      Individual ind = edge.getFrom();
View Full Code Here

    while (!merging && !mergeList.isEmpty() && !abox.isClosed()) {
      NodeMerge merge = mergeList.remove(0);

      Node y = abox.getNode(merge.getSource());
      Node z = abox.getNode(merge.getTarget());
      DependencySet ds = merge.getDepends();

      if (y.isMerged()) {
        ds = ds.union(y.getMergeDependency(true), abox.doExplanation());
        y = y.getSame();
      }

      if (z.isMerged()) {
        ds = ds.union(z.getMergeDependency(true), abox.doExplanation());
        z = z.getSame();
      }

      if (y.isPruned() || z.isPruned()) {
        continue;
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.DependencySet

Copyright © 2018 www.massapicom. 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.