You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org> on 2011/01/20 16:55:43 UTC

[jira] Created: (JENA-31) Add possibility to connect serializers to prefix service

Add possibility to connect serializers to prefix service
--------------------------------------------------------

                 Key: JENA-31
                 URL: https://issues.apache.org/jira/browse/JENA-31
             Project: Jena
          Issue Type: Improvement
          Components: Jena
            Reporter: Reto Bachmann-Gmür


Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (JENA-31) Add possibility to connect serializers to prefix service

Posted by Andy Seaborne <an...@epimorphics.com>.

On 20/01/11 15:55, Reto Bachmann-Gmür (JIRA) wrote:
> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                   Key: JENA-31
>                   URL: https://issues.apache.org/jira/browse/JENA-31
>               Project: Jena
>            Issue Type: Improvement
>            Components: Jena
>              Reporter: Reto Bachmann-Gmür
>
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

It is feasible - the application can analysis the data, make choices of 
prefixes, set the prefix map appropriately and call the writer.  This 
seems to be what you are asking that Jena provide that functionality 
rather than the application.

Adding the interfaces and interactions necessary to do that would still 
need application code to be invoked to make the choices so I don't think 
it provides much benefit.

Pretty printing RDF/XML requires all the prefixes to be available at the 
start.

The whole problem is rather different for Turtle and related languages. 
  Analysing the model is, in general, not practical (it's too large). 
It's possible to write subsets of Turtle as a single pass over the data 
and analysing the data would slow that down a great deal.

Carrying all the namespaces, even unused, that were mentioned in the 
initial data read is current behaviour and one that natural 
user-expectation (despite prefixes having no formal role in RDF).


[jira] [Commented] (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080866#comment-13080866 ] 

Reto Bachmann-Gmür commented on JENA-31:
----------------------------------------

Stumbled once again over an RDF/XML with lot of generated J.<NUM> prefixes. Even if a jena-model is a graph and a prefix mapping and some user may want to have their unused prefixes in the RDF/XML I would like to be able to have more friendly prefixes than this J.<NUM> prefix without requiring massive additional computational costs like analysing the predicates of all properties in advance. As even a comprehensive pre-written list of prefix binding is not guaranteed to contain all needed prefix I see no performance or scalability advantage not to allow connecting such a service (for RDF/XML).

For the exchangeability of writers/serializers you might want to have a look at the service approach used in clerezza. In fact the jena-based serializer is just one of several exchageable serializers (but currently the only one for RDF/XML, that's why I'd like to get rid of those ugly prefixes)

> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985099#action_12985099 ] 

Reto Bachmann-Gmür commented on JENA-31:
----------------------------------------

"natural user expectation"

I seem to be an unnatural user :) 

I've never thought of jena model and jena graphs as being a set of prefix-mappings and a graph, I always saw them just as RDF Graphs.

> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Commented] (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080920#comment-13080920 ] 

Andy Seaborne commented on JENA-31:
-----------------------------------

Why not contribute a utility that analyses the model and returns a prefix mapping?

This separates the functionality nicely.  A new writer can be added to plug these two steps together, or it can be used with existing writers, or just used as a useful tool in it's own right.  This way, service availability is not a requirement of the RDF/XML writer.


> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985569#action_12985569 ] 

Andy Seaborne commented on JENA-31:
-----------------------------------

The example of large scale output to Turtle makes the point - it can be done streaming (and with parallelism).  Having the prefixes at the start of the process makes that possible.

Because you can put in application specific writers (and we hope to make this easier than it is today but it is possible now), the functionality specifically requested can be implemented and in such a way that existing writers, and ones working at scale, are not affected.


> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984746#action_12984746 ] 

Andy Seaborne commented on JENA-31:
-----------------------------------

The application can analysis the data, make choices of prefixes, set the prefix map appropriately and call the writer.  This seems to be what you are asking only differing in that Jena provide that functionality rather than the application.

Adding the interfaces and interactions necessary to do that would still need application code to be invoked to make the choices so I don't think it provides much benefit and would complicate writing a writer.

Pretty printing RDF/XML requires all the prefixes to be available at the start.

The whole problem is rather different for Turtle and related languages.  Analysing the model is, in general, not practical (it's too large). It's possible to write in a subset of Turtle (N-Triples+prefixes) as a single pass over the data and analysing the data would slow that down a great deal.

Carrying all the namespaces, even unused, that were mentioned in the initial data read is current behaviour and one that is a natural user expectation (despite prefixes having no formal role in RDF). 

> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985098#action_12985098 ] 

Reto Bachmann-Gmür commented on JENA-31:
----------------------------------------

"The application can analysis the data, make choices of prefixes, set the prefix map appropriately and call the writer. "

I see that this is a possible work-around, howverrequiring the application to iterate over the data and determine the prefixed part for every uri seems highly inefficient.

"Pretty printing RDF/XML requires all the prefixes to be available at the start. *
Then the pretty-printer has to look at the data and find-out which prefixes are needed, as uris in predicated position need a prefix this step is necessary even if all prefixes in the map would be put in the prefix-mapping in the XML header.

For huge turtle seralization it might be ausefull setting, to limit the number of triples that are evaluated as possible prefixes, once this number has been reach subsequent triples never cause a yet unused prefix to be added.

> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Commented] (JENA-31) Add possibility to connect serializers to prefix service

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082582#comment-13082582 ] 

Reto Bachmann-Gmür commented on JENA-31:
----------------------------------------

The point is that analyzing the model in advance is very inefficient, it duplicates the task of splitting prefix from suffix, also for formats like RDF/XML where the use of prefix is non-optional the serializer needs to keep a list of all encountered prefixes anyway.

The prefix service introduced with this issue is of course optional for serializing, when no such service is specified it shall default to the current J.<num> prefixes.

> Add possibility to connect serializers to prefix service
> --------------------------------------------------------
>
>                 Key: JENA-31
>                 URL: https://issues.apache.org/jira/browse/JENA-31
>             Project: Jena
>          Issue Type: Improvement
>          Components: Jena
>            Reporter: Reto Bachmann-Gmür
>
> Currently the serializers want to access the whole set of available prefimappings, instead they shold only ask for a prefix suggestion for uris actually in the model, that way it is possible to connect services which can suggest prefixes for a huge number of uris which is not reasonably feasible now.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira