Difference between revisions of "Ontology Development Exercises"

From Developer Documents
Jump to navigation Jump to search
Line 30: Line 30:
 
* The data type of a subtitle is [{begin : Double, end : Double, text : String}].
 
* The data type of a subtitle is [{begin : Double, end : Double, text : String}].
 
* Example data (Pulp Fiction)  
 
* Example data (Pulp Fiction)  
  [{begin=29.516, end=31.916, text=”Forget it. It's too risky.”},
+
  [ {begin=29.516, end=31.916, text=”Forget it. It's too risky.”},
  {begin=31.956, end=33.476, text=”I'm through doing that shit.”}}
+
  {begin=31.956, end=33.476, text=”I'm through doing that shit.”}}
 
  ]
 
  ]
  

Revision as of 18:11, 16 November 2010

Before trying these exercises, go through the basic tutorial Tutorial:_Ontology_Development. All the exercises add some new features to the ontology.

Exercise 1: Release year

Make it possible to give the release year of a movie. Add following data to the movie library:

  • Casino Royale, 2006
  • 007 Quantum of Solace, 2008
  • Golden Eye, 1995
  • Die Another Day, 2002
  • Dr. No, 1962
  • The World Is Not Enough, 1999

Exercise 2: MovieInfo template

Create a template MovieInfo that lets you write:

ML.t0381061
    @MO.MovieInfo "Casino Royale” ML.MartinCambell 2006
    @MO.Casting db.JamesBond ML.DanielCraig 

Exercise 3: Genres

  • Add type Genre to Movie ontology. It inherits Type.
  • Add types Action, Drama and Western to Movie ontology. These types inherit Movie and are instances of Genre.
mo.Drama <T mo.Movie : mo.Genre
  • Let all movies in MovieLibrary to be instances of Action genre.

Exercise 4: Subtitles

  • Add a data type for subtitles to Movie ontology and make possible to add it to movie.
  • The data type of a subtitle is [{begin : Double, end : Double, text : String}].
  • Example data (Pulp Fiction)
[ {begin=29.516, end=31.916, text=”Forget it. It's too risky.”},
  {begin=31.956, end=33.476, text=”I'm through doing that shit.”}}
]

Exercise 5: Awards

Add following information to MovieLibrary and corresponding concepts to Movie ontology:

  • Daniel Craig won Empire Award in category Best Actor in 2006 for Casino Royale.