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

eu.fbk.knowledgestore.server.http.jaxrs.package-info Maven / Gradle / Ivy

Go to download

The HTTP server module (ks-server-http) implements the Web API of the KnowledgeStore, which includes the two CRUD and SPARQL endpoints. The CRUD Endpoint supports the retrieval and manipulation of semi-structured data about resource, mention, entity and axiom records (encoded in RDF, possibly using JSONLD), and the upload / download of resource representation. The SPARQL Endpoint supports SPARQL SELECT, CONSTRUCT, DESCRIBE and ASK queries according to the W3C SPARQL protocol. The two endpoints are implemented on top of a component implementing the KnowledgeStore Java API (the Store interface), which can be either the the KnowledgeStore frontend (ks-frontend) or the Java Client. The implementation of the module is based on the Jetty Web sever (run in embedded mode) and the Jersey JAX-RS implementation. Reference documentation of the Web API is automatically generated using the Enunciate tool.

There is a newer version: 1.7.1
Show newest version
/**
 * KnowledgeStore Web API.
 * 

* The KnowledgeStore Web API provides access to the operation of the KnowledgeStore using a * (almost-) REST interface. Below, general information about the API (supported MIME types, * common HTTP status codes and response headers) are reported, followed by the list of REST * resources exposed by the API which link to supported operations. *

*

* TODO: WORK IN PROGRESS, PROVIDE BETTER OVERVIEW AND LINK TO ADDITIONAL DOCUMENTATION *

*

Supported MIME types

*

* RDF is used for the description of resources, mentions, entities and axioms. The RDF MIME types * in the following table are supported: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
MIME typeFormatComments
application/ld+jsonJSONLDpreferred MIME type
application/rdf+xmlRDF/XML
text/turtleTurtle
text/n3N3the Turtle subset is actually used
application/n-triplesN-Triples
text/x-nquadsN-Quads
application/x-trigTriG
application/trixTriXnon standard, discouraged
application/x-binary-rdfSesame binary RDF * formatnon standard, discouraged
application/rdf+jsonRDF+JSONdiscouraged by W3C in favour of JSONLD
*

* DESCRIBE and CONSTRUCT operations submitted to the KnowledgeStore SPARQL endpoint returns RDF * data (see above), while SELECT and ASK queries return tabular data using one of the following * MIME types: *

* * * * * * * * * * * * * * * * * * * * * * * * * * *
MIME typeFormatComments
application/sparql-results+jsonSPARQL JSON query * results Formatpreferred MIME type
application/sparql-results+xmlSPARQL XML query results
text/csvSPARQL CSV * query results
text/tab-separated-valuesSPARQL TSV * query results
*

* The MIME types of resource files is not fixed. It is the responsibility of the client to * specify the correct MIME type when uploading a file, which is then returned when downloading * it. *

*

Common status codes

*

* The following HTTP status codes are common to all the API operation. Therefore, they are * documented here rather than being reported for each specific operation: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
HTTP Status CodeDescription
302 Foundreturned when accessing a secured URL via HTTP, redirecting to the corresponding HTTPS URL * (see Location header); note that request to the HTTPS URL should include valid user credentials * using the Authorization header (HTTP basic authentication is used)
304 Not Modifiedreturned in case of read requests (HTTP GET) when headers If-Modified-Since or * If-None-Match are specified and requested data has not been modified since the supplied * timestamp / ETag, meaning that previously cached copies of the data can be used
400 Bad Requestreturned if the request is not valid, e.g., because a supplied query parameter, request * header or the request body are not valid (specific constraints are listed for each API * resource)
401 Unauthorizedreturned if the client didn't authenticated itself and the requested operation has been * configured to require client authentication and authorization; this error can be avoided by * submitting the request over HTTPS including an appropriate Authorization header (HTTP basic * authentication is used)
403 Forbiddenreturned if the client authenticated itself but has not enough privileges to perform the * requested operation; to avoid this error, either use privileged credentials or ask the server * administration the grant of required privileges
406 Not Acceptablereturned if the server cannot return a response body (e.g., query response) in any of the * formats specified by the client in the request Accept header
412 Precondition Failedreturned for conditioanl read requests (GET method) using the If-Match and * If-Unmodified-Since headers and conditional write requests (PUT, POST, DELETE methods) using * headers If-Match, If-None-Match, If-Modified-Since, If-Unmodified-Since, in case client * preconditions are not met
500 Server Errorreturned in case of unexpected server error
*

Common response headers

*

* The following HTTP response headers are common to all the API operation and are thus documented * here: *

* * * * * * * * * * * * * * * * * * * * * * * * * *
NameDescription
Content-Typealways included in case an HTTP entity is returned in the response; it specifies the MIME * type of the returned entity
Content-Lengthincluded only when the response length can be determined in advance (i.e., the length is * lower than the configured buffer size); this header may be omitted in case the response is * streamed to the client meanwhile the corresponding retrieval / modification operation is being * performed on the server
Cache-controlHTTP cache control directive either allowing or preventing caching of a response by * intermediate caches. The value depends on the type of operation (retrievals are cached, * modifications no), on whether the requested URL is secured (caching is private to the * authenticated user) and on whether caching was allowed by the client in the request * Cache-Control header. In general, whenever caching is authorized, cache revalidation is always * required
ETagalways included if an HTTP entity is returned in the response; it allows cache revalidation * and conditional GET requests from clients / intermediate (caching) proxies
Last-Modifiedalways included if an HTTP entity is returned in the response; it also allows cache * revalidation and conditional GET requests from clients / intermediate (caching) proxies
*/ @javax.annotation.ParametersAreNonnullByDefault package eu.fbk.knowledgestore.server.http.jaxrs;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy