Why does the W3C RDF validator replace the RDF URI with its own?

Let's say that we enter the following RDF code into the W3C RDF validator at http://www.w3.org/RDF/Validator/ .

<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:uni="http://www.example.org/uni-ns#"> <rdf:Description rdf:about="949352"> <uni:name>Grigoris Antoniou</uni:name> <uni:title>Professor</uni:title> </rdf:Description> </rdf:RDF> 

As soon as I ask to parse the RDF code, I found that in triples, the RDF URI was replaced with its own validator URI.

enter image description here

Should the object of triples be http://www.w3.org/1999/02/22-rdf-syntax-ns#949352 ?

Why does the validator do this?

+5
source share
1 answer

The rdf:about attribute takes an IRI value as a value.

You have 949352 as a value, which is a relative IRI. It gets permission for the IRI of the underlying document (which is the validator in your case).

You can, for example, provide an absolute IRI (example 1) or specify xml:base (example 2).

Example 1:

 <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:uni="http://www.example.org/uni-ns#"> <rdf:Description rdf:about="http://my-site.example.com/my-page/949352"> <uni:name>Grigoris Antoniou</uni:name> <uni:title>Professor</uni:title> </rdf:Description> </rdf:RDF> 

Example 2:

 <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:uni="http://www.example.org/uni-ns#" xml:base="http://my-site.example.com/my-page/"> <rdf:Description rdf:about="949352"> <uni:name>Grigoris Antoniou</uni:name> <uni:title>Professor</uni:title> </rdf:Description> </rdf:RDF> 
+6
source

Source: https://habr.com/ru/post/1206686/


All Articles