문제

I have seen some examples where there is a possibility to convert known serializations in RDF/XML but when the input format (e.g. XML/Turtle/N3) is not known, is there any way of achieving the conversion?

I am writing a tool that receives RDF in different serializations (Turtle/xml/n3) but when I call

 model.read(InputStream in, "", "") 

method of Model Class from Jena, there are exceptions.

도움이 되었습니까?

해결책

It's an input stream - you have to tell it the format. model.read(in, base, "TURTLE"). It does not sniff the stream. You could do a sequence of model.read each inside a try-catch until one does not cause an exception.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top