Walkthrough of RDF Examples

in the RDF spec and how they serialize in SOAP

Example 1

Statement: "Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila"

Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila

RDF Serialization

      <rdf:Description about="http://www.w3.org/Home/Lassila">
        <s:Creator>Ora Lassila</s:Creator>
      </rdf:Description>
    

SOAP Serialization

      <rdf:Description>
        <rdf:about href="http://www.w3.org/Home/Lassila"/>
        <s:Creator>Ora Lassila</s:Creator>
      </rdf:Description>
    

Example 2

Statement: "The individual whose name is Ora Lassila, email , is the creator of http://www.w3.org/Home/Lassila."

The individual whose name is Ora Lassila, email <lassila@w3.org>, is the creator of http://www.w3.org/Home/Lassila.

RDF Serialization

The description in RDF is defined as:
      [6.3] description ::= '<rdf:Description' idAboutAttr? bagIdAttr? propAttr* '/>' | '<rdf:Description' idAboutAttr? bagIdAttr? propAttr* '>' propertyElt* '</rdf:Description>'
      [6.7] aboutAttr ::= ' about="' URI-reference '"'
    
which actually allows for the about attribute not to be present. As it is also possible to have nested Description elements, the serialization could look like this
      <rdf:Description about="http://www.w3.org/Home/Lassila">
        <s:Creator>
        <rdf:Description>
          <v:Name>Ora Lassila</v:Name>
          <v:Email>lassila@w3.org</v:Email>
        </rdf:Description>
        </s:Creator>
      </rdf:Description>
    

SOAP Serialization

      <rdf:Description>
        <rdf:about href="http://www.w3.org/Home/Lassila"/>
        <s:Creator>
          <v:Name>Ora Lassila</v:Name>
          <v:Email>lassila@w3.org</v:Email>
        </s:Creator>
      </rdf:Description>
    

Example 3

Statement: "The individual referred to by employee id 85740 is named Ora Lassila and has the email address lassila@w3.org. The resource http://www.w3.org/Home/Lassila was created by this individual."

The individual referred to by employee id 85740 is named Ora Lassila and has the email address lassila@w3.org. The resource http://www.w3.org/Home/Lassila was created by this individual.

RDF Serialization

      <rdf:Description about="http://www.w3.org/Home/Lassila">
        <s:Creator rdf:resource="http://www.w3.org/staffId/85740"/>
      </rdf:Description>

      <rdf:Description about="http://www.w3.org/staffId/85740">
        <v:Name>Ora Lassila</v:Name>
        <v:Email>lassila@w3.org</v:Email>
      </rdf:Description>
    

SOAP Serialization

      <rdf:Description>
        <rdf:about href="http://www.w3.org/Home/Lassila"/>
        <s:Creator>
          <rdf:about href="http://www.w3.org/staffId/85740"/>
          <v:Name>Ora Lassila</v:Name>
          <v:Email>lassila@w3.org</v:Email>
        </s:Creator>
      </rdf:Description>
    
or if we wanted to use multi refs which of course would change the graph slightly:
      <rdf:Description>
        <rdf:about href="http://www.w3.org/Home/Lassila"/>
        <s:Creator href="#ora"/>
      </rdf:Description>

      <rdf:Description id="ora">
        <rdf:about href="http://www.w3.org/staffId/85740"/>
        <v:Name>Ora Lassila</v:Name>
        <v:Email>lassila@w3.org</v:Email>
      </rdf:Description>
    

Example 4

Statement: "The students in course 6.001 are Amy, Tim, John, Mary, and Sue."

The students in course 6.001 are Amy, Tim, John, Mary, and Sue.

RDF Serialization

      <rdf:Description about="http://mycollege.edu/courses/6.001">
        <s:students>
          <rdf:Bag>
            <rdf:li resource="http://mycollege.edu/students/Amy"/>
            <rdf:li resource="http://mycollege.edu/students/Tim"/>
            <rdf:li resource="http://mycollege.edu/students/John"/>
            <rdf:li resource="http://mycollege.edu/students/Mary"/>
            <rdf:li resource="http://mycollege.edu/students/Sue"/>
          </rdf:Bag>
        </s:students>
      </rdf:Description>
    

SOAP Serialization

In this particular case we can use a SOAP array to serialize an RDF bag:
      <rdf:Description>
        <rdf:about href="http://mycollege.edu/courses/6.001"/>
        <s:students SOAP-ENC:arrayType="uriReference[5]">
          <item href="http://mycollege.edu/students/Amy"/>
          <item href="http://mycollege.edu/students/Tim"/>
          <item href="http://mycollege.edu/students/John"/>
          <item href="http://mycollege.edu/students/Mary"/>
          <item href="http://mycollege.edu/students/Sue"/>
        </s:students>
      </rdf:Description>
    
but we could also have decided to use a "multistruct" which is a struct where identical accessors are allowed and made it of type "rdf:Bag":
      <rdf:Description>
        <rdf:about href="http://mycollege.edu/courses/6.001"/>
        <s:students xsi-type=rdf:bag>
          <item href="http://mycollege.edu/students/Amy"/>
          <item href="http://mycollege.edu/students/Tim"/>
          <item href="http://mycollege.edu/students/John"/>
          <item href="http://mycollege.edu/students/Mary"/>
          <item href="http://mycollege.edu/students/Sue"/>
        </s:students>
      </rdf:Description> 
    

Example 5

Statement: "The source code for X11 may be found at ftp.x.org, ftp.cs.purdue.edu, or ftp.eu.net."

The source code for X11 may be found at ftp.x.org, ftp.cs.purdue.edu, or ftp.eu.net.

RDF Serialization

      <rdf:Description about="http://x.org/packages/X11">
        <s:DistributionSite>
          <rdf:Alt>
            <rdf:li resource="ftp://ftp.x.org"/>
            <rdf:li resource="ftp://ftp.cs.purdue.edu"/>
            <rdf:li resource="ftp://ftp.eu.net"/>
          </rdf:Alt>
        </s:DistributionSite>
      </rdf:Description>
    

SOAP Serialization

      <rdf:Description>
        <rdf:about href="http://x.org/packages/X11"/>
        <s:DistributionSite xsi:type=rdf:Alt>
          <item href="ftp://ftp.x.org"/>
          <item href="ftp://ftp.cs.purdue.edu"/>
          <item href="ftp://ftp.eu.net"/>
        </s:DistributionSite>
      </rdf:Description>
    
or if we don't consider the alternation a property of the list but rather a property of the accessor:
      <rdf:Description>
        <rdf:about href="http://x.org/packages/X11"/>
        <possibleSites href="#D"/>   <!-- List of all possible sites. -->
        <site>                       <!-- Choose one of the sites. -->
          <list href="#D"/>
          <rdf:Alt>true</rdf:Alt>
        </site>
      </rdf:Description> 

      <s:DistributionSite id="D">
        <item href="ftp://ftp.x.org"/>
        <item href="ftp://ftp.cs.purdue.edu"/>
        <item href="ftp://ftp.eu.net"/>
      </s:DistributionSite>
    

Example 6

Statement: "Sue has written "Anthology of Time", "Zoological Reasoning", "Gravitational Reflections""

Sue has written "Anthology of Time", "Zoological Reasoning", "Gravitational Reflections"

RDF Serialization

      @@@
    

SOAP Serialization

      <rdf:Description id="person-1">
        <rdf:about href="/People/Sue"/>
        <s:Publication href="/Books/Anthology%20of%20Time"/>
        <s:Publication href="/Books/Zoological%20Reasoning"/>
        <s:Publication href="/Books/Gravitational%20Reflections"/>
      <rdf:Description>
    
or if we want to make it many:many:
      <rdf:Description id="person-1">
        <rdf:about href="/People/Sue"/>
      </rdf:Description>

      <rdf:Description>
        <s:Publication href="/Books/Anthology%20of%20Time"/>
        <s:WrittenBy href="#person-1"/>
      </rdf:Description>

      <rdf:Description>
        <s:Publication href="/Books/Zoological%20Reasoning"/>
        <s:WrittenBy href="#person-1"/>
      </rdf:Description>

      <rdf:Description>
        <s:Publication href="/Books/Gravitational%20Reflections"/>
        <s:WrittenBy href="#person-1"/>
      </rdf:Description>
    


Henrik Frystyk Nielsen,
May 19 2000