When and why is ns0pred used?

Hello,

Since I am starting with RDF creation I came here ns0pred. I assume ns means no subject and pred means predicate. Not sure on a null value other than a false boolean.

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

      

There is a small example.

I would be right if I said use the ns0pred prefix when there is no prefix available, such as the base ones (ex: name)?

Are there any downsides to ns0pred that I should be aware of before going any further with my RDF data?

Regards, Joris

0


source to share


2 answers


I don't know anything about RDF, but it looks like ns0pred actually means "namespace 0", in xml you can define any namespace you want, in your example above you could write

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

      



the xmlns: attribute in the tag defines the "xml namespace" and gives a schema definition that matches any tag starting with ns0pred.

You will often find namespace names in the generated xml files that seem random, but this is only to avoid collisions where multiple namespaces and schemas are used.

+2


source


Your guess is wrong, ns0pred is just the autogenerated namespace prefix from whatever RDF library you are using. In the example you provided, it is an RDFS schema prefix, so the property in question is indeed rdfs: label, only with a different prefix used (ns0pred) instead of the usual "rdfs".

In general, the prefixes have no semantic meaning, they are just there to make the RDF / XML content a little more readable, which didn't work in this case as it gave you the wrong impression.

Also, your example has a theme: http: // localhost: 8890 / dataspace / test3 / wiki / testWiki / MyTest .



What is snipped from RDF generates a graph with one triplet:

<http: // localhost: 8890 / dataspace / test3 / wiki / testWiki / MyTest> <http://www.w3.org/2000/01/rdf-schema#label> "MyTest".
+1


source







All Articles