org.openrdf.query.resultio.BooleanQueryResultWriter Java Examples

The following examples show how to use org.openrdf.query.resultio.BooleanQueryResultWriter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BigdataRDFContext.java    From database with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void doQuery(final BigdataSailRepositoryConnection cxn,
        final OutputStream os) throws Exception {

    final BigdataSailBooleanQuery query = (BigdataSailBooleanQuery) setupQuery(cxn);

    // Note: getQueryTask() verifies that format will be non-null.
    final BooleanQueryResultFormat format = BooleanQueryResultWriterRegistry
            .getInstance().getFileFormatForMIMEType(mimeType);

    final BooleanQueryResultWriter w = BooleanQueryResultWriterRegistry
            .getInstance().get(format).getWriter(os);

    final boolean result = query.evaluate();

    w.write(result);

}