public final class Values extends Object
Utility functions for creating and working with RDF values
| Modifier and Type | Field and Description |
|---|---|
static IRI |
ALL_GRAPHS
Special IRI representing the union of the default graph and all named graphs
|
static DatatypeFactory |
DATATYPE_FACTORY
Datatype factory that will be used for date/time literals.
|
static IRI |
DEFAULT_GRAPH
Special IRI representing the default (no) context.
|
static IRI |
NAMED_GRAPHS
Special IRI representing the only named graphs; this excludes the default graph
|
| Modifier and Type | Method and Description |
|---|---|
static BNode |
bnode()
Create a new
BNode |
static BNode |
bnode(String theId)
Create a new
BNode |
static IRI |
iri(String theIRI)
Create a new
IRI |
static IRI |
iri(String theNS,
String theLocalName)
Create a new
IRI from a namespace and a local name |
static boolean |
isAll(Resource theContext)
Return whether or not the resource represents the meta-context
ALL_GRAPHS |
static boolean |
isDefaultGraph(Resource theContext)
Return whether or not the given
Resource denotes the default graph |
static boolean |
isInDefaultGraph(Statement theStmt)
Return whether or not the given
Statement is in the default graph |
static boolean |
isNamed(Resource theContext)
Return whether or not the resource represents the meta-context
NAMED_GRAPHS |
static boolean |
isValid(Literal theLiteral)
Verifies that the given literal is valid.
|
static boolean |
isValid(Value theValue)
Verifies that the given value is valid.
|
static Literal |
literal(BigDecimal theBigDecimal) |
static Literal |
literal(BigInteger theInt) |
static Literal |
literal(boolean theValue)
Create a new `xsd:boolean`
Literal |
static Literal |
literal(byte theValue)
Create a new `xsd:byte`
Literal |
static Literal |
literal(Date theDate)
Create a new
Literal for the given `Date` value. |
static Literal |
literal(double theValue)
Create a new `xsd:double`
Literal |
static Literal |
literal(Duration theDuration)
Create a Duration typed literal.
|
static Literal |
literal(Duration theCalendar,
Datatype theDatatype) |
static Literal |
literal(Duration theDuration,
IRI theDurationType)
Create a Duration typed literal.
|
static Literal |
literal(float theValue)
Create a new `xsd:float`
Literal |
static Literal |
literal(GregorianCalendar theDate)
|
static Literal |
literal(int theValue)
Create a new `xsd:int`
Literal |
static Literal |
literal(int theLabel,
Datatype theDatatype)
Create a new
Literal |
static Literal |
literal(long theValue)
Create a new `xsd:long`
Literal |
static Literal |
literal(long theLabel,
Datatype theDatatype)
Create a new
Literal |
static Literal |
literal(Number theNumber) |
static Literal |
literal(short theValue)
Create a new `xsd:short`
Literal |
static Literal |
literal(String theLabel)
Create a new `xsd:string`
Literal |
static Literal |
literal(String theLabel,
Datatype theDatatype)
Create a new
Literal |
static Literal |
literal(String theLabel,
IRI theDatatype)
Create a new typed
Literal |
static Literal |
literal(String theLabel,
String theLanguage)
Create a new language
Literal |
static Literal |
literal(XMLGregorianCalendar theCalendar)
|
static Literal |
literal(XMLGregorianCalendar theCalendar,
Datatype theDatatype) |
static Namespace |
namespace(String thePrefix,
String theIRI)
Create a
Namespace |
static Statement |
statement(Resource theSubject,
IRI thePredicate,
Value theObject)
Create a new
Statement in the default graph |
static Statement |
statement(Resource theSubject,
IRI thePredicate,
Value theObject,
Resource theContext)
Create a new
Statement |
public static final IRI DEFAULT_GRAPH
public static final IRI ALL_GRAPHS
public static final IRI NAMED_GRAPHS
public static final DatatypeFactory DATATYPE_FACTORY
@Nonnull public static Namespace namespace(@Nonnull String thePrefix, @Nonnull String theIRI)
NamespacethePrefix - the prefixtheIRI - the IRI@Nonnull public static IRI iri(@Nonnull String theNS, @Nonnull String theLocalName)
IRI from a namespace and a local nametheNS - the namespace IRItheLocalName - the local name@Nonnull public static IRI iri(@Nonnull String theIRI)
IRItheIRI - the IRI string@Nonnull public static BNode bnode(@Nonnull String theId)
BNodetheId - the id of the bnode@Nonnull public static Literal literal(@Nonnull String theLabel)
LiteraltheLabel - the label@Nonnull public static Literal literal(boolean theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(int theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(long theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(float theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(double theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(short theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(byte theValue)
LiteraltheValue - the value@Nonnull public static Literal literal(@Nonnull String theLabel, @Nonnull IRI theDatatype)
LiteraltheLabel - the label of the literaltheDatatype - the datatype@Nonnull public static Literal literal(@Nonnull String theLabel, @Nonnull String theLanguage)
LiteraltheLabel - the label of the literaltheLanguage - the language of the literal@Nonnull public static Literal literal(int theLabel, @Nonnull Datatype theDatatype)
LiteraltheLabel - the label of the literal valuetheDatatype - the datatypeIllegalArgumentException - if the provided value `theLabel` is not syntactically correct wrt to its Datatype@Nonnull public static Literal literal(long theLabel, @Nonnull Datatype theDatatype)
LiteraltheLabel - the label of the literal valuetheDatatype - the datatypeIllegalArgumentException - if the provided value `theLabel` is not syntactically correct wrt to its Datatype@Nonnull public static Literal literal(@Nonnull String theLabel, @Nonnull Datatype theDatatype)
LiteraltheLabel - the label of the literal valuetheDatatype - the datatypeNumberFormatException - if the literal is declared as a number, such as an `int` but is not syntactically correct.IllegalArgumentException - if the provided value `theLabel` is not syntactically correct wrt to its Datatype@Nonnull public static Literal literal(@Nonnull Date theDate)
Literal for the given `Date` value.theDate - the value of the literalCalendarLiteral@Nonnull public static Literal literal(@Nonnull GregorianCalendar theDate)
theDate - the value of the literalCalendarLiteral@Nonnull public static Literal literal(@Nonnull Duration theDuration)
theDuration - the duration@Nonnull public static Literal literal(@Nonnull Duration theDuration, @Nonnull IRI theDurationType)
theDuration - the durationtheDurationType - the duration datatype@Nonnull public static Literal literal(@Nonnull XMLGregorianCalendar theCalendar)
theCalendar - the value of the literalCalendarLiteral@Nonnull public static Literal literal(@Nonnull XMLGregorianCalendar theCalendar, Datatype theDatatype)
@Nonnull public static Literal literal(@Nonnull BigDecimal theBigDecimal)
@Nonnull public static Literal literal(@Nonnull BigInteger theInt)
@Nonnull public static Statement statement(@Nonnull Resource theSubject, @Nonnull IRI thePredicate, @Nonnull Value theObject)
Statement in the default graphtheSubject - the subject of the statementthePredicate - the predicate of the statementtheObject - the object of the statementpublic static boolean isValid(Literal theLiteral)
theLiteral - the literal to validatepublic static boolean isValid(Value theValue)
theValue - the value to validate@Nonnull public static Statement statement(@Nonnull Resource theSubject, @Nonnull IRI thePredicate, @Nonnull Value theObject, Resource theContext)
StatementtheSubject - the subject of the statementthePredicate - the predicate of the statementtheObject - the object of the statementtheContext - the context of the statement. if the statement is intended to be in the default graph,
DEFAULT_GRAPH should be used.public static boolean isDefaultGraph(Resource theContext)
Resource denotes the default graphtheContext - the graphpublic static boolean isInDefaultGraph(@Nonnull Statement theStmt)
Statement is in the default graphtheStmt - the graphpublic static boolean isAll(@Nonnull Resource theContext)
ALL_GRAPHStheContext - the contextALL, false otherwisepublic static boolean isNamed(@Nonnull Resource theContext)
NAMED_GRAPHStheContext - the contextNAMED, false otherwiseCopyright © 2010-2016 Stardog Union. All Rights Reserved.