Examples of DatavaluedPropertyAtom


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

                }
                else if( argument2 == null ) {
                  addUnsupportedFeature( "Term not found " + SWRL.argument2 );
                }
                else {
                  atom = new DatavaluedPropertyAtom( pred, argument1, argument2 );
                }
      }
      else if( hasObject( atomNode, RDF.type.asNode(), SWRL.BuiltinAtom.asNode() ) ) {
        atomType = "BuiltinAtom";
        Node builtInNode = null;
View Full Code Here

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

        atom = new IndividualPropertyAtom( p, io1, io2 );
      }
      else if( originalKB.isDatatypeProperty( p ) ) {
        kb.addDatatypeProperty( p );
        AtomDObject do2 = convertAtomDObject( i2 );
        atom = new DatavaluedPropertyAtom( p, io1, do2 );
      }
      else {
        throw new InternalReasonerException( "Unknown property " + p );
      }
    }
View Full Code Here

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

    atom.getSecondArgument().accept( this );
    AtomDObject obj = swrlDObject;

    atom.getPredicate().accept( this );
    swrlAtom = new DatavaluedPropertyAtom( term, subj, obj );
  }
View Full Code Here

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

       
        if( filler.getAFun().equals( ATermUtils.VALUEFUN ) ) {
          ATermAppl nominal = (ATermAppl) filler.getArgument( 0 );
          if( kb.isDatatypeProperty( p ) ) {
            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 {
          varCount++;
          if( kb.isDatatypeProperty( p ) ) {
            AtomDObject newVar = new AtomDVariable( "var" + varCount );
            RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar );
            atoms.add(atom);
            processDatatype( newVar, filler, atoms );
          }
          else{
            AtomIObject newVar = new AtomIVariable( "var" + varCount );
View Full Code Here

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

        body.add( new IndividualPropertyAtom( property, x, z ) );
        body.add( new IndividualPropertyAtom( property, y, z ) );
      }
      else if( isDatatypeProperty( property ) ) {
        AtomDVariable z = new AtomDVariable( "z" + varId );
        body.add( new DatavaluedPropertyAtom( property, x, z ) );
        body.add( new DatavaluedPropertyAtom( property, y, z ) );
      }

      varId++;
    }
View Full Code Here

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

    atom.getSecondArgument().accept( this );
    AtomDObject obj = swrlDObject;

    atom.getPredicate().accept( this );
    swrlAtom = new DatavaluedPropertyAtom( term, subj, obj );
  }
View Full Code Here

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

                }
                else if( argument2 == null ) {
                  addUnsupportedFeature( "Term not found " + SWRL.argument2 );
                }
                else {
                  atom = new DatavaluedPropertyAtom( pred, argument1, argument2 );
                }
      }
      else if( hasObject( atomNode, RDF.type.asNode(), SWRL.BuiltinAtom.asNode() ) ) {
        atomType = "BuiltinAtom";
        Node builtInNode = null;
View Full Code Here

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

    AtomDVariable z1 = new AtomDVariable( "z1" );
    AtomDVariable z2 = new AtomDVariable( "z2" );
    AtomDVariable z3 = new AtomDVariable( "z3" );

    List<RuleAtom> body = new ArrayList<RuleAtom>();
    body.add( new DatavaluedPropertyAtom( p, x, z1 ) );
    body.add( new DatavaluedPropertyAtom( q, x, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "add", z3, z1, z2 ) );

    List<RuleAtom> head = new ArrayList<RuleAtom>();
    head.add( new DatavaluedPropertyAtom( r, x, z3 ) );

    kb.addRule( new Rule( head, body ) );

    kb.realize();
    assertTrue( kb.hasPropertyValue( i, r, d12 ) );
View Full Code Here

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

    AtomDVariable xDate = new AtomDVariable( "xDate" ), xYear = new AtomDVariable( "xYear" ), xMonth = new AtomDVariable(
        "xMonth" ), xDay = new AtomDVariable( "xDay" ), xTZ = new AtomDVariable( "xTZ" );

    RuleAtom dateBuiltIn = new BuiltInAtom( SWRLB + "date", xDate, xYear, xMonth, xDay );
    RuleAtom dateBuiltInTZ = new BuiltInAtom( SWRLB + "date", xDate, xYear, xMonth, xDay, xTZ );
    RuleAtom bDateAtom = new DatavaluedPropertyAtom( bDate, x, xDate );
    RuleAtom bYearAtom = new DatavaluedPropertyAtom( bYear, x, xYear );
    RuleAtom bMonthAtom = new DatavaluedPropertyAtom( bMonth, x, xMonth );
    RuleAtom bDayAtom = new DatavaluedPropertyAtom( bDay, x, xDay );
    RuleAtom bTZAtom = new DatavaluedPropertyAtom( bTZ, x, xTZ );

    Rule fromDate = new Rule( Arrays
        .asList( new RuleAtom[] { bYearAtom, bMonthAtom, bDayAtom } ), Arrays
        .asList( new RuleAtom[] { dateBuiltIn, bDateAtom } ) );
    kb.addRule( fromDate );
View Full Code Here

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

    AtomDVariable z4 = new AtomDVariable( "z4" );
    AtomDVariable z5 = new AtomDVariable( "z5" );
    AtomDVariable z6 = new AtomDVariable( "z6" );

    List<RuleAtom> body = new ArrayList<RuleAtom>();
    body.add( new DatavaluedPropertyAtom( p, x, z1 ) );
    body.add( new DatavaluedPropertyAtom( p, x, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "add", z3, z1, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "subtract", z4, z1, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "multiply", z5, z1, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "divide", z6, z1, z2 ) );

    List<RuleAtom> head = new ArrayList<RuleAtom>();
    head.add( new DatavaluedPropertyAtom( sum, x, z3 ) );
    head.add( new DatavaluedPropertyAtom( difference, x, z4 ) );
    head.add( new DatavaluedPropertyAtom( product, x, z5 ) );
    head.add( new DatavaluedPropertyAtom( quotient, x, z6 ) );

    Rule rule = new Rule( head, body );
    kb.addRule( rule );

    kb.realize();
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.