Package org.jrdf.query.answer

Examples of org.jrdf.query.answer.Answer


    private void aggregateResults() {
        final long start = System.currentTimeMillis();
        for (final Future<Answer> future : answers) {
            try {
                final Answer answer = future.get();
                multiAnswerParser.addAnswer(answer);
            } catch (Exception e) {
                cancelExecution(future);
            }
        }
View Full Code Here


        return createTemplateRepresentation(variant.getMediaType(), dataModel);
    }

    private Representation queryResultRepresentation(Variant variant) throws ResourceException {
        Map<String, Object> dataModel = new HashMap<String, Object>();
        Answer answer = graphApplication.answerQuery(graphName, queryString, maxRows);
        dataModel.put("query", queryString);
        dataModel.put(GRAPH_NAME, graphName);
        dataModel.put("timeTaken", graphApplication.getTimeTaken());
        dataModel.put("tooManyRows", graphApplication.isTooManyRows());
        dataModel.put("maxRows", graphApplication.getMaxRows());
View Full Code Here

    private MediaType mediaType;

    public Representation createRepresentation(MediaType defaultMediaType, Map<String, Object> dataModel) {
        try {
            Representation representation = Representation.createEmpty();
            final Answer answer = (Answer) dataModel.get("answer");
            if (answer != null) {
                mediaType = defaultMediaType;
                representation = answer.accept(this);
            }
            return representation;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

public class SparqlXmlRepresentationFactory implements RepresentationFactory, AnswerVisitor<Representation> {
    private MediaType mediaType;

    public Representation createRepresentation(MediaType defaultMediaType, Map<String, Object> dataModel) {
        Representation representation = Representation.createEmpty();
        final Answer answer = (Answer) dataModel.get("answer");
        if (answer != null) {
            mediaType = defaultMediaType;
            representation = answer.accept(this);
        }
        return representation;
    }
View Full Code Here

        this.queryPanelView = newQueryPanelView;
    }

    protected void doExecuteCommand() {
        try {
            Answer answer = performQuery();
            QueryRanCommand queryRanCommand = getQueryRanCommand();
            queryRanCommand.setAnswer(answer);
            queryRanCommand.execute();
        } catch (InvalidQuerySyntaxException e) {
            InvalidQueryCommand invalidQueryCommand = getInvalidQueryCommand();
View Full Code Here

TOP

Related Classes of org.jrdf.query.answer.Answer

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.