Package com.clarkparsia.pellet.rules.model

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


        if( arguments == null ) {
                  addUnsupportedFeature( "Term not found " + SWRL.arguments );
                }
                else if( builtInNode != null && builtInNode.isURI() ) {
                  atom = new BuiltInAtom( builtInNode.getURI(), arguments );
                }
      }
      else if( hasObject( atomNode, RDF.type.asNode(), SWRL.DataRangeAtom.asNode() ) ) {
        atomType = "DataRangeAtom";
        ATermAppl datatype = null;
View Full Code Here


      for( args = args.getNext(); !args.isEmpty(); args = args.getNext() ) {
        ATermAppl arg = (ATermAppl) args.getFirst();
        list.add( convertAtomDObject( arg ) );
      }
     
      atom = new BuiltInAtom( builtin.toString(), list );     
    }
    else {
      throw new InternalReasonerException( "Unknown rule atom " + term );
    }
View Full Code Here

    List<AtomDObject> arguments = new ArrayList<AtomDObject>( atom.getAllArguments().size() );
    for( SWRLDArgument swrlArg : atom.getArguments() ) {
      swrlArg.accept( this );
      arguments.add( swrlDObject );
    }
    swrlAtom = new BuiltInAtom( atom.getPredicate().toString(), arguments );
  }
View Full Code Here

          ATermAppl facetRestriction = (ATermAppl) list.getFirst();       
          ATermAppl facet = (ATermAppl) facetRestriction.getArgument( 0 );       
          String builtin = FACETS.get( facet );
          if( builtin != null ) {         
            ATermAppl value = (ATermAppl) facetRestriction.getArgument( 1 );
            atoms.add( new BuiltInAtom( builtin, var, new AtomDConstant( value ) ) );
          }
          else {
            atoms.add( new DataRangeAtom( c, var ) );
            return;
          }
View Full Code Here

    List<AtomDObject> arguments = new ArrayList<AtomDObject>( atom.getAllArguments().size() );
    for( SWRLAtomDObject swrlArg : atom.getArguments() ) {
      swrlArg.accept( this );
      arguments.add( swrlDObject );
    }
    swrlAtom = new BuiltInAtom( atom.getPredicate().getURI().toString(), arguments );
  }
View Full Code Here

        if( arguments == null ) {
                  addUnsupportedFeature( "Term not found " + SWRL.arguments );
                }
                else if( builtInNode != null && builtInNode.isURI() ) {
                  atom = new BuiltInAtom( builtInNode.getURI(), arguments );
                }
      }
      else if( hasObject( atomNode, RDF.type.asNode(), SWRL.DataRangeAtom.asNode() ) ) {
        atomType = "DataRangeAtom";
        ATermAppl datatype = null;
View Full Code Here

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

    AtomIVariable x = new AtomIVariable( "x" );
    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 );
View Full Code Here

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

        ATermAppl facetRestriction = (ATermAppl) list.getFirst();       
        ATermAppl facet = (ATermAppl) facetRestriction.getArgument( 0 );       
        String builtin = FACETS.get( facet );
        if( builtin != null ) {         
          ATermAppl value = (ATermAppl) facetRestriction.getArgument( 1 );
          atoms.add( new BuiltInAtom( builtin, var, new AtomDConstant( value ) ) );
        }
        else {
          atoms.add( new DataRangeAtom( c, var ) );
          return;
        }
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.rules.model.BuiltInAtom

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.