0

I want to explain that educationalRole, which is my own tag, is related to the existing class EducationalAudience in LRMI Metadata Terms in RDF.

I have write the following RDF/XML notation:

    <?xml version="1.0" encoding="UTF-8"?>
        <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:dc="http://purl.org/dc/elements/1.1/"
            xmlns:exs="http://example.org/schema#"
            xmlns:exr="http://example.org#">  

            <rdf:Description rdf:about="http://www.youtube.com/v/CH6FQhlZn6k">  
                <dc:title>Napoleon forced to abdicate</dc:title>
                <exs:educationalRole>student</exs:educationalRole>
                <exs:educationalRole>
                    <rdfs:subClassOf rdf:resource="http://schema.org/EducationalAudience"/>
                </exs:educationalRole>
            </rdf:Description>
        </rdf:RDF>

The W3C validator returns:

Error: {E201} rdf:resource not allowed as attribute here.

I am fairly new to learn this. Can anyone help me?

unor
  • 92,415
  • 26
  • 211
  • 360
Susmita Sadhu
  • 67
  • 1
  • 2
  • 16
  • You are approaching this the wrong way. RDF is a data model, not a syntax. The model you are writing down here is fundamentally wrong (you're mixing up classes and properties). As a tip: don't try to write RDF/XML by hand. Instead, learn how the RDF data model works (the [RDF Primer](https://www.w3.org/TR/rdf11-primer/) is a good starting point), figure what your RDF model should look like (it helps to draw it as a graph), and _only then_ try to write it down. – Jeen Broekstra Aug 13 '16 at 22:58
  • Best syntax to use is probably [Turtle](https://www.w3.org/TR/turtle/) - if you need RDF/XML for some reason you should still start by writing down in Turtle, then you can use a conversion tool to turn it into RDF/XML. – Jeen Broekstra Aug 13 '16 at 22:58
  • Thanks a lot. @Jeen – Susmita Sadhu Aug 16 '16 at 04:38

1 Answers1

0

Did you try this ?

<?xml version="1.0" encoding="UTF-8"?>
    <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:dc="http://purl.org/dc/elements/1.1/"
        xmlns:exs="http://example.org/schema#"
        xmlns:exr="http://example.org#">  

        <rdf:Description rdf:about="http://www.youtube.com/v/CH6FQhlZn6k">  
            <dc:title>Napoleon forced to abdicate</dc:title>
            <exs:educationalRole>student</exs:educationalRole>
        </rdf:Description>
        <rdf:Description rdf:about="exs:educationalRole">
                <rdfs:subClassOf rdf:resource="http://schema.org/EducationalAudience"/>
        </rdf:Description>
    </rdf:RDF>
innovimax
  • 440
  • 5
  • 8
  • 2
    While this may validate, it still isn't correctly modeled. `rdfs:subClassOf` is used to define relations between _classes_, yet in this example `exs:educationalRole` is used as a property, instead. – Jeen Broekstra Aug 13 '16 at 03:04