Difference between revisions of "Vocabularies/TIO"

From GoodRelations Wiki
Jump to: navigation, search
(Turtle)
(Prefix Declarations)
 
(One intermediate revision by the same user not shown)
Line 29: Line 29:
  
 
==== Prefix Declarations ====
 
==== Prefix Declarations ====
<code n3>
+
<syntaxhighlight lang="turtle">
 
# Prefix declarations
 
# Prefix declarations
@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:       <http://www.w3.org/2000/01/rdf-schema#> .
+
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:        <http://www.w3.org/2002/07/owl#> .
+
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
+
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
+
@prefix dc:       <http://purl.org/dc/elements/1.1/> .
@prefix dcterms:    <http://purl.org/dc/terms/> .
+
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix gr:         <http://purl.org/goodrelations/v1#> .
+
@prefix gr:       <http://purl.org/goodrelations/v1#> .
@prefix tio:        <http://purl.org/tio/ns#> .
+
@prefix tio:       <http://purl.org/tio/ns#> .
@prefix foo:        <http://www.heppnetz.de/ontologies/tio/examples.rdf#> .
+
@prefix foo:     <http://www.heppnetz.de/ontologies/tio/examples.rdf#> .
</code>
+
</syntaxhighlight>
  
 
==== Company Data ====
 
==== Company Data ====
<code n3>
+
<syntaxhighlight lang="turtle">
 
foo:HeppTickets a gr:BusinessEntity ;
 
foo:HeppTickets a gr:BusinessEntity ;
 
    gr:legalName "Hepp Tickets, a fictious division of Hepp Research Gmbh"@en .
 
    gr:legalName "Hepp Tickets, a fictious division of Hepp Research Gmbh"@en .
 
    # You should add address details and geo-position data using
 
    # You should add address details and geo-position data using
 
     # external vocabularies, e.g. schema.org or vcard
 
     # external vocabularies, e.g. schema.org or vcard
</code>
+
</syntaxhighlight>
  
 
=== Concert Ticket ===
 
=== Concert Ticket ===
 
'''Scenario:''' An offer for tickets for the Bryan Adams concert at the Verizon Wireless Ampitheatre, at $ 19.99 per ticket.
 
'''Scenario:''' An offer for tickets for the Bryan Adams concert at the Verizon Wireless Ampitheatre, at $ 19.99 per ticket.
 
==== Turtle ====
 
==== Turtle ====
<code n3>
+
<syntaxhighlight lang="turtle">
 
# We reuse this event: http://data.linkedevents.org/event/3018e1eb-b1dc-4b62-8cb2-f1457c7a31cf
 
# We reuse this event: http://data.linkedevents.org/event/3018e1eb-b1dc-4b62-8cb2-f1457c7a31cf
 
# Bryan Adams at the Verizon Wireless Amphitheatre
 
# Bryan Adams at the Verizon Wireless Amphitheatre
Line 73: Line 73:
 
           gr:hasCurrencyValue "19.99"^^xsd:float ;
 
           gr:hasCurrencyValue "19.99"^^xsd:float ;
 
           gr:validThrough "2010-11-11T23:59:59"^^xsd:dateTime ] .
 
           gr:validThrough "2010-11-11T23:59:59"^^xsd:dateTime ] .
</code>
+
</syntaxhighlight>
  
 
==== RDFa ====
 
==== RDFa ====
<code xml>
+
<syntaxhighlight lang="xml">
 
<div xmlns="http://www.w3.org/1999/xhtml"
 
<div xmlns="http://www.w3.org/1999/xhtml"
 
     xmlns:tio="http://purl.org/tio/ns#"
 
     xmlns:tio="http://purl.org/tio/ns#"
Line 108: Line 108:
 
     </div>
 
     </div>
 
</div>
 
</div>
</code>
+
</syntaxhighlight>
  
 
=== Museum Admission Fare ===
 
=== Museum Admission Fare ===
 
'''Scenario:''' An offer for day tickets for the Deutsches Museum in Munich for EUR 8
 
'''Scenario:''' An offer for day tickets for the Deutsches Museum in Munich for EUR 8
 
==== Turtle ====
 
==== Turtle ====
<code n3>
+
<syntaxhighlight lang="turtle">
 
# Point of interest: http://dbpedia.org/resource/Deutsches_Museum
 
# Point of interest: http://dbpedia.org/resource/Deutsches_Museum
  
Line 133: Line 133:
 
                 gr:validThrough "2010-12-31T23:59:59"^^xsd:dateTime
 
                 gr:validThrough "2010-12-31T23:59:59"^^xsd:dateTime
 
             ] .
 
             ] .
</code>
+
</syntaxhighlight>
  
 
==== RDFa ====
 
==== RDFa ====
<code xml>
+
<syntaxhighlight lang="xml">
 
<div xmlns="http://www.w3.org/1999/xhtml"
 
<div xmlns="http://www.w3.org/1999/xhtml"
 
     xmlns:tio="http://purl.org/tio/ns#"
 
     xmlns:tio="http://purl.org/tio/ns#"
Line 164: Line 164:
 
     </div>
 
     </div>
 
</div>
 
</div>
</code>
+
</syntaxhighlight>
  
 
=== Airfare  ===
 
=== Airfare  ===
Line 170: Line 170:
  
 
==== Turtle ====
 
==== Turtle ====
<code n3>
+
<syntaxhighlight lang="turtle">
 
# Airfare
 
# Airfare
 
# FRA: <http://dbpedia.org/resource/Frankfurt_Airport>
 
# FRA: <http://dbpedia.org/resource/Frankfurt_Airport>
Line 211: Line 211:
 
         gr:acceptedPaymentMethods gr:MasterCard, gr:VISA ;
 
         gr:acceptedPaymentMethods gr:MasterCard, gr:VISA ;
 
         gr:availableDeliveryMethods tio:Etix .
 
         gr:availableDeliveryMethods tio:Etix .
</code>
+
</syntaxhighlight>
  
 
====RDFa====
 
====RDFa====
 
'''Flight Data'''
 
'''Flight Data'''
<code xml>
+
<syntaxhighlight lang="xml">
 
<div xmlns:tio="http://purl.org/tio/ns#">
 
<div xmlns:tio="http://purl.org/tio/ns#">
 
   <div about="#LH1234"
 
   <div about="#LH1234"
Line 240: Line 240:
 
   </div>
 
   </div>
 
</div>
 
</div>
</code>
+
</syntaxhighlight>
 
'''Ticket Placeholder Data'''
 
'''Ticket Placeholder Data'''
<code xml>
+
<syntaxhighlight lang="xml">
 
<div>
 
<div>
 
   <div  about="#ticket5"
 
   <div  about="#ticket5"
Line 258: Line 258:
 
   </div>
 
   </div>
 
</div>
 
</div>
</code>
+
</syntaxhighlight>
 
'''Offer Data'''
 
'''Offer Data'''
<code xml>
+
<syntaxhighlight lang="xml">
 
<div>
 
<div>
 
   <div about="#HeppTickets">
 
   <div about="#HeppTickets">
Line 311: Line 311:
 
   </div>
 
   </div>
 
</div>
 
</div>
</code>
+
</syntaxhighlight>
 
__NOTOC__
 
__NOTOC__
  
 
[[Category:Vocabulary]]
 
[[Category:Vocabulary]]

Latest revision as of 11:43, 28 July 2016

The Tickets Extension for GoodRelations

GoodRelations Domain Extension
Name The Tickets Ontology (TIO)
Description This extension module for GoodRelations provides classes and properties for describing tickets for admission, events, and transportation services.
Status stable
Level advanced
Tags goodrelations, airfare, transportation, train tickets, events, concerts, museums
URL http://purl.org/tio/ns
Namespace http://purl.org/tio/ns#
Prefix tio:

Overview

The Tickets Ontology is a Web vocabulary for describing tickets for concerts, locations like museums, or any kind of transportation for e-commerce. The vocabulary is designed to be used in combination with GoodRelations, a standard vocabulary for the commercial aspects of tickets and other goods or services. GoodRelations is a language (also known as "schema", "data dictionary", or "ontology") for product, price, and company data that can (1) be embedded into existing static and dynamic Web pages and that (2) can be processed by other computers. This increases the visibility of your products and services in the latest generation of search engines, recommender systems, and other novel applications.

Resources

Examples

For more examples, see

Preliminaries: Prefix Declaration and Company Data

Prefix Declarations

# Prefix declarations
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix dc:       <http://purl.org/dc/elements/1.1/> .
@prefix dcterms:  <http://purl.org/dc/terms/> .
@prefix gr:        <http://purl.org/goodrelations/v1#> .
@prefix tio:       <http://purl.org/tio/ns#> .
@prefix foo:      <http://www.heppnetz.de/ontologies/tio/examples.rdf#> .

Company Data

foo:HeppTickets a gr:BusinessEntity ;
    gr:legalName "Hepp Tickets, a fictious division of Hepp Research Gmbh"@en .
    # You should add address details and geo-position data using
    # external vocabularies, e.g. schema.org or vcard

Concert Ticket

Scenario: An offer for tickets for the Bryan Adams concert at the Verizon Wireless Ampitheatre, at $ 19.99 per ticket.

Turtle

# We reuse this event: http://data.linkedevents.org/event/3018e1eb-b1dc-4b62-8cb2-f1457c7a31cf
# Bryan Adams at the Verizon Wireless Amphitheatre

foo:ticket1 a tio:TicketPlaceholder ;
    rdfs:label "Ticket for Bryan Adams at the Verizon Wireless Amphitheatre"@en ;
    tio:accessTo <http://data.linkedevents.org/event/3018e1eb-b1dc-4b62-8cb2-f1457c7a31cf> .

foo:HeppTickets gr:offers foo:offer1 .

foo:offer1 a gr:Offering ;
    gr:name "Ticket for Bryan Adams at the Verizon Wireless Amphitheatre"@en ;
    gr:description "Don't miss this: Bryan Adams at the Verizon Wireless Amphitheatre!"@en ;
    gr:includes foo:ticket1 ;
    gr:hasBusinessFunction gr:Sell ;
    gr:hasPriceSpecification
         [ a gr:UnitPriceSpecification ;
           gr:hasCurrency "USD"@en ;
           gr:hasCurrencyValue "19.99"^^xsd:float ;
           gr:validThrough "2010-11-11T23:59:59"^^xsd:dateTime ] .

RDFa

<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:tio="http://purl.org/tio/ns#"
     xmlns:gr="http://purl.org/goodrelations/v1#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     about="#offer1" typeof="gr:Offering" xml:lang="en">
    <div property="gr:name">Ticket for Bryan Adams at the Verizon
    Wireless Amphitheatre</div>
    <div property="gr:description">Don't miss this: Bryan Adams at the Verizon
    Wireless Amphitheatre!</div>
    <div rev="gr:offers" resource="http://www.example.com/#company"></div>
    <div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div>
    Price:
    <div rel="gr:hasPriceSpecification">
        <div typeof="gr:UnitPriceSpecification">
            <span property="gr:hasCurrency" content="USD" datatype="xsd:string">$ </span>
            <span property="gr:hasCurrencyValue" content="19.99" datatype="xsd:float">19.99</span>
            <div property="gr:validThrough" content="2010-11-11T23:59:59"
              datatype="xsd:dateTime">Offer ends: Nov 11, 2010</div>
        </div>
    </div>
    <div rel="gr:includes">
        <div about="#ticket1" typeof="tio:TicketPlaceholder">
            Event link:
            <a rel="tio:accessTo"
              href="http://data.linkedevents.org/event/3018e1eb-b1dc-4b62-8cb2-f1457c7a31cf">
                Bryan Adams at the Verizon Wireless Amphitheatre</a>
            <div property="rdfs:label"
               content="Ticket for Bryan Adams at the Verizon Wireless Amphitheatre"></div>
        </div>
    </div>
</div>

Museum Admission Fare

Scenario: An offer for day tickets for the Deutsches Museum in Munich for EUR 8

Turtle

# Point of interest: http://dbpedia.org/resource/Deutsches_Museum

foo:ticket3 a tio:TicketPlaceholder ;
    rdfs:label "Day ticket for the Deutsches Museum in Munich"@en ;
    tio:accessTo <http://dbpedia.org/resource/Deutsches_Museum> .

foo:HeppTickets gr:offers foo:offer3 .

foo:offer3 a gr:Offering ;
        gr:name "Day tickets for the Deutsches Museum in Munich - just EUR 8"@en ;
        gr:description "Day tickets for one of the leading exhibitions of technology"@en ;
        gr:includes foo:ticket3 ;
        gr:hasBusinessFunction gr:Sell ;
        gr:hasPriceSpecification
             [ a gr:UnitPriceSpecification ;
                 gr:hasCurrency "EUR"@en ;
                 gr:hasCurrencyValue "8"^^xsd:float ;
                 gr:validThrough "2010-12-31T23:59:59"^^xsd:dateTime
             ] .

RDFa

<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:tio="http://purl.org/tio/ns#"
     xmlns:gr="http://purl.org/goodrelations/v1#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     about="#offer3" typeof="gr:Offering" xml:lang="en">
    <div property="gr:name">Day tickets for the Deutsches Museum in Munich - just EUR 8</div>
    <div property="gr:description">Day tickets for one of the leading exhibitions of technology</div>
    <div rev="gr:offers" resource="http://www.example.com/#company"></div>
    <div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div>
    Price:
    <div rel="gr:hasPriceSpecification">
        <div typeof="gr:UnitPriceSpecification">
            <span property="gr:hasCurrency" content="EUR" datatype="xsd:string">Euro </span>
            <span property="gr:hasCurrencyValue" content="8" datatype="xsd:float">8</span>
            <div property="gr:validThrough" content="2010-12-31T23:59:59"
              datatype="xsd:dateTime"> (valid until: Dec 31, 2010)</div>
        </div>
    </div>
    <div rel="gr:includes">
        <div about="#ticket3" typeof="tio:TicketPlaceholder">
            Link to the location:
            <a rel="tio:accessTo"
              href="http://dbpedia.org/resource/Deutsches_Museum">Deutsches Museum</a>
            <div property="rdfs:label" content="Day ticket for the Deutsches Museum in Munich"></div>
        </div>
    </div>
</div>

Airfare

Scenario: There is a direct flight from Frankfurt to London Heathrow, operated by Lufthansa, departure at 20:00 GMTZ on November 12, 2010, arrival at 21:45 GMT. Available service classes are Economy and Business Class. An Economy ticket for one-way is EUR 99 if booked at least 7 and not more than 30 days before the flight. The offer is valid for Germany only ("DE"), and payment is accepted via MasterCard or VISA. The ticket is issued as an etix(R) electronic ticket.

Turtle

# Airfare
# FRA: <http://dbpedia.org/resource/Frankfurt_Airport>
# HRH: <http://dbpedia.org/resource/London_Heathrow_Airport>

foo:LH1234 a tio:Flight ;
    tio:from [ a tio:Stop ;
               tio:at <http://dbpedia.org/resource/Frankfurt_Airport> ;
               tio:departs "2010-11-12T20:00:00Z"^^xsd:dateTime ] ;
    tio:to [ a tio:Stop ;
               tio:at <http://dbpedia.org/resource/London_Heathrow_Airport> ;
               tio:arrives "2010-11-12T21:45:00Z"^^xsd:dateTime ] ;
    tio:availableServiceLevel tio:Economy, tio:BusinessClass ;
    tio:operatedBy  <http://dbpedia.org/resource/Lufthansa> .

foo:ticket5 a tio:TicketPlaceholder ;
        rdfs:label "Economy tickets from Frankfurt to London Heathrow"@en ;
        tio:scope [ a tio:ScopeOfAccess ;
                    tio:accessTo foo:LH1234 ;
                    tio:eligibleServiceLevel tio:Economy ] .

foo:HeppTickets gr:offers foo:offer5 .

foo:offer5 a gr:Offering ;
        gr:name "Economy tickets from Frankfurt to London Heathrow - just EUR 99"@en ;
        gr:description """Special Offer: Economy tickets from Frankfurt to
London Heathrow for just EUR 99"""@en ;
        gr:includes foo:ticket5 ;
        gr:advanceBookingRequirement [ a gr:QuantitativeValue ; # 7...30 days
                                       gr:hasMinValue "7"^^xsd:int ;
                                       gr:hasMaxValue "30"^^xsd:int ;
                                       gr:hasUnitOfMeasurement "DAY"^^xsd:string ] ;
        gr:eligibleRegions "DE"^^xsd:string ;
        gr:hasBusinessFunction gr:Sell ;
        gr:hasPriceSpecification
             [ a gr:UnitPriceSpecification ;
                 gr:hasCurrency "EUR"@en ;
                 gr:hasCurrencyValue "99"^^xsd:float ;
                 gr:validThrough "2010-11-11T23:59:59"^^xsd:dateTime ] ;
        gr:acceptedPaymentMethods gr:MasterCard, gr:VISA ;
        gr:availableDeliveryMethods tio:Etix .

RDFa

Flight Data

<div xmlns:tio="http://purl.org/tio/ns#">
   <div about="#LH1234"
        typeof="tio:Flight">
      <div rel="tio:availableServiceLevel" resource="http://purl.org/tio/ns#BusinessClass"/>
      <div rel="tio:availableServiceLevel" resource="http://purl.org/tio/ns#Economy"/>
      <div rel="tio:from">
         <div typeof="tio:Stop">
            <div rel="tio:at" resource="http://dbpedia.org/resource/Frankfurt_Airport"/>
            <div property="tio:departs"
                 content="2010-11-12T20:00:00Z"
                 datatype="xsd:dateTime"/>
         </div>
      </div>
      <div rel="tio:operatedBy" resource="http://dbpedia.org/resource/Lufthansa"/>
      <div rel="tio:to">
         <div class="description" typeof="tio:Stop">
            <div property="tio:arrives"
                 content="2010-11-12T21:45:00Z"
                 datatype="xsd:dateTime"/>
            <div rel="tio:at" resource="http://dbpedia.org/resource/London_Heathrow_Airport"/>
         </div>
      </div>
   </div>
</div>

Ticket Placeholder Data

<div>
   <div  about="#ticket5"
        typeof="tio:TicketPlaceholder">
      <div property="rdfs:label"
           content="Economy tickets from Frankfurt to London Heathrow"
           xml:lang="en"/>
      <div rel="tio:scope">
         <div class="description" typeof="tio:ScopeOfAccess">
            <div rel="tio:accessTo"
                 resource="#LH1234"/>
            <div rel="tio:eligibleServiceLevel" resource="http://purl.org/tio/ns#Economy"/>
         </div>
      </div>
   </div>
</div>

Offer Data

<div>
   <div about="#HeppTickets">
      <div rel="gr:offers">
         <div about="#offer5" typeof="gr:Offering">
            <div rel="gr:acceptedPaymentMethods"
                 resource="http://purl.org/goodrelations/v1#MasterCard"/>
            <div rel="gr:acceptedPaymentMethods"
                 resource="http://purl.org/goodrelations/v1#VISA"/>
            <div rel="gr:advanceBookingRequirement">
               <div class="description" typeof="gr:QuantitativeValue">
                  <div property="gr:hasMaxValue"
                       content="30"
                       datatype="xsd:int"/>
                  <div property="gr:hasMinValue"
                       content="7"
                       datatype="xsd:int"/>
                  <div property="gr:hasUnitOfMeasurement"
                       content="DAY"
                       datatype="xsd:string"/>
               </div>
            </div>
            <div rel="gr:availableDeliveryMethods" resource="http://purl.org/tio/ns#Etix"/>
            <div property="gr:description"
                 content="Special Offer: Economy tickets from
Frankfurt to London Heathrow for just EUR 99"
                 xml:lang="en"/>
            <div property="gr:eligibleRegions"
                 content="DE"
                 datatype="xsd:string"/>
            <div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"/>
            <div rel="gr:hasPriceSpecification">
               <div class="description" typeof="gr:UnitPriceSpecification">
                  <div property="gr:hasCurrency" content="EUR" xml:lang="en"/>
                  <div property="gr:hasCurrencyValue"
                       content="99"
                       datatype="xsd:float"/>
                  <div property="gr:validThrough"
                       content="2010-11-11T23:59:59"
                       datatype="xsd:dateTime"/>
               </div>
            </div>
            <div rel="gr:includes"
                 resource="http://www.heppnetz.de/ontologies/tio/examples.rdf#ticket5"/>
            <div property="gr:name"
                 content="Economy tickets from Frankfurt to London Heathrow - just EUR 99"
                 xml:lang="en"/>
         </div>
      </div>
   </div>
</div>