On 10/02/13 16:24, Andy Seaborne wrote:
IOT - jena is not automatically initializing RIOT readers into model.read currently; it only happens if ARQ initializes or RIOT.init is explicitly called. May be doable for the release but I prefer to be quite sure automatic initialization is stable for all ways to use Jena.
It turned out to be one localized cycle involving ModelCom rather than a widespread problem.
ModelCom is the point where the existing reader/writer factories are initialized; if these call RIOT.init themselves, then ModelCom has not finished initializing. There are lots of constants initialized and it was triggering a vocabulary to initialize ... which creates a Model hence calls back into ModelCom, before it's complete.
Solution: moving the RIOT initialization to the end of ModelCom initialization. It only needs to be before any .read call. It only happens once.
Code committed to jena-core. The test suite runs without RIOT. Calling RIOT.init is very cheap once initialized. You can tell if RIOT is initialized by either: m.read("D.ttl", "TTL") ; with no "file:" needed or parse a Turtle file with an RDF 1.1 feature e.g. ------------ @prefix : <http://example/> . :s :p :o%45 . ------------ Andy