Examples of CoreNewImpl


Examples of com.clarkparsia.pellet.sparqldl.model.CoreNewImpl

        if( a instanceof QueryAtom ) {
          atoms.add( (QueryAtom) a );
        }
      }

      final CoreNewImpl c = (CoreNewImpl) QueryAtomFactory.Core( atoms,
          query.getUndistVars(), kb );

      transformedQuery.add( c );

      if( log.isLoggable( Level.FINE ) ) {
        log.fine( c.getUndistVars() + " : " + c.getDistVars() + " : " + c.getQuery().getAtoms() );
      }
    }

    for( final QueryAtom atom : toRemove ) {
      transformedQuery.remove( atom );
View Full Code Here

Examples of com.clarkparsia.pellet.sparqldl.model.CoreNewImpl

          binding );
      break;

    case UndistVarCore:
      // TODO Core IF
      final CoreNewImpl core = (CoreNewImpl) current.apply( binding );

      final Collection<ATermAppl> distVars = core.getDistVars();

      if( distVars.isEmpty() ) {
        final Collection<ATermAppl> constants = core.getConstants();
        if( constants.isEmpty() ) {
          if( QueryEngine.execBooleanABoxQuery( core.getQuery() ) ) {
                      result.add( binding );
          // throw new RuntimeException(
          // "The query contains neither dist vars, nor constants,
          // yet evaluated by the CombinedQueryEngine !!! ");
                    }
        }
        else {
          final ATermAppl c = constants.iterator().next();
          final ATermAppl clazz = core.getQuery().rollUpTo( c,
              Collections.<ATermAppl>emptySet(), STOP_ROLLING_ON_CONSTANTS );

          if( kb.isType( c, clazz ) ) {
            exec( binding );
          }
        }
      }
      else if( distVars.size() == 1 ) {
        final ATermAppl var = distVars.iterator().next();
        final ATermAppl c = core.getQuery().rollUpTo( var, Collections.<ATermAppl>emptySet(),
            STOP_ROLLING_ON_CONSTANTS );
        final Collection<ATermAppl> instances = kb.getInstances( c );

        for( final ATermAppl a : instances ) {
          final ResultBinding candidateBinding = binding.duplicate();
          candidateBinding.setValue( var, a );
          exec( candidateBinding );
        }
      }
      else {
        // TODO
        // if (distVars.size() == 2
        // && core.getUndistVars().size() == 1
        // && !kb.getExpressivity().hasNominal()
        // && !kb.getExpressivity().hasTransitivity()) {
        // // TODO 1. undist. var. in distinguished manner
        // // TODO 2. identify both DV's
        // }

        final CoreStrategy s = QueryEngine.getStrategy( current );

        switch ( s ) {
        case SIMPLE:
          execSimpleCore( oldQuery, binding, distVars );
          break;
        case ALLFAST:
          execAllFastCore( oldQuery, binding, distVars, core.getUndistVars() );
          break;
        default:
          throw new InternalReasonerException( "Unknown core strategy." );
        }
      }
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.