All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mysema.rdfbean.jena.TupleQueryImpl Maven / Gradle / Ivy

package com.mysema.rdfbean.jena;

import java.io.Writer;
import java.util.List;
import java.util.Map;

import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.ResultSet;
import com.mysema.commons.lang.CloseableIterator;
import com.mysema.rdfbean.model.NODE;
import com.mysema.rdfbean.model.STMT;

/**
 * @author tiwe
 *
 */
public class TupleQueryImpl extends AbstractQueryImpl {
    
    public TupleQueryImpl(Query query, Dataset dataset, JenaDialect dialect) {
        super(query, dataset, dialect);
    }

    @Override
    public boolean getBoolean() {
        throw new UnsupportedOperationException();
    }

    @Override
    public ResultType getResultType() {
        return ResultType.TUPLES;
    }

    @Override
    public CloseableIterator getTriples() {
        throw new UnsupportedOperationException();
    }

    @Override
    public CloseableIterator> getTuples() {
        QueryExecution exec = createExecution();
        ResultSet resultSet = exec.execSelect();
        return new TupleResultIterator(resultSet, dialect);
    }

    @Override
    public List getVariables() {
        return query.getResultVars();
    }

    @Override
    public void streamTriples(Writer writer, String contentType) {
        throw new UnsupportedOperationException();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy