// Path: src/main/java/org/linkeddatafragments/datasource/IFragmentRequestProcessor.java
// public interface IFragmentRequestProcessor extends Closeable
// {
// 
//     /**
//      *
//      * @param request
//      * @return
//      * @throws IllegalArgumentException
//      */
//     ILinkedDataFragment createRequestedFragment(
//             final ILinkedDataFragmentRequest request )
//                     throws IllegalArgumentException;
// }
// 
// Path: src/main/java/org/linkeddatafragments/fragments/ILinkedDataFragment.java
// public interface ILinkedDataFragment extends Closeable
// {
//     /**
//      * Returns an iterator over the RDF data of this fragment (possibly only
//      * partial if the data is paged, as indicated by {@link #isPageOnly()}).
//      * @return 
//      */
//     StmtIterator getTriples();
// 
//     /**
//      * Returns true if {@link #getTriples()} returns a page of data only.
//      * In this case, {@link #getPageNumber()} can be used to obtain the
//      * corresponding page number.
//      * @return 
//      */
//     boolean isPageOnly();
// 
//     /**
//      * Returns the number of the page of data returned by {@link #getTriples()}
//      * if the data is paged (that is, if {@link #isPageOnly()} returns true).
//      *
//      * If the data is not paged, this method throws an exception.
//      *
//      * @return 
//      * @throws UnsupportedOperationException
//      *         If the data of this fragment is not paged. 
//      */
//     long getPageNumber() throws UnsupportedOperationException;
// 
//     /**
//      * Returns true if {@link #getTriples()} returns a page of data only and
//      * this is the last page of the fragment.
//      *
//      * If the data is not paged (i.e., if {@link #isPageOnly()} returns false),
//      * this method throws an exception.
//      *
//      * @return 
//      * @throws UnsupportedOperationException
//      *         If the data of this fragment is not paged. 
//      */
//     boolean isLastPage() throws UnsupportedOperationException;
// 
//     /**
//      * Returns the maximum number of triples per page if {@link #getTriples()}
//      * returns a page of data only (that is, if {@link #isPageOnly()} returns
//      * true).
//      *
//      * If the data is not paged, this method throws an exception.
//      *
//      * @return 
//      * @throws UnsupportedOperationException
//      *         If the data of this fragment is not paged. 
//      */
//     long getMaxPageSize() throws UnsupportedOperationException;
// 
//     /**
//      * Returns an iterator over the metadata of this fragment.
//      * @return 
//      */
//     StmtIterator getMetadata();
// 
//     /**
//      * Returns an iterator over an RDF description of the controls associated
//      * with this fragment.
//      * @return 
//      */
//     StmtIterator getControls();
// }


import java.util.HashMap;
import java.util.Map;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.rdf.model.impl.PropertyImpl;
import org.apache.jena.rdf.model.impl.ResourceImpl;
import org.linkeddatafragments.datasource.AbstractRequestProcessorForTriplePatterns;
import org.linkeddatafragments.datasource.IDataSource;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.ITriplePatternElement;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragmentRequest;
    }

    /**
     * Worker for the index
     */
    protected class Worker
       extends AbstractRequestProcessorForTriplePatterns.Worker<RDFNode,String,String>
    {

        /**
         * Creates a Worker for the datasource index
         * 
         * @param req
         */
        public Worker(
                final ITriplePatternFragmentRequest<RDFNode,String,String> req )
        {
            super( req );
        }

        /**
         *
         * @param s
         * @param p
         * @param o
         * @param offset
         * @param limit
         * @return
         */
        @Override
// Path: src/main/java/org/linkeddatafragments/datasource/IFragmentRequestProcessor.java
// public interface IFragmentRequestProcessor extends Closeable
// {
// 
//     /**
//      *
//      * @param request
//      * @return
//      * @throws IllegalArgumentException
//      */
//     ILinkedDataFragment createRequestedFragment(
//             final ILinkedDataFragmentRequest request )
//                     throws IllegalArgumentException;
// }
// 
// Path: src/main/java/org/linkeddatafragments/fragments/ILinkedDataFragment.java
// public interface ILinkedDataFragment extends Closeable
// {
//     /**
//      * Returns an iterator over the RDF data of this fragment (possibly only
//      * partial if the data is paged, as indicated by {@link #isPageOnly()}).
//      * @return 
//      */
//     StmtIterator getTriples();
// 
//     /**
//      * Returns true if {@link #getTriples()} returns a page of data only.
//      * In this case, {@link #getPageNumber()} can be used to obtain the
//      * corresponding page number.
//      * @return 
//      */
//     boolean isPageOnly();
// 
//     /**
//      * Returns the number of the page of data returned by {@link #getTriples()}
//      * if the data is paged (that is, if {@link #isPageOnly()} returns true).
//      *
//      * If the data is not paged, this method throws an exception.
//      *
//      * @return 
//      * @throws UnsupportedOperationException
//      *         If the data of this fragment is not paged. 
//      */
//     long getPageNumber() throws UnsupportedOperationException;
// 
//     /**
//      * Returns true if {@link #getTriples()} returns a page of data only and
//      * this is the last page of the fragment.
//      *
//      * If the data is not paged (i.e., if {@link #isPageOnly()} returns false),
//      * this method throws an exception.
//      *
//      * @return 
//      * @throws UnsupportedOperationException
//      *         If the data of this fragment is not paged. 
//      */
//     boolean isLastPage() throws UnsupportedOperationException;
// 
//     /**
//      * Returns the maximum number of triples per page if {@link #getTriples()}
//      * returns a page of data only (that is, if {@link #isPageOnly()} returns
//      * true).
//      *
//      * If the data is not paged, this method throws an exception.
//      *
//      * @return 
//      * @throws UnsupportedOperationException
//      *         If the data of this fragment is not paged. 
//      */
//     long getMaxPageSize() throws UnsupportedOperationException;
// 
//     /**
//      * Returns an iterator over the metadata of this fragment.
//      * @return 
//      */
//     StmtIterator getMetadata();
// 
//     /**
//      * Returns an iterator over an RDF description of the controls associated
//      * with this fragment.
//      * @return 
//      */
//     StmtIterator getControls();
// }


// Path: src/main/java/org/linkeddatafragments/datasource/index/IndexRequestProcessorForTPFs.java
import java.util.HashMap;
import java.util.Map;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.rdf.model.impl.PropertyImpl;
import org.apache.jena.rdf.model.impl.ResourceImpl;
import org.linkeddatafragments.datasource.AbstractRequestProcessorForTriplePatterns;
import org.linkeddatafragments.datasource.IDataSource;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.ITriplePatternElement;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragmentRequest;

    }

    /**
     * Worker for the index
     */
    protected class Worker
       extends AbstractRequestProcessorForTriplePatterns.Worker<RDFNode,String,String>
    {

        /**
         * Creates a Worker for the datasource index
         * 
         * @param req
         */
        public Worker(
                final ITriplePatternFragmentRequest<RDFNode,String,String> req )
        {
            super( req );
        }

        /**
         *
         * @param s
         * @param p
         * @param o
         * @param offset
         * @param limit
         * @return
         */
        @Override
        protected ILinkedDataFragment createFragment(