RSS iconTwitter iconFacebook icon

The Trek BBS title image

The Trek BBS statistics

Threads: 137,861
Posts: 5,328,696
Members: 24,554
Currently online: 542
Newest member: Kastrol

TrekToday headlines

Retro Review: Inquisition
By: Michelle on Jul 12

Cubify Star Trek 3DMe Mini Figurines
By: T'Bonz on Jul 11

Latest Official Starships Collection Ships
By: T'Bonz on Jul 10

Seven of Nine Bobble Head
By: T'Bonz on Jul 9

Pegg The Prankster
By: T'Bonz on Jul 9

More Trek Stars Join Unbelievable!!!!!
By: T'Bonz on Jul 8

Star Trek #35 Preview
By: T'Bonz on Jul 8

New ThinkGeek Trek Apparel
By: T'Bonz on Jul 7

Star Trek Movie Prop Auction
By: T'Bonz on Jul 7

Drexler: NX Engineering Room Construction
By: T'Bonz on Jul 7


Welcome! The Trek BBS is the number one place to chat about Star Trek with like-minded fans. Please login to see our full range of forums as well as the ability to send and receive private messages, track your favourite topics and of course join in the discussions.

If you are a new visitor, join us for free. If you are an existing member please login below. Note: for members who joined under our old messageboard system, please login with your display name not your login name.


Go Back   The Trek BBS > Entertainment & Interests > Science and Technology

Science and Technology "Somewhere, something incredible is waiting to be known." - Carl Sagan.

Reply
 
Thread Tools
Old September 27 2012, 01:49 PM   #1
FreddyE
Commander
 
TVSML - a markup language to describe tv series

I´m working on a xds to describe tv series and could use any comments and suggestions.

This is what I got so far:

Code:
 <?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="series">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="title"/>
        <xs:element ref="year"/>
        <xs:element ref="country"/>
        <xs:element ref="genre"/>
        <xs:element ref="description"/>
        <xs:element ref="studio"/>
        <xs:element ref="producers"/>
        <xs:element ref="actors"/>
        <xs:element ref="seasons"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="title">
    <xs:complexType/>
  </xs:element>
  <xs:element name="year">
    <xs:complexType/>
  </xs:element>
  <xs:element name="country">
    <xs:complexType/>
  </xs:element>
  <xs:element name="genre">
    <xs:complexType/>
  </xs:element>
  <xs:element name="description">
    <xs:complexType/>
  </xs:element>
  <xs:element name="studio">
    <xs:complexType/>
  </xs:element>
  <xs:element name="producers">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="name"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="name">
    <xs:complexType/>
  </xs:element>
  <xs:element name="actors">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="main"/>
        <xs:element ref="recurring"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="main">
    <xs:complexType/>
  </xs:element>
  <xs:element name="recurring">
    <xs:complexType/>
  </xs:element>
  <xs:element name="seasons">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="count"/>
        <xs:element ref="season"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="count">
    <xs:complexType/>
  </xs:element>
  <xs:element name="season">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="seasonnr"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="seasonnr">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="actorleft"/>
        <xs:element ref="actorreturn"/>
        <xs:element ref="episodes"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="actorleft">
    <xs:complexType/>
  </xs:element>
  <xs:element name="actorreturn">
    <xs:complexType/>
  </xs:element>
  <xs:element name="episodes">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="episodecount"/>
        <xs:element ref="episode"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="episodecount">
    <xs:complexType/>
  </xs:element>
  <xs:element name="episode">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="episodenr"/>
        <xs:element ref="episodetitle"/>
        <xs:element ref="director"/>
        <xs:element ref="writer"/>
        <xs:element ref="guestactor"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="episodenr">
    <xs:complexType/>
  </xs:element>
  <xs:element name="episodetitle">
    <xs:complexType/>
  </xs:element>
  <xs:element name="director">
    <xs:complexType/>
  </xs:element>
  <xs:element name="writer">
    <xs:complexType/>
  </xs:element>
  <xs:element name="guestactor">
    <xs:complexType/>
  </xs:element>
</xs:schema>
FreddyE is offline   Reply With Quote
Old September 27 2012, 02:01 PM   #2
Robert Maxwell
Respect the Beef
 
Robert Maxwell's Avatar
 
Location: Right behind you!
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: TVSML - a markup language to describe tv series

You may want an element in there for the original network that aired it, too.

Some general thoughts:

* Actors, writers, directors, and producers are all people. You will want similar information for each, such as first name, last name, and a list of seasons in which they appeared/worked. To that end, I would have a generic "person" type that has those fields, and then you'd put collections of those under each type of person. So, the "actor" element is a collection of type "person".
* The above obviates the need for the "seasonnr" element, which is confusing and seems to be of limited utility. In its place, each person can have a collection of season numbers indicating when they worked on the show.
* The "year" field makes no sense by itself. Shouldn't you have "yearbegan" and "yearended"?
* If you want this to be a comprehensive TV series schema, you should also have a "season" type which is a collection of "episode" elements, and for each "episode" you would have the following information: season, episode number, production number (optional?), writer(s) (collection), guest stars (collection), title, original air date, synopsis. For the sake of normalization, I suppose you could get away with only using the IDs of any people involved in a given episode, rather than duplicating the entire "person" object for each one. The overall "person" collections would be outside the "episode" and "season" collections. I know you already have some of this info in your schema, I'm just suggesting how you could reorganize/expand it to be more logical and complete.

A big part of my job is designing schemas and normalizing data so I enjoy this stuff.

Hope you get something out of my suggestions!
__________________
"Holy shit! It's Beef Supreme!"
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old September 27 2012, 02:10 PM   #3
FreddyE
Commander
 
Re: TVSML - a markup language to describe tv series

Great suggestions! Thanks. :-) Maybe running time as part of episode would be a good idea too. For example nuDrWho has variable episode lengths if I remember correctly.
FreddyE is offline   Reply With Quote
Old September 27 2012, 02:12 PM   #4
Robert Maxwell
Respect the Beef
 
Robert Maxwell's Avatar
 
Location: Right behind you!
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: TVSML - a markup language to describe tv series

Might as well. Any kind of quantitative data you can provide is good.
__________________
"Holy shit! It's Beef Supreme!"
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old September 27 2012, 02:50 PM   #5
FreddyE
Commander
 
Re: TVSML - a markup language to describe tv series

The final goal of all of this btw. is a website that is driven by a algorithm that would be able to look at all the data, and come to logical conclusions. You would be able to ask stuff like: Tell me all episodes of any scifi series produced after 1999 that has at least one actor appearing who was a recurring cast member of Star Trek TNG and is not Whoopie Goldberg.
FreddyE is offline   Reply With Quote
Old September 27 2012, 02:54 PM   #6
Robert Maxwell
Respect the Beef
 
Robert Maxwell's Avatar
 
Location: Right behind you!
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: TVSML - a markup language to describe tv series

That makes sense. How are you going to store this data, internally? Representing it as XML is fine for Web consumption, but sucks for searchability and scaling. You thinking of using a relational database, or maybe an object database, then serving the data over SOAP/REST?
__________________
"Holy shit! It's Beef Supreme!"
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old September 27 2012, 03:07 PM   #7
FreddyE
Commander
 
Re: TVSML - a markup language to describe tv series

Of course there needs to be a database. I´ve only worked with mysql so far. Maybe I should actually design the database first, and then use a tool to make the xsd?
FreddyE is offline   Reply With Quote
Old September 27 2012, 03:32 PM   #8
Robert Maxwell
Respect the Beef
 
Robert Maxwell's Avatar
 
Location: Right behind you!
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: TVSML - a markup language to describe tv series

I think that would be a much better idea, yes.

Start with what data you want to store. Define all the relationships between items in that data. Then design your database. If you don't know anything about database normalization, read up on that. It's not hard to grasp once you understand the basics.

Your XML schema should more or less resemble the relational structure of your database.
__________________
"Holy shit! It's Beef Supreme!"
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
FireFox 2+ or Internet Explorer 7+ highly recommended.