makes sense now. Can I suggest making this small change to the docs ( http://jena.apache.org/documentation/query/library-function.html), for future travelers:
The local name of ?x if a IRI. Based on splitting the IRI, not on any prefixes in the query or dataset, in order to achieve the longest valid localname according to the XML definition of a localname. On Sun, May 11, 2014 at 2:22 AM, Andy Seaborne <a...@apache.org> wrote: > On 07/05/14 19:36, Tim Harsch wrote: > >> Why does this query: >> >> PREFIX afn:<http://jena.hpl.hp.com/ARQ/function#> >> SELECT ?s2 >> WHERE >> { >> BIND(<http://example.org/book/book2/sadfju/62eja> AS ?uri) >> BIND( afn:localname(?uri) AS ?s2 ) >> } >> >> give this answer: >> >> --------- >> | s2 | >> ========= >> | "eja" | >> --------- >> >> shouldn't it be: "62eja" ? >> > > Yes. No. History. :-) > > afn:localname returns the longest valid local name for any use. > > In XML, the local part of a qname can't start with a digit so the longest > valid localname is "eja" for use in RDF/XML. > > Andy > > > >> The docs only say this about afn:localname "The local name of ?x if a >> IRI. Based on splitting the IRI, not on any prefixes in the query or >> dataset." >> >> >> Thanks, >> >> Tim >> >> >