diff --git a/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/internal/InlineUnsignedIntegerURIHandler.java b/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/internal/InlineUnsignedIntegerURIHandler.java index 8054df0a55..a06c92595f 100644 --- a/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/internal/InlineUnsignedIntegerURIHandler.java +++ b/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/internal/InlineUnsignedIntegerURIHandler.java @@ -90,6 +90,9 @@ public static AbstractLiteralIV createInlineIV(final BigInteger value) { */ @SuppressWarnings("rawtypes") public static AbstractLiteralIV createInlineIV(final long value) { + if (value < 0L) { + return new XSDUnsignedLongIV(value + Long.MIN_VALUE); + } if (value < 256L) { return new XSDUnsignedByteIV((byte) (value + Byte.MIN_VALUE)); } diff --git a/bigdata-rdf-test/src/test/java/com/bigdata/rdf/store/TestInlineURIs.java b/bigdata-rdf-test/src/test/java/com/bigdata/rdf/store/TestInlineURIs.java index 20d64441ec..07bba47d1a 100644 --- a/bigdata-rdf-test/src/test/java/com/bigdata/rdf/store/TestInlineURIs.java +++ b/bigdata-rdf-test/src/test/java/com/bigdata/rdf/store/TestInlineURIs.java @@ -1,5 +1,5 @@ /** -Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016. All rights reserved. +Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016. All rights reserved. Contact: SYSTAP, LLC DBA Blazegraph @@ -246,6 +246,7 @@ public void testUnsignedInteger() throws Exception { UNSIGNED_INT_NAMESPACE + Short.MAX_VALUE, true,// UNSIGNED_INT_NAMESPACE + Integer.MAX_VALUE, true,// UNSIGNED_INT_NAMESPACE + Long.MAX_VALUE, true,// + UNSIGNED_INT_NAMESPACE + "12148449524915690527", true,// UNSIGNED_INT_NAMESPACE + "19223372036854775807", true,// UNSIGNED_INT_NAMESPACE + "foo", false); }