public class EncodeDecodeValue extends Object
Value
s for interchange with the
REST API.Constructor and Description |
---|
EncodeDecodeValue() |
Modifier and Type | Method and Description |
---|---|
static org.openrdf.model.Resource[] |
decodeContexts(String[] strings)
Decode an array of named graph contexts.
|
static org.openrdf.model.Resource |
decodeResource(String param)
Type safe variant for a
Resource . |
static org.openrdf.model.URI |
decodeURI(String param)
Type safe variant for a
URI . |
static org.openrdf.model.Value |
decodeValue(String s)
Decode a URI or Literal.
|
static String[] |
encodeContexts(org.openrdf.model.Resource[] values)
Encode each Resource.
|
static String |
encodeValue(org.openrdf.model.Value v)
Encode an RDF
Value as it should appear if used in a SPARQL
query. |
public static org.openrdf.model.Value decodeValue(String s)
s
- The value to be decoded.null
if the argument was
null
.IllegalArgumentException
- if the request parameter could not be decoded as an RDF
Value
.public static org.openrdf.model.Resource decodeResource(String param)
Resource
.param
- The encoded value.null
if the argument was
null
.public static org.openrdf.model.URI decodeURI(String param)
URI
.param
- The encoded value.null
if the argument was
null
.public static String encodeValue(org.openrdf.model.Value v)
Value
as it should appear if used in a SPARQL
query. E.g., a literal will look like "abc"
,
"abc"@en
or
"3"^^xsd:int. A URI will look like <http://www.bigdata.com/>
.
v
- The value (optional).null
if the argument is
null
.IllegalArgumentException
- if the argument is a BNode
.public static org.openrdf.model.Resource[] decodeContexts(String[] strings)
strings
- An array of encoded named graph contexts (required).IllegalArgumentException
- if the argument is null
.com.bigdata.rdf.store.BD;#NULL_GRAPH
,
Resource... contexts
not encoded/decoded according to openrdf semantics (REST API) public static String[] encodeContexts(org.openrdf.model.Resource[] values)
Note: When generating URL parameters, we will have zero or more
&c=...
instances. These are turned into a Resource[]. If
there are no such arguments, then the array needs to be turned into
Resource[0] on receipt by the webapp in order to be correctly decoded by
decodeContexts(String[])
.
values
- An array of RDF Value
s.IllegalArgumentException
- if the argument is null
.com.bigdata.rdf.store.BD;#NULL_GRAPH
,
Resource... contexts
not encoded/decoded according to openrdf semantics (REST API) Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.