Package org.openrdf.query.resultio

Examples of org.openrdf.query.resultio.TupleQueryResultFormat


     * @return an RDF repository containing an RDF representation of the dataset located at the remote resource.
     * @throws java.io.IOException in case an error occurs while reading the input stream
     */
    @Override
    public List<String> parseResponse(final String resourceUri, String requestUrl, final Repository triples, InputStream in, String contentType) throws DataRetrievalException {
        TupleQueryResultFormat format = QueryResultIO.getParserFormatForMIMEType(contentType, TupleQueryResultFormat.SPARQL);


        try {

            QueryResultIO.parse(in,format,
View Full Code Here


                }
            }
        };
       
        final ResponseBuilder responseBuilder = Response.ok().entity(entity).header("Content-Type", format.getMime());
        final TupleQueryResultFormat fmt = QueryResultIO.getWriterFormatForMIMEType(format.getMime());
        if (fmt != null) {
            responseBuilder.header("Content-Disposition", String.format("attachment; filename=\"%s.%s\"", queryType.toString().toLowerCase(), fmt.getDefaultFileExtension()));
        }
        return responseBuilder.build();
  }
View Full Code Here

            throw new RDFHandlerException("Could not build SparqlServiceDescription");
        }
    }

    private TupleQueryResultWriter getTupleResultWriter(String format, OutputStream os) {
        TupleQueryResultFormat resultFormat;
        if(format == null) {
            resultFormat = TupleQueryResultFormat.SPARQL;
        } else {
            resultFormat = QueryResultIO.getWriterFormatForMIMEType(format);
            if(resultFormat == null) {
View Full Code Here

    /**
     * Gets the query result format that this writer uses.
     */
    @Override
    public TupleQueryResultFormat getTupleQueryResultFormat() {
        return new TupleQueryResultFormat("SPARQL/HTML","text/html", Charset.forName("UTF-8"), "html");
    }
View Full Code Here

     * @param contentType content type as returned in the HTTP headers of the remote webservice   @return an RDF repository containing an RDF representation of the dataset located at the remote resource.
     * @throws java.io.IOException in case an error occurs while reading the input stream
     */
    @Override
    public List<String> parseResponse(final String resourceUri, String requestUrl, final Model triples, InputStream in, String contentType) throws DataRetrievalException {
        TupleQueryResultFormat format = QueryResultIO.getParserFormatForMIMEType(contentType, TupleQueryResultFormat.SPARQL);


        try {

            QueryResultIO.parse(in,format,
View Full Code Here

     * @return an RDF repository containing an RDF representation of the dataset located at the remote resource.
     * @throws java.io.IOException in case an error occurs while reading the input stream
     */
    @Override
    public List<String> parseResponse(final String resourceUri, String requestUrl, final Repository triples, InputStream in, String contentType) throws DataRetrievalException {
        TupleQueryResultFormat format = QueryResultIO.getParserFormatForMIMEType(contentType, TupleQueryResultFormat.SPARQL);


        try {

            QueryResultIO.parse(in,format,
View Full Code Here

    }



    private Repository parseSparqlResponse(final URI resource, InputStream in, String contentType) throws RepositoryException, IOException, QueryResultParseException, TupleQueryResultHandlerException {
        TupleQueryResultFormat format = QueryResultIO.getParserFormatForMIMEType(contentType, TupleQueryResultFormat.SPARQL);


        final Repository triples = new SailRepository(new MemoryStore());
        triples.initialize();
View Full Code Here

        this.out = out;
    }

  @Override
  public TupleQueryResultFormat getTupleQueryResultFormat() {
    return new TupleQueryResultFormat("SPARQL/HTML", "text/html", Charset.forName("UTF-8"), "html");
  }
View Full Code Here

    /**
     * Gets the query result format that this writer uses.
     */
    @Override
    public TupleQueryResultFormat getTupleQueryResultFormat() {
        return new TupleQueryResultFormat("SPARQL/HTML","text/html", Charset.forName("UTF-8"), "html");
    }
View Full Code Here

TOP

Related Classes of org.openrdf.query.resultio.TupleQueryResultFormat

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.