You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ssz (JIRA)" <ji...@apache.org> on 2019/07/09 11:13:00 UTC
[jira] [Comment Edited] (JENA-1729) A minor initilization issue
[ https://issues.apache.org/jira/browse/JENA-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16880243#comment-16880243 ]
ssz edited comment on JENA-1729 at 7/9/19 11:12 AM:
----------------------------------------------------
In my case (the project [avicomp/ont-map|https://github.com/avicomp/ont-map]) I use Jena initialization subsystem to load library graphs from system resources in order to have them as some kind of singleton: they are used widely in API, which is desired to be fast as possible. Maybe yes, loading graphs while initialization is not very good idea, and I have to think to change it somehow. But for me this is a minor issue, and here is mostly for the record; the appropriate way to use the api implies explicit calling `JenaSystem.init()`
was (Author: szz):
In my case (the project https://github.com/avicomp/ont-map) I use Jena initialization subsystem to load library graphs from system resources in order to have them as some kind of singleton: they are used widely in API, which is desired to be fast as possible. Maybe yes, loading graphs while initialization is not very good idea, and I have to think to change it somehow. For me this is a minor issue, and here is mostly for the record; the appropriate way to use the api implies explicit calling `JenaSystem.init()`
> A minor initilization issue
> ---------------------------
>
> Key: JENA-1729
> URL: https://issues.apache.org/jira/browse/JENA-1729
> Project: Apache Jena
> Issue Type: Bug
> Components: Core
> Environment: java8(1.8.0_152), jena-arq:3.12.0
> Reporter: ssz
> Priority: Minor
> Fix For: Jena 3.12.0
>
>
> The following one-class program fails with assertion error:
>
> {code:java}
> package xx.yy;
> import org.apache.jena.rdf.model.RDFNode;
> import org.apache.jena.rdf.model.ResourceFactory;
> import org.apache.jena.sys.JenaSubsystemLifecycle;
> import org.apache.jena.sys.JenaSystem;
> import org.apache.jena.vocabulary.RDF;
> public class InitTest implements JenaSubsystemLifecycle {
> @Override
> public void start() {
> if (JenaSystem.DEBUG_INIT)
> System.err.println("InitTEST -- start");
> assert RDF.type != null : "RDF#type is null => attempt to load a graph here will fail";
> }
> @Override
> public void stop() {
> if (JenaSystem.DEBUG_INIT)
> System.err.println("InitTEST -- finish");
> }
> @Override
> public int level() {
> return 500;
> }
> public static void main(String... args) { // run VM option: -ea
> JenaSystem.DEBUG_INIT = true;
> //RDFNode r = ResourceFactory.createProperty("X"); // this works fine
> RDFNode r = ResourceFactory.createTypedLiteral("Y"); // this causes a problem
> System.out.println(r);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)