[
https://issues.apache.org/jira/browse/JENA-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15335618#comment-15335618
]
Andy Seaborne commented on JENA-1196:
-------------------------------------
The "URI -> ID" mapping is specific to the data sources you have.
"local name" is a specific, technical term that refers to the part after ":" in
XML qnames and in Turtle prefixed names.
"World_War_II/London" is not a valid XML local part, nor is it legal Turtle (it
would need "\/" in Turtle) so is not a legal local name - the function would
have to indicate that some how such as return null or throw an expection.
The functions in SplitIRI produce items legal for their usage.
You have a new usage for approximating a mapping between dbpedia and wikidata.
I would expect you also need to process %-encoded URIs as well (NB %-encoding
is not an escape mechanism - the "%" and two hex bytes are part of the URI. %20
is not a way to write a space. space is illegal in IRIs).
The correct design is to encapsulate these source-specific functions in a
library of your own.
> jena.graph.Node.getLocalName() bad output
> -----------------------------------------
>
> Key: JENA-1196
> URL: https://issues.apache.org/jira/browse/JENA-1196
> Project: Apache Jena
> Issue Type: Bug
> Components: Jena
> Affects Versions: Jena 3.0.1
> Environment: Ubuntu 14.04 LTS
> Reporter: Jacques Fize
> Labels: method, patch, triple
> Fix For: Jena 3.1.1
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> Hi,
> I'm currently using Jena to extract data from DBpedia dumps. In my process, i
> need to extract the URI of a DBpedia resource URL. I'm using a
> *Triple*(jena.graph.Triple) to fetch the data. But when i use the
> _Node.getLocalName()_ on an URL like
> http://dbpedia.org/resource/World_War_II/London I get *London* which is false.
> To avoid this issue, I propose to implement a new method :
> *String* _Node.getLocalName_(*String* namespace)
> It allows the user to specify the namespace to have a better extraction of
> the URI. If such a method exists already, I'm interested in knowing its name.
> Hope it helps.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)