473,395 Members | 1,986 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

combining names and namespaces into a one URI

Is there a standardized recommendation for combining names and
namespaces into a single URI?

I found a post on the Stylus Studio forum asking the same question,
the response was "use James Clark's {http://www.namespace.com}name
notation". The post is 7 years old and I'm wondering if anything has
changed...

thanks

Nick

Feb 25 '07 #1
4 1832
na******@gmail.com wrote:
Is there a standardized recommendation for combining names and
namespaces into a single URI?

I found a post on the Stylus Studio forum asking the same question,
the response was "use James Clark's {http://www.namespace.com}name
notation". The post is 7 years old and I'm wondering if anything has
changed...
That combined form isn't a URI.

It's still one common solution to displaying the NSURI/localname pair,
but there is absolutely no "standard" behind it; it's just that most
folks are aware of it and find it adequate for their needs.

But the more common solution is to just declare (or explain) your use of
prefixes and use standard Qualified Names. The combined form is
generally not particularly necessary or useful except, perhaps, as a
debugging tool; if you're looking for an internal representation(s) of
this value pair, something which lets you more efficiently
access/compare/store the information is generally preferable -- struct
references, table indices, that sort of thing.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 25 '07 #2

Hey Joe

On Feb 24, 9:24 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
nalle...@gmail.com wrote:
Is there a standardized recommendation for combining names and
namespaces into a single URI?
I found a post on the Stylus Studio forum asking the same question,
the response was "use James Clark's {http://www.namespace.com}name
notation". The post is 7 years old and I'm wondering if anything has
changed...

That combined form isn't a URI.
Right

>
It's still one common solution to displaying the NSURI/localname pair,
but there is absolutely no "standard" behind it; it's just that most
folks are aware of it and find it adequate for their needs.

But the more common solution is to just declare (or explain) your use of
prefixes and use standard Qualified Names. The combined form is
generally not particularly necessary or useful except, perhaps, as a
debugging tool; if you're looking for an internal representation(s) of
this value pair, something which lets you more efficiently
access/compare/store the information is generally preferable -- struct
references, table indices, that sort of thing.
I want to take some data in and out of an rdf-oriented triple store in
standard XML syntax, not RDF/XML... I'd like to do it in as "least
bad" a manner as possible... ;-)

Looking at other people's RDF/XML (like this from Wikipedia)

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="http://en.wikipedia.org/wiki/
Tony_Benn">
<dc:title>Tony Benn</dc:title>
<dc:publisher>Wikipedia</dc:publisher>
</rdf:Description>
</rdf:RDF>

when it is transformed to N-Triples RDF

<http://en.wikipedia.org/wiki/Tony_Benn<http://purl.org/dc/elements/
1.1/title"Tony Benn" .
<http://en.wikipedia.org/wiki/Tony_Benn<http://purl.org/dc/elements/
1.1/publisher"Wikipedia" .

"{http://purl.org/dc/elements/1.1/}title" changes to "http://purl.ord/
dc/elements/1.1/title". But even the other ns url "http://www.w3.org/
1999/02/22-rdf-syntax-ns#" ends in a hash and not a /...

thanks for your time

Nick
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry

Feb 25 '07 #3
na******@gmail.com wrote:
I want to take some data in and out of an rdf-oriented triple store in
standard XML syntax, not RDF/XML... I'd like to do it in as "least
bad" a manner as possible... ;-)
In that case, it's sorta "whatever works", right? You aren't (very)
concerned about human-readability, you just want something that lets you
efficiently recover both values from the single string.

The {nsuri}local solution counts on the fact that the {} characters
aren't permitted in localnames and are uncommon in URIs. To unbundle,
you skip the leading {, and search backward for the last } as a division
point between the two fields. Not hugely pretty, but it works and is
reasonably fast. But the leading { isn't really necessary if you know a
priori that the value will be in this form.

The other example you've shown us just concatenates the NSURI and
localname. As you noted, that has a nontrivial problem: most namespace
URIs don't end with a / so the combined form is likely to be hard to
divide up again. The best I can call this is "sloppy". I would recommend
always inserting a delimiter character so you are *certain* you know how
to break it apart again. If you want something that looks URI-like you
could use / as your delimiter (or :, for that matter), but that's really
a matter of taste since nobody outside your own applications should ever
be trying to parse these.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 25 '07 #4
Joe Kesselman wrote:
always inserting a delimiter character so you are *certain* you know how
to break it apart again. If you want something that looks URI-like you
could use / as your delimiter (or :, for that matter)
Or #. The important thing is that it's something that absolutely can't
appear in the localname and that it be inserted every time, so you can
always be sure the last instance of it is the delimiter between
namespace name and localname.

Which brings me back to "What's easiest for your own code to handle?"
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Spacen Jasset | last post by:
I am thinking of using XML PI tags to convey some preprocessing instructions to a pre-processor before passing the xml to an xmlparser in an external library. Something likethis <?pi?> ...
8
by: mikea_59 | last post by:
I am having trouble combining similar elements. Elements can be combined if they have the same name and the same attribute values. I can handle single level elements but am having problems with...
2
by: Chris Mullins | last post by:
I've spent a bit of time over the last year trying to implement RFC 3454 (Preparation of Internationalized Strings, aka 'StringPrep'). This RFC is also a dependency for RFC 3491...
1
by: Donnal Walter | last post by:
I would like to be able to write something like: import dcw as dw import xyz as dw such that the 'dw' namespace includes definitions from both dcw and xyz, but in the script above names from...
3
by: exhuma.twn | last post by:
Simple problem: When I define a funtion the way you would with the publisher handler (without using psp), all works as expected. However when I define a publisher-like function and instantiate a...
5
by: Sakcee | last post by:
python provides a great way of dynamically creating fuctions calls and class names from string a function/class name can be stored as string and called/initilzed e.g def foo(a,b): return...
3
by: sundew | last post by:
so here is the test case: <head> <script type='text/javascript'> // this function simply returns the number of enumerable namespaces(objects) function numNSpaces(){ var num = 0; for(var i in...
6
by: Lonnie Princehouse | last post by:
List comprehensions appear to store their temporary result in a variable named "_" (or presumably "_", "_" etc for nested comprehensions) In other words, there are variables being put into the...
4
by: Steven Simpson | last post by:
Stefan Ram wrote (in "More than one language in a page"): Is this a new trend of user-agent writers (Microformats, and now Google) staking claims on the @class namespace? I'm surely not the only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.