Examples of AtomIObject


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

    Set<RuleAtom> body = new LinkedHashSet<RuleAtom>();

    for( RuleAtom atom : rule.getHead() ) {
      if( atom instanceof ClassAtom ) {
        ClassAtom ca = (ClassAtom) atom;
        AtomIObject arg = ca.getArgument();
        ATermAppl c = ca.getPredicate();
        ATermAppl normC = ATermUtils.normalize( c );
        if( c != normC )
          atom = new ClassAtom( normC, arg );
      }
      head.add( atom );
    }

    Map<AtomIObject, Set<ATermAppl>> types = new HashMap<AtomIObject, Set<ATermAppl>>();

    for( RuleAtom atom : rule.getBody() ) {
      if( atom instanceof IndividualPropertyAtom ) {
        IndividualPropertyAtom propAtom = (IndividualPropertyAtom) atom;
        ATermAppl prop = propAtom.getPredicate();

        AtomIObject subj = propAtom.getArgument1();
        if( subj instanceof AtomIVariable ) {
          Set<ATermAppl> domains = getRole( prop ).getDomains();
          if( domains != null )
            MultiMapUtils.addAll( types, subj, domains );
        }

        AtomIObject obj = propAtom.getArgument2();
        if( obj instanceof AtomIVariable ) {
          Set<ATermAppl> ranges = getRole( prop ).getRanges();
          if( ranges != null )
            MultiMapUtils.addAll( types, obj, ranges );
        }
      }
    }

    for( RuleAtom atom : rule.getBody() ) {
      if( atom instanceof ClassAtom ) {
        ClassAtom ca = (ClassAtom) atom;
        AtomIObject arg = ca.getArgument();
        ATermAppl c = ca.getPredicate();
        ATermAppl normC = ATermUtils.normalize( c );
        if( MultiMapUtils.contains( types, arg, normC ) )
          continue;
        else if( c != normC )
View Full Code Here

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

  public void testRuleEquality() {
    ATermAppl r = term( "r" );
    ATermAppl i = term( "i" );
    ATermAppl j = term( "j" );

    AtomIObject x = new AtomIVariable( "x" );
    AtomIObject y = new AtomIVariable( "y" );

   
    kb.addIndividual( i );
    kb.addIndividual( j );
    kb.addObjectProperty( r );
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.