You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2016/09/16 15:45:20 UTC

[jira] [Closed] (JENA-1232) Node toString() method doesn't take into account the prefix mapping for literals

     [ https://issues.apache.org/jira/browse/JENA-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne closed JENA-1232.
-------------------------------
    Resolution: Later

> Node toString() method doesn't take into account the prefix mapping for literals
> --------------------------------------------------------------------------------
>
>                 Key: JENA-1232
>                 URL: https://issues.apache.org/jira/browse/JENA-1232
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Base
>    Affects Versions: Jena 3.1.0
>            Reporter: Lorenz Bühmann
>            Priority: Trivial
>
> Hi,
> not sure whether this is really a (very minor) bug or just a decision by design, but what I discovered during using the graph layer of Jena was the following:
> The class org.apache.jena.graph.Node provides some toString() methods, among others, one which allows to add a PrefixMapping as argument
> This is then taken into account for rendering the object, e.g. to provide a prefixed form of a URI. But I have recognized now that this doesn't work for literals, e.g.
> "1"^^<http://www.w3.org/2001/XMLSchema#int>
> is never shortened to
> "1"^^xsd:int
> When looking into the code, I saw that in the class  org.apache.jena.graph.Node_Literal the prefix mapping is just ignored then [1], probably because it's delegated to a method of the class LiteralLabel which doesn't seem to have any method that uses prefix mappings.
> I know that this basically affects the core API, so probably this wasn't designed for 3rd party use and extensions - in that case, simply close this issue and I will continue with my current workaround.
> [1] https://github.com/apache/jena/blob/master/jena-core/src/main/java/org/apache/jena/graph/Node_Literal.java#L67



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