Package org.mindswap.pellet

Examples of org.mindswap.pellet.Role


*/
public class Block5 implements BlockingCondition {
  public boolean isBlocked(BlockingContext cxt) {
    for( ATermAppl normMax : cxt.blocker.getTypes( Node.MAX ) ) {
      ATermAppl max = (ATermAppl) normMax.getArgument( 0 );
      Role t = cxt.blocked.getABox().getRole( max.getArgument( 0 ) );
      ATermAppl c = (ATermAppl) max.getArgument( 2 );

      if( t.isDatatypeRole() )
        continue;

      Role invT = t.getInverse();

      if( !cxt.isRSuccessor( invT ) )
        continue;
     
      if( cxt.blocked.getParent().hasType( ATermUtils.negate( c ) ) )
View Full Code Here


* @author Evren Sirin
*/
public class Block6 implements BlockingCondition {
  public boolean isBlocked(BlockingContext cxt) {
    for( ATermAppl min : cxt.blocked.getParent().getTypes( Node.MIN ) ) {
      Role u = cxt.blocked.getABox().getRole( min.getArgument( 0 ) );
      ATermAppl c = (ATermAppl) min.getArgument( 2 );

      if( u.isDatatypeRole() )
        continue;

      if( cxt.isRSuccessor( u ) && !cxt.blocked.hasType( ATermUtils.negate( c ) ) )
        return false;
    }
   
    for( ATermAppl normSome : cxt.blocked.getParent().getTypes( Node.SOME ) ) {
      ATermAppl some = (ATermAppl) normSome.getArgument( 0 );
      Role u = cxt.blocked.getABox().getRole( some.getArgument( 0 ) );
      ATermAppl notC = (ATermAppl) some.getArgument( 1 );

      if( u.isDatatypeRole() )
        continue;

      if( cxt.isRSuccessor( u ) && !cxt.blocked.hasType( notC ) )
        return false;
    }
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.getURI().toString() );
      Role role = kb.getRBox().getRole( name );
      role.removeSubRoleChains();
    }
  }
View Full Code Here

    return unsupportedFeatures;
  }

  protected void addSimpleProperty(ATermAppl p, SimpleProperty why) {
    simpleProperties.put( p, why );
    Role role = kb.getRBox().getRole( p );
    role.setForceSimple( true );
  }
View Full Code Here

    ATermAppl st = node2term( s );
    ATermAppl ot = node2term( o );

    if( builtinTerm == null ) {
      ATermAppl pt = node2term( p );
      Role role = kb.getProperty( pt );
      PropertyType type = (role == null)
        ? PropertyType.UNTYPED
        : role.getType();

      if( type == PropertyType.ANNOTATION ) {
        // Skip ontology annotations
        if( graph.contains( s, RDF.type.asNode(), OWL.Ontology.asNode() ) ) {
                  return;
View Full Code Here

          Individual ind2 = abox.getIndividual( obj );
         
          ind1.setDifferent( ind2, DependencySet.INDEPENDENT );
        } else {
          // add code for inferring roles, too
          Role r = abox.getRole( pred );
          Individual from = abox.getIndividual( subj );
          Node to;
          if ( r != null && r.isObjectRole()) {
            to = abox.getIndividual( obj );
          } else if ( r != null && r.isDatatypeRole()) {
            to = abox.getLiteral( obj );
            if ( to == null ) {
              to = abox.addLiteral( obj );
            }
          } else {
View Full Code Here

          Individual ind2 = (Individual) obj;
          subj.setDifferent( ind2, ds );
        }
        else {
          // add code for inferring roles, too
          Role r = abox.getRole( pred );
          if( obj == null && r.isDatatypeRole() ) {
            // Constant data values in rules may not be in the ABox.
            obj = abox.addLiteral( objTerm );
          }
          addEdge( subj, r, obj, ds );
        }
View Full Code Here

          }
          else if( kb.isDatatype( term ) ) {
            types.add( RDFS.Datatype.asNode() );
          }
          else if( kb.isObjectProperty( term ) ) {
            Role role = kb.getRole( term );
            types.add( OWL.ObjectProperty.asNode() );
            if( role.isFunctional() )
              types.add( OWL.FunctionalProperty.asNode() );
            if( role.isInverseFunctional() )
              types.add( OWL.InverseFunctionalProperty.asNode() );
            if( role.isTransitive() )
              types.add( OWL.TransitiveProperty.asNode() );
            if( role.isSymmetric() )
              types.add( OWL.SymmetricProperty.asNode() );
            if( role.isAsymmetric() )
              types.add( OWL2.AsymmetricProperty.asNode() );
            if( role.isReflexive() )
              types.add( OWL2.ReflexiveProperty.asNode() );
            if( role.isIrreflexive() )
              types.add( OWL2.IrreflexiveProperty.asNode() );
          }
          else if( kb.isDatatypeProperty( term ) ) {         
            Role role = kb.getRole( term );
            types.add( OWL.DatatypeProperty.asNode() );
            if( role.isFunctional() )
              types.add( OWL.FunctionalProperty.asNode() );
            if( role.isInverseFunctional() )
              types.add( OWL.InverseFunctionalProperty.asNode() );
          }
          else if( kb.isAnnotationProperty( term ) ) {
            types.add( OWL.AnnotationProperty.asNode() );           
          }
View Full Code Here

    final Individual from = edge.getFrom();
    final org.mindswap.pellet.Node to = edge.getTo().getSame();
    if( !to.isRootNominal() || to.isPruned() )
      return false;
    final DependencySet ds = edge.getDepends();
    Role role = edge.getRole();
   
    boolean added = addFact( role, from, to, ds );

    if( role.isObjectRole() ) {
      added |= addFact( role.getInverse(), (Individual) to, from, ds );
    }

    return added;
  }
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.