Package org.mindswap.pellet

Examples of org.mindswap.pellet.Literal


    public void rebind(VariableBinding newBinding) {
      used = false;
      head = null;
      value = null;
      Literal resultLit = null;
     
      // Can't bind the first arg if it doesn't exist!
      if ( atom.getAllArguments().size() == 0 )
        return;
     
      // The arguments to a numeric function number one less than the arguments
      // to the SWRL atom.  The first argument to the atom is either set
      // or tested against the result of the function.
      Literal[] arguments = new Literal[ atom.getAllArguments().size() - 1 ];
     
      int i = 0;
      for ( AtomDObject obj : atom.getAllArguments() ) {
        Literal lit = newBinding.get( obj );
       
        if ( i == 0 ) {
          if (lit != null) {
            resultLit = lit;
          }
View Full Code Here


      if ( args.length != 1 )
        return null;
     
      String val = ATermUtils.getLiteralValue( args[0].getTerm() );
      String length = Integer.toString( val.length() );
      Literal result = abox.addLiteral( ATermUtils.makeTypedLiteral( length, Namespaces.XSD + "integer" ) );
     
      return expectedIfEquals( expected, result );
    }
View Full Code Here

        if ( atom.getAllArguments().size() < 3 ) {
          tokens = null;
          return;
        }
       
        Literal matchLit = newBinding.get( atom.getAllArguments().get( 0 ) );
        if ( matchLit != null ) {
          match = ATermUtils.getLiteralValue( matchLit.getTerm() );
        }
       
        String splittingString = ATermUtils.getLiteralValue(
            newBinding.get( atom.getAllArguments().get(1) ).getTerm() );
       
View Full Code Here

  public Literal next() {
    if ( !hasNext() ) {
      throw new NoSuchElementException();
    }
   
    Literal result = next;
    next = null;
   
    return result;
  }
View Full Code Here

      return;
    }

    node.addType(c, ds);
    if (node.isLiteral()) {
      final Literal l = (Literal) node;
      final NodeMerge mtc = l.getMergeToConstant();
      if (mtc != null) {
        l.clearMergeToConstant();
        Literal mergeTo = abox.getLiteral(mtc.getTarget());
        mergeTo(l, mergeTo, mtc.getDepends());
        node = mergeTo;
      }
    }
View Full Code Here

        }
       
        if ( mergeResults( args, results ) )
          return true;
      } else if ( restBound( args ) ) {
        Literal result = allBound.apply( abox, args[0], argList( args ) );
        if ( result != null ) {
          if ( args[0] == null )
            args[0] = result;
          return true;
        }
View Full Code Here

    StringFunctionAdapter allBound = new StringFunctionAdapter( this, XSD + "dateTime" );
   
    public boolean apply(ABox abox, Literal[] args) {
      // Assume applicability check means we have the right number of arguments.
      if ( restBound( args ) ) {
        Literal result = allBound.apply( abox, args[0], argList( args ) );
        if ( result != null ) {
          if ( args[0] == null )
            args[0] = result;
          return true;
        }
View Full Code Here

      allBound = new StringFunctionAdapter( this, XSD + "duration" );
    }
   
    public boolean apply(ABox abox, Literal[] args) {
      if ( restBound( args ) ) {
        Literal result = allBound.apply( abox, args[0], argList( args ) );
        if ( result != null ) {
          if ( args[0] == null )
            args[0] = result;
          return true;
        }
View Full Code Here

      StringFunctionAdapter allBound = new StringFunctionAdapter( this, XSD + "time" );
     
      public boolean apply(ABox abox, Literal[] args) {
        if ( restBound( args ) ) {
          Literal result = allBound.apply( abox, args[0], argList( args ) );
          if ( result != null ) {
            if ( args[0] == null )
              args[0] = result;
            return true;
          }
View Full Code Here

    public void rebind(VariableBinding newBinding) {
      used = false;
      head = null;
      value = null;
      Literal resultLit = null;
     
      // Can't bind the first arg if it doesn't exist!
      if ( atom.getAllArguments().size() == 0 )
        return;
     
      // The arguments to a numeric function number one less than the arguments
      // to the SWRL atom.  The first argument to the atom is either set
      // or tested against the result of the function.
      Literal[] arguments = new Literal[ atom.getAllArguments().size() - 1 ];
     
      int i = 0;
      for ( AtomDObject obj : atom.getAllArguments() ) {
        Literal lit = newBinding.get( obj );
       
        if ( i == 0 ) {
          if (lit != null) {
            resultLit = lit;
          }
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.Literal

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.