Package org.mindswap.pellet

Examples of org.mindswap.pellet.Role


  private Set<ATermAppl> getRNeighbors(CachedNode node, Role role) {
    Set<ATermAppl> neighbors = new HashSet<ATermAppl>();

    for( Edge edge : node.getOutEdges() ) {
      Role r = edge.getRole();
      if( r.isSubRoleOf( role ) ) {
        neighbors.add( edge.getToName() );
      }
    }

    if( role.isObjectRole() ) {
      role = role.getInverse();
      for( Edge edge : node.getInEdges() ) {
        Role r = edge.getRole();
        if( r.isSubRoleOf( role ) ) {
          neighbors.add( edge.getFromName() );
        }
      }
    }
View Full Code Here


    return false;
  }

  protected boolean interactsWithInversesComplex(KnowledgeBase kb, Role role) {
    for( ATermAppl p : expressivity.getAnonInverses() ) {
      Role anonRole = kb.getRole( p );
      if( anonRole.hasComplexSubRole() && anonRole.getFSM().getAlpahabet().contains( role ) )
        return true;

    }

    return false;
View Full Code Here

    return true;
  }
 
  protected boolean block4(BlockingContext cxt, ATermAppl term) {
    Role t = cxt.blocked.getABox().getRole( term.getArgument( 0 ) );
    int m = 1;
    ATermAppl c;
   
    if( ATermUtils.isMin( term ) ) {
      c = (ATermAppl) term.getArgument( 2 );
      m = ((ATermInt) term.getArgument( 1 )).getInt();
    }
    else {
      c = ATermUtils.negate( (ATermAppl) term.getArgument( 1 ) );
    }

    if( t.isDatatypeRole() )
      return true;

    Role invT = t.getInverse();        
   
    if( cxt.isRSuccessor( invT )
      && cxt.blocked.getParent().hasType( c ) )
      return true;
   
View Full Code Here

public class Block2 implements BlockingCondition {
  public boolean isBlocked(BlockingContext cxt) {
    for (ATermAppl av : cxt.blocker.getTypes(Node.ALL)) {
      ATerm p = av.getArgument(0);
      ATermAppl c = (ATermAppl) av.getArgument(1);
      Role s = cxt.blocked.getABox().getRole(p);

      if (p instanceof ATermList) {
        ATermList chain = (ATermList) p;

        if (!isBlockedByChain(cxt, chain, c))
          return false;
      }
      else if (s.isDatatypeRole()) {
        continue;
      }
      else {
        Role invS = s.getInverse();

        if (cxt.isRSuccessor(invS) && !cxt.blocked.getParent().hasType(c))
          return false;

        if (!s.isSimple()) {
View Full Code Here

    return true;
  }

  protected boolean isBlockedByChain(BlockingContext cxt, ATermList chain, ATermAppl c) {
    Role firstRole = cxt.blocked.getABox().getRole(chain.getFirst());

    return !cxt.getIncomingRoles().contains(firstRole.getInverse())
           && cxt.blocked.getParent().hasType(ATermUtils.makeAllValues(chain.getNext(), c));
  }
View Full Code Here

  }

  private void collectComplexPropertyValues(Individual subj) {
    Set<Role> collected = new HashSet<Role>();
    for( Edge edge : subj.getOutEdges() ) {
      Role role = edge.getRole();
     
      // only collect non-simple, i.e. complex, roles
      // TODO we might not need to collect all non-simple roles
      // collecting only the base ones, i.e. minimal w.r.t. role
      // ordering, would be enough
      if( role.isSimple() || !collected.add( role ) )
        continue;
     
      collected.add( role );
     
      collectComplexPropertyValues( subj, role );
    }
   
    for( Edge edge : subj.getInEdges() ) {
      Role role = edge.getRole().getInverse();
     
      if( role.isSimple() || !collected.add( role ) )
        continue;

      collectComplexPropertyValues( subj, role );
    }
  }
View Full Code Here

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

   
    OWLObjectProperty prop = getNamedProperty( ope );
    simpleProperties.add( prop );

    prop.accept( this );
    Role role = kb.getRBox().getRole( term );
    role.setForceSimple( true );
  }
View Full Code Here

      Set<OWLObjectPropertyAxiom> axioms = entry.getValue();
      for( OWLObjectPropertyAxiom axiom : axioms )
        addUnsupportedAxiom( axiom );

      ATermAppl name = ATermUtils.makeTermAppl( nonSimpleProperty.getIRI().toString() );
      Role role = kb.getRBox().getRole( name );
      role.removeSubRoleChains();
    }
  }
View Full Code Here

        if( !isSomeValues( term ) )
          continue;
       
        ATermAppl p = (ATermAppl) term.getArgument( 0 );
       
        Role role = kb.getRole( p );
        if( role == null || role.hasComplexSubRole() )
          continue;
       
        ATermAppl disjunction = disjunction( terms );
        kb.addDomain( p, disjunction, explanation );
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.Role

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.