Hi,
there is a problem when reading JSON-LD containing numbers on a non-US system.
See a test program below. I found that this is caused by a bug in
com.github.jsonldjava.core.RDFDataset
and I submitted an issue:
https://github.com/jsonld-java/jsonld-java/issues/131
Best,
fps
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import org.junit.Test;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
public class NumbersOnNonUSSystemJsonLDBugTest {
@Test
public final void test() {
try {
InputStream is = new
ByteArrayInputStream(jsonLDString().getBytes("UTF-8"));
Model m = ModelFactory.createDefaultModel();
m.read(is, null, "JSON-LD");
m.write(System.out,"TTL");
// on a French system, you get
// WARN org.apache.jena.riot - Lexical form '1,0E2' not valid
for datatype http://www.w3.org/2001/XMLSchema#decimal
// <http://www.ex.com/product>
// <http://schema.org/price>
"1,0E2"^^<http://www.w3.org/2001/XMLSchema#decimal> .
} catch (UnsupportedEncodingException e) { e.printStackTrace();}
}
String jsonLDString() {
return
"{" +
"\"@id\": \"http://www.ex.com/product\"," +
"\"http://schema.org/price\": {" +
"\"@type\": \"http://www.w3.org/2001/XMLSchema#decimal\"," +
"\"@value\": 100.00" +
"}}}";
}
}