test schema namespace

I

Ian Malone

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).
 
T

Tjerk Wolterink

Ian said:
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

Ian Malone

Tjerk said:
Ian said:
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.
 
R

Richard Tobin

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
 
I

Ian Malone

Richard said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top