public final class Statements extends Object
Modifier and Type | Field and Description |
---|---|
static DatatypeFactory |
DATATYPE_FACTORY |
static Set<org.openrdf.model.URI> |
TBOX_CLASSES |
static Set<org.openrdf.model.URI> |
TBOX_PROPERTIES |
static org.openrdf.model.ValueFactory |
VALUE_FACTORY |
static Function<org.openrdf.model.Value,org.openrdf.model.Value> |
VALUE_NORMALIZER |
Modifier and Type | Method and Description |
---|---|
static Hash |
computeHash(org.openrdf.model.Statement statement) |
static Hash |
computeHash(org.openrdf.model.Value value) |
static <T> T |
convert(Object object,
Class<T> clazz)
General conversion facility.
|
static <T> T |
convert(Object object,
Class<T> clazz,
T defaultValue)
General conversion facility, with fall back to default value.
|
static String |
formatValue(org.openrdf.model.Value value) |
static String |
formatValue(org.openrdf.model.Value value,
Namespaces namespaces) |
static void |
formatValue(org.openrdf.model.Value value,
Namespaces namespaces,
Appendable out) |
static Hash |
getHash(org.openrdf.model.Statement statement) |
static Hash |
getHash(org.openrdf.model.Value value) |
static boolean |
isRDFFormatLineBased(org.openrdf.rio.RDFFormat format) |
static boolean |
isRDFFormatTextBased(org.openrdf.rio.RDFFormat format) |
static org.openrdf.model.Statement |
normalize(org.openrdf.model.Statement statement) |
static <T extends org.openrdf.model.Value> |
normalize(T value) |
static org.openrdf.model.Value |
parseValue(CharSequence sequence) |
static org.openrdf.model.Value |
parseValue(CharSequence sequence,
Namespaces namespaces) |
static org.openrdf.model.Value |
shortenValue(org.openrdf.model.Value value,
int threshold) |
static Comparator<org.openrdf.model.Statement> |
statementComparator(String components,
Comparator<? super org.openrdf.model.Value> valueComparator) |
static Predicate<org.openrdf.model.Statement> |
statementMatcher(String spec) |
static File |
toRDFFile(String fileSpec) |
static org.openrdf.rio.RDFFormat |
toRDFFormat(String fileSpec) |
static Comparator<org.openrdf.model.Value> |
valueComparator(String... rankedNamespaces) |
public static final org.openrdf.model.ValueFactory VALUE_FACTORY
public static final Function<org.openrdf.model.Value,org.openrdf.model.Value> VALUE_NORMALIZER
public static final DatatypeFactory DATATYPE_FACTORY
public static final Set<org.openrdf.model.URI> TBOX_CLASSES
public static final Set<org.openrdf.model.URI> TBOX_PROPERTIES
public static Comparator<org.openrdf.model.Value> valueComparator(String... rankedNamespaces)
public static Comparator<org.openrdf.model.Statement> statementComparator(@Nullable String components, @Nullable Comparator<? super org.openrdf.model.Value> valueComparator)
@Nullable public static Predicate<org.openrdf.model.Statement> statementMatcher(@Nullable String spec)
public static org.openrdf.model.Statement normalize(org.openrdf.model.Statement statement)
@Nullable public static <T extends org.openrdf.model.Value> T normalize(@Nullable T value)
public static Hash getHash(org.openrdf.model.Statement statement)
public static Hash computeHash(org.openrdf.model.Statement statement)
public static org.openrdf.rio.RDFFormat toRDFFormat(String fileSpec)
public static boolean isRDFFormatTextBased(org.openrdf.rio.RDFFormat format)
public static boolean isRDFFormatLineBased(org.openrdf.rio.RDFFormat format)
public static org.openrdf.model.Value shortenValue(org.openrdf.model.Value value, int threshold)
public static String formatValue(@Nullable org.openrdf.model.Value value, @Nullable Namespaces namespaces)
public static void formatValue(org.openrdf.model.Value value, @Nullable Namespaces namespaces, Appendable out) throws IOException
IOException
@Nullable public static org.openrdf.model.Value parseValue(@Nullable CharSequence sequence)
public static org.openrdf.model.Value parseValue(@Nullable CharSequence sequence, @Nullable Namespaces namespaces)
@Nullable public static <T> T convert(@Nullable Object object, Class<T> clazz) throws IllegalArgumentException
object
to
an instance of the class specified. If the input is null, null is returned. If conversion
is unsupported or fails, an exception is thrown. The following table lists the supported
conversions:
From classes (and sub-classes) To classes (and super-classes) Boolean
,Literal
(xsd:boolean
)Boolean
,Literal
(xsd:boolean
),String
String
,Literal
(plain,xsd:string
)String
,Literal
(plain,xsd:string
),URI
(as uri string),BNode
(as BNode ID),Integer
,Long
,Double
,Float
,Short
,Byte
,BigDecimal
,BigInteger
,AtomicInteger
,AtomicLong
,Boolean
,XMLGregorianCalendar
,GregorianCalendar
,Date
(via parsing),Character
(length >= 1)Number
,Literal
(any numericxsd:
type)Literal
(top-level numericxsd:
type),Integer
,Long
,Double
,Float
,Short
,Byte
,BigDecimal
,BigInteger
,AtomicInteger
,AtomicLong
,String
Date
,GregorianCalendar
,XMLGregorianCalendar
,Literal
(xsd:dateTime
,xsd:date
)Date
,GregorianCalendar
,XMLGregorianCalendar
,Literal
(xsd:dateTime
),String
URI
URI
,String
BNode
BNode
,URI
(skolemization),String
Statement
Statement
,String
T
- the type of resultobject
- the object to convert, possibly nullclazz
- the class to convert to, not nullobject
was nullIllegalArgumentException
- in case conversion fails or is unsupported for the object
and class
specified@Nullable public static <T> T convert(@Nullable Object object, Class<T> clazz, @Nullable T defaultValue)
convert(Object, Class)
, but in case the input is null or conversion is not
supported returns the specified default value.T
- the type of resultobject
- the object to convert, possibly nullclazz
- the class to convert to, not nulldefaultValue
- the default value to fall back toobject
was null,
conversion failed or is unsupportedCopyright © 2015–2016 FBK-irst. All rights reserved.