Package org.eclipse.rdf4j.http.protocol
Class Protocol
java.lang.Object
org.eclipse.rdf4j.http.protocol.Protocol
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines the action a particular transaction update is executing.static enum
Deprecated. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Parameter name for the Accept parameter (may also be used as the name of the Accept HTTP header).static final String
Parameter name for the action parameter used in transactions.static final String
Parameter name for the base-URI parameter.static final String
Parameter prefix for query-external variable bindings.static final String
Configurable system propertyrdf4j.server.txn.registry.timeout
for specifying the transaction cache timeout (in seconds).static final String
Relative location of the config resource.static final String
Parameter name for the context parameter.static final String
Relative location of the context list resource of a repository.static final String
Parameter name for the default graph URI parameter.static final int
Default timeout setting for transaction cache entries (in seconds).static final String
Parameter name for the distinct parameter.static final String
MIME type for www forms: application/x-www-form-urlencoded.static final String
Parameter name for the graph parameter.static final String
Parameter name for the 'includeInferred' parameter.static final String
Parameter name for the default insert graph URI parameter.static final String
Deprecated.since 3.3.0.static final String
static final String
Parameter name for the named graph URI parameter.static final String
Relative location of the namespaces list resource of a repository.static final String
Parameter value for the NULL context.static final String
Parameter name for the 'object' parameter of statement query.static final String
static final String
Parameter name for the 'predicate' parameter of a statement query.static final String
Parameter for server instruction to preserve blank node ids when parsing request data.static final String
Relative location of the protocol resource.static final String
Parameter name for the query language parameter.static final String
Parameter name for the query parameter.static final String
Parameter name for the default remove graph URI parameter.static final String
Relative location of the repository list resource.static final String
Relative location of the 'size' resource of a repository.static final String
MIME type for SPARQL update: application/sparql-query.static final String
MIME type for SPARQL update: application/sparql-update.static final String
Relative location of the statement list resource of a repository.static final String
Parameter name for the 'subject' parameter of a statement query.static final String
static final String
Prefix for transaction settings in the query paramstatic final String
Relative location of the transaction resources of a repository.static final String
MIME type for transactions: application/x-rdftransaction.static final String
Parameter name for the update parameter.static final String
Parameter name for the default graph URI parameter for update.static final String
Parameter name for the named graph URI parameter for update.static final String
Protocol version. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Resource
decodeContext
(String encodedValue, ValueFactory valueFactory) Decode a previously encoded context Resource.static Resource[]
decodeContexts
(String[] encodedValues, ValueFactory valueFactory) Decode previously encoded contexts.static Resource
decodeResource
(String encodedValue, ValueFactory valueFactory) Decode a previously encoded Resource.static IRI
decodeURI
(String encodedValue, ValueFactory valueFactory) Decode a previously encoded URI.static Value
decodeValue
(String encodedValue, ValueFactory valueFactory) Decode a previously encoded value.static String
encodeContext
(Resource context) Encodes a context resource for use in a URL.static String[]
encodeContexts
(Resource... contexts) Encode context resources for use in a URL.static String
encodeValue
(Value value) Encodes a value in a canonical serialized string format, for use in a URL query parameter.static final String
getConfigLocation
(String serverLocation) Get the location of the server configuration resource on the specified server.static final String
getContextsLocation
(String repositoryLocation) Get the location of the contexts lists resource for a specific repository.static final String
getNamespacePrefixLocation
(String repositoryLocation, String prefix) Get the location of the namespace with the specified prefix for a specific repository on the specified server.static final String
getNamespacesLocation
(String repositoryLocation) Get the location of the namespaces lists resource for a specific repository on the specified server.static final String
getProtocolLocation
(String serverLocation) Get the location of the protocol resource on the specified server.static final String
getRepositoriesLocation
(String serverLocation) Get the location of the repository list resource on the specified server.static final String
getRepositoryConfigLocation
(String repositoryLocation) Get the location of the config of a specific repository resource.static final String
getRepositoryID
(String repositoryLocation) Extracts the repository ID from the repository location.static final String
getRepositoryLocation
(String serverLocation, String repositoryID) Get the location of a specific repository resource on the specified server.static final String
getServerLocation
(String repositoryLocation) Extracts the server location from the repository location.static final String
getSizeLocation
(String repositoryLocation) Get the location of the 'size' resource for a specific repository on the specified server.static final String
getStatementsLocation
(String repositoryLocation) Get the location of the statements resource for a specific repository.static final String
getTransactionsLocation
(String repositoryLocation) Get the location of the transaction resources for a specific repository.
-
Field Details
-
CACHE_TIMEOUT_PROPERTY
Configurable system propertyrdf4j.server.txn.registry.timeout
for specifying the transaction cache timeout (in seconds).- See Also:
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUTDefault timeout setting for transaction cache entries (in seconds).- See Also:
-
VERSION
Protocol version.- 12: since RDF4J 3.5.0
- 11: since RDF4J 3.3.0
- 10: since RDF4J 3.1.0
- 9: since RDF4J 3.0.0
- See Also:
-
SUBJECT_PARAM_NAME
Parameter name for the 'subject' parameter of a statement query.- See Also:
-
PREDICATE_PARAM_NAME
Parameter name for the 'predicate' parameter of a statement query.- See Also:
-
OBJECT_PARAM_NAME
Parameter name for the 'object' parameter of statement query.- See Also:
-
INCLUDE_INFERRED_PARAM_NAME
Parameter name for the 'includeInferred' parameter.- See Also:
-
CONTEXT_PARAM_NAME
Parameter name for the context parameter.- See Also:
-
NULL_PARAM_VALUE
Parameter value for the NULL context.- See Also:
-
GRAPH_PARAM_NAME
Parameter name for the graph parameter.- See Also:
-
UPDATE_PARAM_NAME
Parameter name for the update parameter.- See Also:
-
BASEURI_PARAM_NAME
Parameter name for the base-URI parameter.- See Also:
-
QUERY_PARAM_NAME
Parameter name for the query parameter.- See Also:
-
LIMIT_PARAM_NAME
- See Also:
-
OFFSET_PARAM_NAME
- See Also:
-
QUERY_LANGUAGE_PARAM_NAME
Parameter name for the query language parameter.- See Also:
-
TIMEOUT_PARAM_NAME
- See Also:
-
REMOVE_GRAPH_PARAM_NAME
Parameter name for the default remove graph URI parameter.- See Also:
-
INSERT_GRAPH_PARAM_NAME
Parameter name for the default insert graph URI parameter.- See Also:
-
USING_GRAPH_PARAM_NAME
Parameter name for the default graph URI parameter for update.- See Also:
-
USING_NAMED_GRAPH_PARAM_NAME
Parameter name for the named graph URI parameter for update.- See Also:
-
DEFAULT_GRAPH_PARAM_NAME
Parameter name for the default graph URI parameter.- See Also:
-
NAMED_GRAPH_PARAM_NAME
Parameter name for the named graph URI parameter.- See Also:
-
ACCEPT_PARAM_NAME
Parameter name for the Accept parameter (may also be used as the name of the Accept HTTP header).- See Also:
-
ISOLATION_LEVEL_PARAM_NAME
Deprecated.since 3.3.0. Usetransaction-setting__isolation-level
instead.Parameter name for the isolation level used in transactions. -
TRANSACTION_SETTINGS_PREFIX
Prefix for transaction settings in the query param- Since:
- 3.3.0
- See Also:
-
ACTION_PARAM_NAME
Parameter name for the action parameter used in transactions.- See Also:
-
DISTINCT_PARAM_NAME
Parameter name for the distinct parameter.- See Also:
-
PROTOCOL
Relative location of the protocol resource.- See Also:
-
CONFIG
Relative location of the config resource.- See Also:
-
REPOSITORIES
Relative location of the repository list resource.- See Also:
-
STATEMENTS
Relative location of the statement list resource of a repository.- See Also:
-
TRANSACTIONS
Relative location of the transaction resources of a repository.- See Also:
-
CONTEXTS
Relative location of the context list resource of a repository.- See Also:
-
NAMESPACES
Relative location of the namespaces list resource of a repository.- See Also:
-
BINDING_PREFIX
Parameter prefix for query-external variable bindings.- See Also:
-
SIZE
Relative location of the 'size' resource of a repository.- See Also:
-
TXN_MIME_TYPE
MIME type for transactions: application/x-rdftransaction.- See Also:
-
FORM_MIME_TYPE
MIME type for www forms: application/x-www-form-urlencoded.- See Also:
-
SPARQL_QUERY_MIME_TYPE
MIME type for SPARQL update: application/sparql-query.- See Also:
-
SPARQL_UPDATE_MIME_TYPE
MIME type for SPARQL update: application/sparql-update.- See Also:
-
PRESERVE_BNODE_ID_PARAM_NAME
Parameter for server instruction to preserve blank node ids when parsing request data.- See Also:
-
-
Constructor Details
-
Protocol
public Protocol()
-
-
Method Details
-
getProtocolLocation
Get the location of the protocol resource on the specified server.- Parameters:
serverLocation
- the base location of a server implementing this REST protocol.- Returns:
- the location of the protocol resource on the specified server
-
getConfigLocation
Get the location of the server configuration resource on the specified server.- Parameters:
serverLocation
- the base location of a server implementing this REST protocol.- Returns:
- the location of the server configuration resource on the specified server
-
getRepositoriesLocation
Get the location of the repository list resource on the specified server.- Parameters:
serverLocation
- the base location of a server implementing this REST protocol.- Returns:
- the location of the repository list resource on the specified server
-
getRepositoryLocation
Get the location of a specific repository resource on the specified server.- Parameters:
serverLocation
- the base location of a server implementing this REST protocol.repositoryID
- the ID of the repository- Returns:
- the location of a specific repository resource on the specified server
-
getRepositoryConfigLocation
Get the location of the config of a specific repository resource.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the location of the configuration resource for the specified repository
-
getStatementsLocation
Get the location of the statements resource for a specific repository.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the location of the statements resource for the specified repository
-
getTransactionsLocation
Get the location of the transaction resources for a specific repository.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the location of the transaction resources for the specified repository
-
getServerLocation
Extracts the server location from the repository location.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the location of the server resource for the specified repository.
-
getRepositoryID
Extracts the repository ID from the repository location.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the ID of the repository.
-
getContextsLocation
Get the location of the contexts lists resource for a specific repository.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the location of the contexts lists resource for the specified repository
-
getNamespacesLocation
Get the location of the namespaces lists resource for a specific repository on the specified server.- Parameters:
repositoryLocation
- the base location of a server implementing this REST protocol.- Returns:
- the location of the namespaces lists resource for a specific repository on the specified server
-
getNamespacePrefixLocation
Get the location of the namespace with the specified prefix for a specific repository on the specified server.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.prefix
- the namespace prefix- Returns:
- the location of the the namespace with the specified prefix for a specific repository on the specified server
-
getSizeLocation
Get the location of the 'size' resource for a specific repository on the specified server.- Parameters:
repositoryLocation
- the location of a repository implementing this REST protocol.- Returns:
- the location of the 'size' resource for a specific repository on the specified server
-
encodeValue
Encodes a value in a canonical serialized string format, for use in a URL query parameter.- Parameters:
value
- The value to encode, possibly null.- Returns:
- The protocol-serialized representation of the supplied value, or
NULL_PARAM_VALUE
if the supplied value was null.
-
decodeValue
Decode a previously encoded value.- Parameters:
encodedValue
- the encoded valuevalueFactory
- the factory to use for constructing the Value- Returns:
- the decoded Value
- See Also:
-
decodeResource
Decode a previously encoded Resource.- Parameters:
encodedValue
- the encoded valuevalueFactory
- the factory to use for constructing the Resource- Returns:
- the decoded Resource
- See Also:
-
decodeURI
Decode a previously encoded URI.- Parameters:
encodedValue
- the encoded valuevalueFactory
- the factory to use for constructing the URI- Returns:
- the decoded URI
- See Also:
-
encodeContext
Encodes a context resource for use in a URL.- Parameters:
context
- The context to encode, possibly null.- Returns:
- The protocol-serialized representation of the supplied context, or
NULL_PARAM_VALUE
if the supplied value was null.
-
decodeContext
Decode a previously encoded context Resource.- Parameters:
encodedValue
- the encoded valuevalueFactory
- the factory to use for constructing the Resource- Returns:
- the decoded Resource, or null if the encoded values was null or equal to
NULL_PARAM_VALUE
-
encodeContexts
Encode context resources for use in a URL.- Parameters:
contexts
- the contexts to encode, must not be null.- Returns:
- the encoded contexts
- Throws:
IllegalArgumentException
- If the contexts is null.
-
decodeContexts
Decode previously encoded contexts.- Parameters:
encodedValues
- the encoded valuesvalueFactory
- the factory to use for constructing the Resources- Returns:
- the decoded Resources, or an empty array if the supplied encodedValues was null.
-