W3C home > Mailing lists > Public > www-ql@w3.org > July to September 2004

RE: Generating RDF-style URIs from a namespace

From: Michael Kay <mhk@mhk.me.uk>
Date: Wed, 8 Sep 2004 08:59:43 +0100
To: "'Per Bothner'" <per@bothner.com>, "'Howard Katz'" <howardk@fatdog.com>
Cc: <www-ql@w3.org>
Message-ID: <E1C4xNL-00071C-5V@frink.w3.org>

I avoided weighing into this because I really found the question very
unclear, but since namespaces and QNames are such a thorny area (one that is
still being refined in the spec) the use case deserves examination. 

Could you explain exactly what your input is, what your desired output is,
and what information is known statically? Preferably in language that
doesn't rely on any knowledge of RDF.

Michael Kay



> Paul Cotton wrote:
> 
> > This means that the NamespaceDecl cannot contain function calls or
> > string concatentation.
> 
> But the question wasn't generating namespaces, but generating URIs.
> 
> It seems to me you should be able to use a cast to a QName:
> 
> declare namespace foo="http://foo/";
> for $name in ("bar", "baz")
> let $qname := QName(concat("foo:",$name) return
> xs:anyURI( concat(namespace-uri-from-QName($name),
>                    local-name-from-QName($name)))
> 
> or
> 
> declare namespace foo="http://foo/";
> let $foo := namespace-uri-from-QName(QName("foo:unused"))
> for $name in ("bar", "baz")
> xs:anyURI( concat($foo, $name))
> -- 
> 	--Per Bothner
> per@bothner.com   http://per.bothner.com/
> 
> 
Received on Wednesday, 8 September 2004 08:00:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:16 UTC