469,951 Members | 2,597 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

test schema namespace

Hi, I'm wondering if it's possible for a document to
contain a namespace which is a self-reference.

e.g. in the following:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:contribution="http://www.example.org/#"
xml:base="http://www.example.org/#">

<rdf:Description rdf:ID="marcreltermmaybe">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Property"/>
</rdf:Description>

<rdf:Description rdf:ID="anexample">
<contribution:marcreltermmaybe>Or not
maybe</contribution:marcreltermmaybe>
</rdf:Description>

</rdf:RDF>

Description ends up as part of the contribution namespace,
because the base is the same. Is there any way to dispense
with the fictional www.example.org and make the namespace
point to the document itself? (I know this defeats the
point of a persistent namespace, but this is for purposes
of validating a test schema).

--
imalone
Oct 27 '05 #1
5 1450
Ian Malone wrote:
Hi, I'm wondering if it's possible for a document to
contain a namespace which is a self-reference.
I do not understand?
namespace wich is a self reference??


e.g. in the following:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:contribution="http://www.example.org/#"
xml:base="http://www.example.org/#">

<rdf:Description rdf:ID="marcreltermmaybe">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Property"/>
</rdf:Description>

<rdf:Description rdf:ID="anexample">
<contribution:marcreltermmaybe>Or not
maybe</contribution:marcreltermmaybe>
</rdf:Description>

</rdf:RDF>

Description ends up as part of the contribution namespace,
because the base is the same. Is there any way to dispense
with the fictional www.example.org and make the namespace
point to the document itself? (I know this defeats the
point of a persistent namespace, but this is for purposes
of validating a test schema).


A namespace is nothing more that a name, it does not point to a document.

I do not really understand what youre asking, can further explain your
problem?
Oct 27 '05 #2
Tjerk Wolterink wrote:
Ian Malone wrote:
Hi, I'm wondering if it's possible for a document to
contain a namespace which is a self-reference.

I do not understand?
namespace wich is a self reference??


e.g. in the following:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:contribution="http://www.example.org/#"
xml:base="http://www.example.org/#">

<rdf:Description rdf:ID="marcreltermmaybe">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Property"/>
</rdf:Description>

<rdf:Description rdf:ID="anexample">
<contribution:marcreltermmaybe>Or not
maybe</contribution:marcreltermmaybe>
</rdf:Description>

</rdf:RDF>


Description ends up as part of the contribution namespace,
because the base is the same. Is there any way to dispense
with the fictional www.example.org and make the namespace
point to the document itself? (I know this defeats the
point of a persistent namespace, but this is for purposes
of validating a test schema).


A namespace is nothing more that a name, it does not point to a document.

I do not really understand what youre asking, can further explain your
problem?


I would like to be able to dispense with:

xmlns:contribution="http://www.example.org/#"
xml:base="http://www.example.org/#"

in the root element and somehow still have a validating rdf in
xml document containing:
<contribution:marcreltermmaybe>Or not
maybe</contribution:marcreltermmaybe>

My understanding is that contribution:marcreltermmaybe
stands in for
http://www.example.org/#marcreltermmaybe

Thanks for your time.

--
imalone
Oct 27 '05 #3
In article <43************@cam.ac.uk>, Ian Malone <ib***@cam.ac.uk> wrote:
I would like to be able to dispense with:

xmlns:contribution="http://www.example.org/#"
xml:base="http://www.example.org/#"


I don't think you can do this, but you really need to ask in an RDF forum.

Removing the xml:base would make references to ID marcreltermmaybe
mean whatever-the-documents-URI-is:marcreltermmaybe, but using
marcreltermmaybe instead of contribution:marcreltermmaybe as the element
name not do the corresponding thing (I don't see anything in
http://www.w3.org/TR/rdf-syntax-grammar describing the meaning of
an element in no namespace).

No meaning is assigned to relative namespace URIs, otherwise it might
work to use ".".

-- Richard
Oct 27 '05 #4
Richard Tobin wrote:
In article <43************@cam.ac.uk>, Ian Malone <ib***@cam.ac.uk> wrote:
I would like to be able to dispense with:

xmlns:contribution="http://www.example.org/#"
xml:base="http://www.example.org/#"

I don't think you can do this, but you really need to ask in an RDF forum.


Probably, but usenet was my first stop and I couldn't find any
RDF specific groups. I suspect that if XML doesn't allow it
then RDF won't make any provision, because it goes against the
whole idea.
Removing the xml:base would make references to ID marcreltermmaybe
mean whatever-the-documents-URI-is:marcreltermmaybe, but using
marcreltermmaybe instead of contribution:marcreltermmaybe as the element
name not do the corresponding thing (I don't see anything in
http://www.w3.org/TR/rdf-syntax-grammar describing the meaning of
an element in no namespace).

No meaning is assigned to relative namespace URIs, otherwise it might
work to use ".".


That's the impression I got, my knowledge of URIs is poor though,
so I was hoping I'd missed something. Thanks for your help.

--
imalone
Oct 27 '05 #5
In article <43**************@cam.ac.uk>, Ian Malone <ib***@cam.ac.uk> wrote:
I suspect that if XML doesn't allow it
then RDF won't make any provision, because it goes against the
whole idea.


A minor point: the correspondence of contribution:marcreltermmaybe to
the URI http://www.example.org/#marcreltermmaybe given the presence of
the namespace declaration xmlns:contribution="http://www.example.org/#"
is something invented by RDF, not XML.

-- Richard
Oct 27 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by wooks | last post: by
4 posts views Thread by Gordon Dickens | last post: by
2 posts views Thread by Zombie | last post: by
2 posts views Thread by Ali | last post: by
1 post views Thread by billa1972 | last post: by
reply views Thread by Derek | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.