Examples of AtomIConstant


Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

    return visitor.getIndividual();
  }

 
  public Individual set( AtomIVariable key, ATermAppl value ) {
    AtomIConstant constant = new AtomIConstant( value );
    IndividualValueCollector collector = new IndividualValueCollector();
    constant.accept( collector );
    return set( key, collector.getValue() );
  }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

      return new AtomIVariable( node.getURI() );
    }
    else {
      ATermAppl term = node2term( node );
      if( defineIndividual( term ) ) {
              return new AtomIConstant( node2term( node ) );
            }
            else {
        addUnsupportedFeature( "Cannot create rule individual object for node " + node );
        return null;
      }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

  private AtomIObject convertAtomIObject(ATermAppl t) {
    if( ATermUtils.isVar( t ) )
      return new AtomIVariable( ((ATermAppl) t.getArgument( 0 )).getName() );
    else if( kb.isIndividual( t ) )
      return new AtomIConstant( t );
    else if( ATermUtils.isAnon( t ) )
      return new AtomIConstant( t );

    throw new InternalReasonerException( "Unrecognized term: " + t );
  }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

  }
 
 
  public void visit(SWRLIndividualArgument iobj) {
    iobj.getIndividual().accept( this );
    swrlIObject = new AtomIConstant( term );
  }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

            AtomDConstant arg = new AtomDConstant( nominal );
            RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg );
            atoms.add(atom);
          }
          else {
            AtomIConstant arg = new AtomIConstant( nominal );
            RuleAtom atom = new IndividualPropertyAtom( p, var, arg );
            atoms.add(atom);
          }
        }
        else {
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

    swrlIObject = new AtomIVariable( ivar.getURI().toString() );
  }

  public void visit(SWRLAtomIndividualObject iobj) {
    iobj.getIndividual().accept( this );
    swrlIObject = new AtomIConstant( term );
  }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

      return new AtomIVariable( node.getURI() );
    }
    else {
      ATermAppl term = node2term( node );
      if( defineIndividual( term ) ) {
              return new AtomIConstant( node2term( node ) );
            }
            else {
        addUnsupportedFeature( "Cannot create rule individual object for node " + node );
        return null;
      }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

    kb.addClass( c );
    kb.addClass( d );
    kb.addIndividual( i );
    kb.addType( i, c );

    kb.addRule( new Rule( Arrays.asList( new RuleAtom[] { new ClassAtom( d, new AtomIConstant(
        i ) ) } ), Arrays
        .asList( new RuleAtom[] { new ClassAtom( c, new AtomIConstant( i ) ) } ) ) );

    kb.realize();
    assertTrue( kb.getTypes( i ).contains( Collections.singleton( d ) ) );

  }
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

    {
      AtomIVariable v = new AtomIVariable( "v" );
      RuleAtom body = new ClassAtom( some( p, or( and( A, B ), or(
          and( A, C ), and( B, C ) ) ) ), v );
      RuleAtom head = new IndividualPropertyAtom( q, v, new AtomIConstant( y ) );
      Rule rule = new Rule( Collections.singleton( head ), Collections.singleton( body ) );
      kb.addRule( rule );
    }

    {
      AtomIVariable v = new AtomIVariable( "v" );
      RuleAtom body = new ClassAtom( G, v );
      RuleAtom head = new IndividualPropertyAtom( p, v, new AtomIConstant( y ) );
      Rule rule = new Rule( Collections.singleton( head ), Collections.singleton( body ) );
      kb.addRule( rule );
    }

    assertTrue( kb.isConsistent() );
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.AtomIConstant

    kb.addPropertyValue( p, a, b );
    kb.addPropertyValue( p, b, c );
    kb.addPropertyValue( p, c, c );
   
    AtomIVariable x = new AtomIVariable( "x" )
    List<RuleAtom> body = Arrays.<RuleAtom>asList( new IndividualPropertyAtom( p, x, new AtomIConstant( c ) ) );
    List<RuleAtom> head = Arrays.<RuleAtom>asList( new ClassAtom( A, x ) );
 
    kb.addRule( new Rule( head, body ) );
 
    assertTrue( kb.isConsistent() );
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.