Re: LocalName

2017-02-16 Thread Andy Seaborne



On 16/02/17 10:47, Lorenz B. wrote:

1. you could use REGEX
2. I really suggest to use the rdfs:label (or something similar) if
exists for the human readable name of a URI


Good suggestions.




Hi,

I have a question about striving the local name out of the URI.

SO for example,

the URI I print it out looks like the following:
http://example.com/resource/authors/%28Zhou%29_Bryan_Bai
<http://dblp.l3s.de/d2r/resource/authors/%28Zhou%29_Bryan_Bai>

if I apply:

String localName = resource.getLocalName();

the value of localName is : _Bryan_Bai .
How do I get the value as Zhou_Bryan_Bai


A local name follows the rules for XML qnames.

They can not start with a digit.

They can not contain %

so the longest is "_Bryan_Bai"

Andy



Thanks in Advance!



Re: LocalName

2017-02-16 Thread Lorenz B.
1. you could use REGEX
2. I really suggest to use the rdfs:label (or something similar) if
exists for the human readable name of a URI

> Hi,
>
> I have a question about striving the local name out of the URI.
>
> SO for example,
>
> the URI I print it out looks like the following:
> http://example.com/resource/authors/%28Zhou%29_Bryan_Bai
> <http://dblp.l3s.de/d2r/resource/authors/%28Zhou%29_Bryan_Bai>
>
> if I apply:
>
> String localName = resource.getLocalName();
>
> the value of localName is : _Bryan_Bai .
> How do I get the value as Zhou_Bryan_Bai
>
> Thanks in Advance!
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center