tags:

views:

36

answers:

2

Greetings,

As I am beginning with RDF building, I came along ns0pred here and there. I am assuming ns means no subject and pred means predicate. Not sure on the zero other then a false boolean value.

<rdf:Description rdf:about="http://localhost:8890/dataspace/test3/wiki/testWiki/MyTest"&gt;
<ns0pred:label xmlns:ns0pred="http://www.w3.org/2000/01/rdf-schema#"&gt;MyTest&lt;/ns0pred:label&gt;
</rdf:Description>

There is a little example.

Would I be correct if I said, use ns0pred prefix when there is no available prefix like the basic ones (ex:name for example)?

Are there any downsides to ns0pred I should know about before going any further with my RDF data?

Kind regards, Joris

+2  A: 

I know nothing about RDF's but it looks like ns0pred actually means 'name space 0', in xml you can define any namespace you want, in your example above you could have written

<rdf:Description rdf:about="http://localhost:8890/dataspace/test3/wiki/testWiki/MyTest"&gt;
    <myPrefix:label xmlns:myPrefix="http://www.w3.org/2000/01/rdf-schema#"&gt;MyTest&lt;/myPrefix:label&gt;
</rdf:Description>

the xmlns: attribute in the tag defines "xml namespace" and gives the schema definition which corresponds to any tag beginning with ns0pred.

You'll often find in generated xml files that namespaces are given seemingly random names but this is just to prevent collisions where there are multiple namespaces and schemas in use.

Ash
A: 

Your assumption is incorrect, ns0pred is just an autogenerated namespace prefix from whatever RDF library you are using. In the example you've given, it's prefixing the RDFS schema, so the property in question is really rdfs:label, just with a different prefix used (ns0pred) instead of the common "rdfs."

In general, the prefixes don't have any semantic meaning, they're just there to make the RDF/XML content a little more readable, which in this case failed since it gave you the wrong impression.

Also, in your example, there is a subject: http://localhost:8890/dataspace/test3/wiki/testWiki/MyTest.

That snipped of RDF generates a graph with a single triple:

<http://localhost:8890/dataspace/test3/wiki/testWiki/MyTest&gt; <http://www.w3.org/2000/01/rdf-schema#label&gt; "MyTest".
Michael Grove