[ 
https://issues.apache.org/jira/browse/JENA-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15604819#comment-15604819
 ] 

Andy Seaborne edited comment on JENA-1249 at 10/25/16 12:36 PM:
----------------------------------------------------------------

Proposal: 

Remove the ability to set the default a prefix mapping on ModelCom.

ModelFactory has the same functionality (currently, it sets the statics in 
ModelCom).

Remove from ModelFactory as well (deprecation cycle) - specifically so that it 
does not happen for {{ModelFactory.createModelForGraph}} which is the common 
way to put a Model wrapper around a Graph.

This is a proposed two step plan :

# avoid the problem for 3.1.1 by checking whether prefix mapping defaults need 
setting. If not, the normal case, prefixes loading does not occur during model 
creation.
# deprecate the associated functionality (setting a default prefix map) with a 
view to removal.  I believe is little used, especially with TDB where it could 
cause a read transaction to try to write.

There is a interaction with how Jena initializes because common vocabularies 
depend on ModelCom, and ModelCom depends on subsystem prefix initialization, 
which initializes common vocabularies. Removing implicit default prefixes will 
break that cycle making initialization more reliable as the code changes cause 
different class initialization orderings.



was (Author: andy.seaborne):
Proposal: 

Remove the ability to set the default a prefix mapping on ModelCom.

ModelFactory has the same functionality (currently, it sets the statics in 
ModelCom).

Remove from ModelFactory as well (deprecation cycle) - specifically so that it 
does not happen for {{ModelFactory.createModelForGraph}} which is the common 
way to put a Model wrapper around a Graph.

This is a proposed two step plan :

#. avoid the problem for 3.1.1 by checking whether prefix mapping defaults need 
setting. If not, the normal case, prefixes loading does not occur during model 
creation.

#. deprecate the associated functionality (setting a default prefix map) with a 
view to removal.  I believe is little used, especially with TDB where it could 
cause a read transaction to try to write.

There is a interaction with how Jena initializes because common vocabularies 
depend on ModelCom, and ModelCom depends on subsystem prefix initialization, 
which initializes common vocabularies. Removing implicit default prefixes will 
break that cycle making initialization more reliable as the code changes cause 
different class initialization orderings.


> ModelCom constuction triggers prefix reading in TDB
> ---------------------------------------------------
>
>                 Key: JENA-1249
>                 URL: https://issues.apache.org/jira/browse/JENA-1249
>             Project: Apache Jena
>          Issue Type: Bug
>            Reporter: Andy Seaborne
>         Attachments: ReportPerf.java
>
>
> For TDB, the Dataset-level wrapper is {{DatasetImpl}}. The model-level 
> operations {{Dataset.getDefaultModel}} and {{Dataset.getNamedModel}} use a 
> {{ModelCom}} to wrap the graph.
> The {{ModelCom}} construct also calls {{ModelCom.getPrefixMapping}} which in 
> turn triggers the TDB graph level prefix mapping to be created.
> Due to JENA-81, the prefix map is read to the cache when the graph starts.
> Overall result - creating the model causes the prefix mappings to be read.
> We should avoid calling {{getPrefixMapping}} inside the {{ModelCom}} 
> constructor.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to