Skip to content

RDF DOM Proposal

Alcaraz edited this page Jun 11, 2013 · 59 revisions

The RDF DOM Proposal

Here is the first proposal for the RDF file format returned by the MP2013 database.

Download

You can download the current version of the RDF document :

RDF - MP2013 events / Download

Note : This document is updated all mornings.

Specifications

Dublin Core and Licences

The Dublin Core Metadata Element Set is a vocabulary of properties for use in resource description. The name "Dublin" is due to its origin at a 1995 invitational workshop in Dublin, Ohio; "core" because its elements are broad and generic, usable for describing a wide range of resources.

1 - Defines the namespaces dc in the top-level rdf:RDF tag.

<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/" 

2 - Defines the dublin core metadatas of the document in a rdf:Description node with the URI http://data.mp2013.fr.

<rdf:Description rdf:about="http://data.mp2013.fr" >
    <dc:title>Events API publique de MP2013</dc:title>
    <dc:description>The MP2013 events</dc:description>   
    <dc:format>application/rdf+xml</dc:format>
    <dc:publisher>Marseille Provence 2013</dc:publisher>
    <dc:identifier>http://www.mp2013.fr/</dc:identifier>
    <dc:created>2012-11-30T10:31:00+0100</dc:created>
    <dc:modified>2012-12-02T10:31:00+0100</dc:modified>
    <dc:license>http://www.data.gouv.fr/Licence-Ouverte-Open-Licence</dc:license>
</rdf:Description>

We target for the moment the dc:title, dc:description, dc:format, dc:publisher, dc:identifier, dc:created, dc:modified and the dc:license properties.

Use Schema.org ontology

Schema.org provides a collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results, making it easier for people to find the right web pages.

To create a simple and generic RDF Schema, Schema.org provides a complete and specific ontologies who covers the needs of the MP2013 API library.

Depending on the requirements we will complete patterns with other types of ontologies but trying to keep up standards and simplicity.

In this first version of the RDF file we try to use the namespaces :

and

The "event" namespace is a custom namespace defines with the MP2013 http://data.mp2013.fr/Event class who extends the http://schema.org/Event class.

Themes of events

Marseille Provence 2013 offers 8 themes to classify and filter its events.

In the types of the objects defined in the standard patterns offered on http://schema.org/Event we decline the Event class with this children that correspond to these themes :

In the RDF file all events are linked with this 8 classes who extends the Event class.

We can declare these classes directly in the top-level of the document :

<rdfs:Class rdf:about="http://data.mp2013.fr/Event">
   <rdfs:comment>An event happening at a certain time at a certain location.</rdfs:comment>
   <rdfs:subClassOf rdf:resource="http://schema.org/Event"/>
</rdfs:Class>

<rdfs:Class rdf:about="http://data.mp2013.fr/ComedyEvent">
   <rdfs:label xml:lang="fr">Arts de la rue et du cirque</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://data.mp2013.fr/MusicEvent">
   <rdfs:label xml:lang="fr">Concerts / Musique</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://data.mp2013.fr/DanceEvent">
   <rdfs:label xml:lang="fr">Danse et Opéra</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://data.mp2013.fr/VisualArtsEvent">
   <rdfs:label xml:lang="fr">Expositions / Musées</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://data.mp2013.fr/Festival">
   <rdfs:label xml:lang="fr">Festivals et Grands rassemblements</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://data.mp2013.fr/SocialEvent">
   <rdfs:label xml:lang="fr">Ouverture / Inauguration</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://schema.org/Event"/>
</rdfs:Class>
<rdfs:Class rdf:ID="http://data.mp2013.fr/BusinessEvent">
   <rdfs:label xml:lang="fr">Rencontres / Colloques</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://data.mp2013.fr/TheaterEvent">
   <rdfs:label xml:lang="fr">Théatre et Cinéma</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>

We use now this class with the rdf:type tags in the event description in the final RDF document :

<rdf:Description rdf:about="http://data.mp2013.fr/event/#13EVT033951">

    <!-- The type of the item. -->
    <rdf:type rdf:resource="http://data.mp2013.fr/VisualArtsEvent"/>
	
    <!-- The name of the item. -->
    <event:name>Reliques de Saint Césaire</event:name>
    ...

Episodes of Marseille Provence 2013

Each event is linked to one of the three episodes of Marseille Provence 2013 :

  • Episode 1 : Marseille-Provence accueille le monde,
  • Episode 2 : Marseille-Provence à ciel ouvert,
  • Episode 3 : Marseille-Provence aux mille visages.

In the PATIO database the 3 episodes are identified with the specific references :

  • Episode 1 : a509c46d-0c64-4cb4-89f2-8aa06ae5a53f
  • Episode 2 : b2eb0aec-e755-4d1d-946f-c49d44fc35e6
  • Episode 3 : 905b4dc6-3059-4daa-b64d-08c80cae12dd

This identifiers are not valid to describe the episodes in a RDF document. We create tree custom namespaces to defines this episode in the RDF document :

We create the custom Episode class on the top-level of the document. Episode extends the Event class.

<rdfs:Class rdf:about="http://data.mp2013.fr/Episode">
    <rdfs:comment>A MP2013 specific period who contains events.</rdfs:comment>
    <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
</rdfs:Class>

We can now defines the three top-level definitions for each of these special events:

<!-- The MP2013 episodes --> 
            
<rdf:Description rdf:about="http://data.mp2013.fr/episode/#1" >
    <rdf:type rdf:resource="http://data.mp2013.fr/Episode"/>
    <event:name xml:lang="fr">Episode 1 : Marseille Provence accueille le monde</event:name>
    <event:name xml:lang="en">Marseille Provence welcoming the world</event:name>
</rdf:Description>
	
<rdf:Description rdf:about="http://data.mp2013.fr/episode/#2" >
    <rdf:type rdf:resource="http://data.mp2013.fr/Episode"/>
    <event:name xml:lang="fr">Episode 2 : Marseille Provence à ciel ouvert</event:name>
    <event:name xml:lang="en">Marseille Provence open sky</event:name>
</rdf:Description>
	
<rdf:Description rdf:about="http://data.mp2013.fr/episode/#3" >
    <rdf:type rdf:resource="http://data.mp2013.fr/Episode"/>
    <event:name xml:lang="fr">Episode 3 : Marseille Provence aux milles visages</event:name>
    <event:name xml:lang="en">Marseille Provence land of diversity</event:name>
</rdf:Description>

In each events defined in the rest of the document we can create a reference to one of these three special events with the superEvent property defined in the Event class:

<event:superEvent rdf:ressource="http://data.mp2013.fr/episode/#2" />

In the previous example the namespace http://data.mp2013.fr/episode/#2 create the reference with the specific episode item.

Producers

In the top level of the RDF document we can defines with a specific list of all the producers of the MP2013 events.

<rdf:Description rdf:about="http://data.mp2013.fr/producer/#4e6e9bc1-bba6-4916-8594-a31462109141">
    <rdf:type rdf:resource="http://schema.org/Organization"/>
    <organization:name>Théâtre Gyptis</organization:name>
    <organization:telephone>04 91 11 00 91</organization:telephone>
    <organization:url>http://www.theatregyptis.com</organization:url>
</rdf:Description>

The namespace http://data.mp2013.fr/producer/ defines all producers in the RDF document and the #4e6e9bc1-bba6-4916-8594-a31462109141 identifier the specific reference of the producer to target in one or more events.

In all the event's description we can create a reference with a specific producer with the property event:producer :

<rdf:Description rdf:about="http://data.mp2013.fr/event/#13EVT029519">
    ...
    <event:producer rdf:resource="http://data.mp2013.fr/producer/#4e6e9bc1-bba6-4916-8594-a31462109141"/>
</rdf:Description>

Opening Hours

In the schema.org standard the Place class contains the openingHoursSpecification property with the type OpeningHoursSpecification.

Example to use this property :

<place:openingHoursSpecification>
    <openingHours:dayOfWeek>Mo</openingHours:dayOfWeek>
    <openingHours:opens>09:00:00</openingHours:opens>
    <openingHours:closes>12:00:00</openingHours:closes>
</place:openingHoursSpecification>

To use this property we must defines the namespaces place and openingHours in the top-level node of the document :

<rdf:RDF 
    ...
    xmlns:place="http://schema.org/Place" 
    ...
    xmlns:openingHours="http://schema.org/OpeningHoursSpecification"  
>

And now we can use this property in all the events of the document :

<event:location rdf:parseType="Literal">

    ... 

    <!-- opening hours -->
    <place:openingHoursSpecification>
        <openingHours:dayOfWeek>Mo</openingHours:dayOfWeek>
        <openingHours:opens>09:00:00</openingHours:opens>
        <openingHours:closes>12:00:00</openingHours:closes>
    </place:openingHoursSpecification>
    <place:openingHoursSpecification>
        <openingHours:dayOfWeek>Mo</openingHours:dayOfWeek>
        <openingHours:opens>14:00:00</openingHours:opens>
        <openingHours:closes>16:00:00</openingHours:closes>
    </place:openingHoursSpecification>
    <place:openingHoursSpecification>
        <openingHours:dayOfWeek>Sa</openingHours:dayOfWeek>
        <openingHours:opens>09:30:00</openingHours:opens>
        <openingHours:closes>12:30:00</openingHours:closes>
    </place:openingHoursSpecification>          
</event:location>

**Note : ** It is quite possible to go further with this property and use the namespace http://purl.org/goodrelations/v1#. This namespace gives a more complexe definitions of each event schedules. All nodes creates with this namespace are very verbose and difficult to read, we will see later if it is necessary or not to use it.

References and documentation

Basic example of the DOM (document object model)

<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:owl="http://www.w3.org/2002/07/owl#" 
    xmlns:dc="http://purl.org/dc/elements/1.1/" 
    xmlns:schema="http://schema.org/" 
    xmlns:event="http://data.mp2013.fr/Event" 
    xmlns:place="http://schema.org/Place" 
    xmlns:address="http://schema.org/PostalAddress" 
    xmlns:geo="http://schema.org/GeoCoordinates" 
    xmlns:organization="http://schema.org/Organization" 
    xmlns:offer="http://schema.org/Offer" 
    xmlns:openingHours="http://schema.org/OpeningHoursSpecification"  
>
    <rdf:Description rdf:about="http://data.mp2013.fr" >
        <dc:title>Events API publique de MP2013</dc:title>
        <dc:description>The MP2013 events</dc:description>   
        <dc:format>application/rdf+xml</dc:format>
        <dc:publisher>Marseille Provence 2013</dc:publisher>
        <dc:identifier>http://www.mp2013.fr/</dc:identifier>
        <dc:created>2012-11-30T10:31:00+0100</dc:created>
        <dc:modified>2012-12-02T10:31:00+0100</dc:modified>
        <dc:license>http://www.data.gouv.fr/Licence-Ouverte-Open-Licence</dc:license>
    </rdf:Description>
    
    <!-- OWL header -->
    <owl:Onthology rdf:about="http://schema.org/docs/schemaorg.owl">
       <dc:title>The schema.org Ontology</dc:title>
       <dc:description>The schema.org ontology to defines all events.</dc:description>
    </owl:Onthology>
	
    <!-- Standard Event Classes -->
    
    <rdfs:Class rdf:about="http://data.mp2013.fr/Event">
       <rdfs:comment>An event happening at a certain time at a certain location.</rdfs:comment>
       <rdfs:subClassOf rdf:resource="http://schema.org/Event"/>
    </rdfs:Class>
	    
    <rdfs:Class rdf:about="http://data.mp2013.fr/ComedyEvent">
       <rdfs:label xml:lang="fr">Arts de la rue et du cirque</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/MusicEvent">
       <rdfs:label xml:lang="fr">Concerts / Musique</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/DanceEvent">
       <rdfs:label xml:lang="fr">Danse et Opéra</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/VisualArtsEvent">
       <rdfs:label xml:lang="fr">Expositions / Musées</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/Festival">
       <rdfs:label xml:lang="fr">Festivals et Grands rassemblements</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/SocialEvent">
       <rdfs:label xml:lang="fr">Ouverture / Inauguration</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/BusinessEvent">
       <rdfs:label xml:lang="fr">Rencontres / Colloques</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>
    <rdfs:Class rdf:about="http://data.mp2013.fr/TheaterEvent">
       <rdfs:label xml:lang="fr">Théatre et Cinéma</rdfs:label>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>

    <!-- Custom classes --> 

    <rdfs:Class rdf:about="http://data.mp2013.fr/Episode">
       <rdfs:comment>A MP2013 specific period who contains events.</rdfs:comment>
       <rdfs:subClassOf rdf:resource="http://data.mp2013.fr/Event"/>
    </rdfs:Class>

    <!-- The episodes of MP2013 --> 
          
    <rdf:Description rdf:about="http://data.mp2013.fr/Episode/#1" >
        <rdf:type rdf:resource="http://data.mp2013.fr/Episode"/>
        <event:name xml:lang="fr">Episode 1 : Marseille Provence accueille le monde</event:name>
        <event:name xml:lang="en">Marseille Provence welcoming the world</event:name>
    </rdf:Description>

    <rdf:Description rdf:about="http://data.mp2013.fr/Episode/#2" >
        <rdf:type rdf:resource="http://data.mp2013.fr/Episode"/>
        <event:name xml:lang="fr">Episode 2 : Marseille Provence à ciel ouvert</event:name>
        <event:name xml:lang="en">Marseille Provence open sky</event:name>
    </rdf:Description>

    <rdf:Description rdf:about="http://data.mp2013.fr/Episode/#3" >
        <rdf:type rdf:resource="http://data.mp2013.fr/Episode"/>
        <event:name xml:lang="fr">Episode 3 : Marseille Provence aux milles visages</event:name>
        <event:name xml:lang="en">Marseille Provence land of diversity</event:name>
    </rdf:Description>

    <!-- The producers of all events -->

    <rdf:Description rdf:about="http://data.mp2013.fr/producer/#4e6e9bc1-bba6-4916-8594-a31462109141">
        <rdf:type rdf:resource="http://schema.org/Organization"/>
        <organization:name>Théâtre Gyptis</organization:name>
        <organization:telephone>04 91 11 00 91</organization:telephone>
        <organization:url>http://www.theatregyptis.com</organization:url>
    </rdf:Description>

    <!-- The main events of MP2013 -->
    <rdf:Description rdf:about="http://data.mp2013.fr/event/#13EVT033951">

        <!-- The type of the item. -->
        <rdf:type rdf:resource="http://data.mp2013.fr/VisualArtsEvent"/>
	
        <!-- The name of the item. -->
        <event:name xml:lang="fr">Reliques de Saint Césaire</event:name>
        
        <!-- The URL of the item. -->
        <event:url>url sur le site de mp2013</event:url>
        
        <!-- A short description of the item. -->
        <event:description xml:lang="fr">bonjour le monde</event:description>
        <event:description xml:lang="en">hello world</event:description>
        
        <!-- The end date and time of the event (in ISO 8601 date format). -->
        <event:endDate></event:endDate>

        <!-- The start date and time of the event (in ISO 8601 date format). -->
        <event:startDate></event:startDate>
        
        <!-- Url of an image of the item. -->
        <event:image>http://www.mp2013.fr/ext/basephotos/13EVT033951.jpg</event:image>
        
        <!-- The disability access of the item. -->
        <event:disability>True</event:disability> 

        <!-- Indicates if the event is canceled or not. -->        
        <event:canceled>False</event:canceled>

        <!-- An event that this event is a part of. MP2013 cut the events in episodes -->
        <event:superEvent rdf:ressource="http://data.mp2013.fr/episode/#2" />
        
        <!--  The producers of the event  -->
        <event:producer rdf:resource="http://data.mp2013.fr/producer/#8a6d4df4-c7f9-4732-a56c-731fb0d384bf"/>
        
        <!-- The location of the event or organization. -->
        <event:location rdf:parseType="Literal">

            <!-- Physical address of the item -->
            <place:address>
                <address:streetAddress>Rue XXX</address:streetAddress>
                <address:addressCountry>France</address:addressCountry>
                <address:addressRegion>Bouches-du-Rhône</address:addressRegion>
                <address:addressLocality>Arles</address:addressLocality>
                <address:postalCode>13200</address:postalCode>
                <address:postOfficeBoxNumber>cedex 500 ?</address:postOfficeBoxNumber>
                <address:telephone>…</address:telephone>
                <address:faxNumber>…</address:faxNumber>
                <address:email>…</address:email>
            </place:address>

            <place:telephone>???</place:telephone>

            <!-- The geo coordinates of the place -->
            <place:geo>
                <geo:latitude>…</geo:latitude>
                <geo:longitude>…</geo:longitude>
            </place:geo>
            
            <!-- opening hours -->
            <place:openingHoursSpecification>
                <openingHours:dayOfWeek>Mo</openingHours:dayOfWeek>
                <openingHours:opens>09:00:00</openingHours:opens>
                <openingHours:closes>12:00:00</openingHours:closes>
            </place:openingHoursSpecification>
            <place:openingHoursSpecification>
                <openingHours:dayOfWeek>Mo</openingHours:dayOfWeek>
                <openingHours:opens>14:00:00</openingHours:opens>
                <openingHours:closes>16:00:00</openingHours:closes>
            </place:openingHoursSpecification>
            <place:openingHoursSpecification>
                <openingHours:dayOfWeek>Sa</openingHours:dayOfWeek>
                <openingHours:opens>09:30:00</openingHours:opens>
                <openingHours:closes>12:30:00</openingHours:closes>
            </place:openingHoursSpecification>          
        </event:location>
	
	<!-- A person or organization attending the event. -->        
	<event:attendee>
            <organization:name></organization:name>
	    <organization:email></organization:email>
	    <organization:telephone></organization:telephone>
	    <organization:url></organization:url>
	    <organization:address>
	        <address:addressLocality>Arles</address:addressLocality>
	        <address:postalCode>13200</address:postalCode>
	        <address:streetAddress>13200</address:postalCode>
	    </organization:address>
	</event:attendee>
	
        <!-- offers for this item -->
        <event:offers rdf:parseType="Literal">
            <event:offer>
                <offer:itemOffered>
                    <itemOffered:name xml:lang="en">Entrance</itemOffered:name>
                    <itemOffered:name xml:lang="fr">Entree</itemOffered:name>
                </offer:itemOffered>
                <offer:description xml:lang="fr">Tarif plein.</offer:description>
                <offer:priceSpecification>
                    <priceSpecification:maxPrice>12</priceSpecification:maxPrice>
                    <priceSpecification:minPrice>6.45</priceSpecification:minPrice>
                    <priceSpecification:priceCurrency>EUR</priceSpecification:priceCurrency>
                </offer:priceSpecification>
            </event:offer>
            <event:offer>
                <offer:itemOffered>
                    <itemOffered:name xml:lang="en">Entrance</itemOffered:name>
                    <itemOffered:name xml:lang="fr">Entree</itemOffered:name>
                </offer:itemOffered>
                <offer:description xml:lang="fr">10 personnes minimum.</offer:description>
                <offer:eligibleCustomerType>Groupe</offer:eligibleCustomerType>
                <offer:priceSpecification>
                    <priceSpecification:minPrice>11</priceSpecification:minPrice>
                    <priceSpecification:priceCurrency>EUR</priceSpecification:priceCurrency>
                </offer:priceSpecification>
            </event:offer>
            <event:offer>
                <offer:itemOffered>
                    <itemOffered:name xml:lang="en">Entrance</itemOffered:name>
                    <itemOffered:name xml:lang="fr">Entree</itemOffered:name>
                </offer:itemOffered>
                <offer:description xml:lang="fr">12-25 ans.</offer:description>
                <offer:eligibleCustomerType>Etudiant</offer:eligibleCustomerType>
                <offer:priceSpecification>
                    <priceSpecification:minPrice>9</priceSpecification:minPrice>
                    <priceSpecification:priceCurrency>EUR</priceSpecification:priceCurrency>
                </offer:priceSpecification>
            </event:offer>
            <event:offer>
                <offer:itemOffered>
                   <itemOffered:name xml:lang="en">Passport</itemOffered:name>
                   <itemOffered:name xml:lang="fr">Passeport</itemOffered:name>
                </offer:itemOffered>
                <offer:description xml:lang="fr">Concert:15€, Pass 3 jours:35€ Fnac only</offer:description>
                <offer:priceSpecification>
                        <priceSpecification:maxPrice>35</priceSpecification:maxPrice>
                    <priceSpecification:minPrice>35</priceSpecification:minPrice>
                    <priceSpecification:priceCurrency>EUR</priceSpecification:priceCurrency>
                </offer:priceSpecification>
            </event:offer> 
        </event:offers>

    </rdf:Description>

</rdf:RDF>

Licence Creative Commons [Creative Commons 3.0 BY-SA](http://creativecommons.org/licenses/by-sa/3.0/)