Java Code Examples for org.eclipse.rdf4j.model.vocabulary.XMLSchema#BYTE

The following examples show how to use org.eclipse.rdf4j.model.vocabulary.XMLSchema#BYTE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SmartUriAdapter.java    From rya with Apache License 2.0 6 votes vote down vote up
private static IRI determineType(final String data) {
    if (Ints.tryParse(data) != null) {
        return XMLSchema.INTEGER;
    } else if (Doubles.tryParse(data) != null) {
        return XMLSchema.DOUBLE;
    } else if (Floats.tryParse(data) != null) {
        return XMLSchema.FLOAT;
    } else if (isShort(data)) {
        return XMLSchema.SHORT;
    } else if (Longs.tryParse(data) != null) {
        return XMLSchema.LONG;
    } if (Boolean.parseBoolean(data)) {
        return XMLSchema.BOOLEAN;
    } else if (isByte(data)) {
        return XMLSchema.BYTE;
    } else if (isDate(data)) {
        return XMLSchema.DATETIME;
    } else if (isUri(data)) {
        return XMLSchema.ANYURI;
    }

    return XMLSchema.STRING;
}
 
Example 2
Source File: NumericMemLiteral.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public NumericMemLiteral(Object creator, byte number) {
	this(creator, number, XMLSchema.BYTE);
}
 
Example 3
Source File: ByteCast.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
protected IRI getXsdDatatype() {
	return XMLSchema.BYTE;
}
 
Example 4
Source File: NumericLiteral.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Creates an xsd:byte typed litral with the specified value.
 */
protected NumericLiteral(byte number) {
	this(number, XMLSchema.BYTE);
}
 
Example 5
Source File: ByteRyaTypeResolver.java    From rya with Apache License 2.0 4 votes vote down vote up
public ByteRyaTypeResolver() {
    super((byte) LITERAL_MARKER, XMLSchema.BYTE);
}
 
Example 6
Source File: DuplicateDataDetector.java    From rya with Apache License 2.0 4 votes vote down vote up
@Override
public IRI getXmlSchemaUri() {
    return XMLSchema.BYTE;
}
 
Example 7
Source File: RyaTypeUtils.java    From rya with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a byte {@link RyaType} object.
 * @param value the {@link Byte} object.
 * @return the {@link RyaType} with the data type set to
 * {@link XMLSchema#BYTE} and the data set to the specified {@code value}.
 */
public static RyaType byteRyaType(final Byte value) {
    return new RyaType(XMLSchema.BYTE, Byte.toString(value));
}