namespace pm = "http://www.politicalmashup.nl"
namespace pmd = "http://www.politicalmashup.nl/docinfo"

include "include/toolbox.rnc"
include "include/pmstructure.rnc"

# Schema to describe biographical data for all political parties of all countries.
# Parties should at least have an Id and Name by which it is commonly known.
# Also try to provide at least one Link to an open data source such as wikipedia.

Content = Party

Party = element pm:party { PartyContent }

PartyContent = 
    Source?
    & Id
    & DcRelation?               # If there is another party document covering the same party, then declare that relationship in an owl:sameAs element here
    & Name                      # The preferred spelling of the party name 
    & AlternativeNames?         # Alternative spelling variations including acronyms and OCR (mis)spellings
    & History?                  # Info on formation, abolition, ancestors and successors (descendants)
    & Links?                    # Links to wikipedia, party website, etc.
    & Seats?                    # Number of seats for each government period

History = element pm:history { HistoryContent }

HistoryContent =
    Source?
    & element pm:formation { DateContent }?
    & element pm:abolition { DateContent }?
    & element pm:ancestors { RelatedPartyContent }?
    & element pm:descendants { RelatedPartyContent }?

RelatedPartyContent = 
    Source?
    & element pm:party-ref { PartyRefContent }+

PartyRefContent =
    Source?
    & attribute pm:note { text }?     # An optional note to further clarify the relationship between the two parties
    & PartyRef                      # reference to the id of the other party

Seats = element pm:seats { SeatsContent }

SeatsContent = 
    Source?
    & Session+

Session = element pm:session {SessionContent}

SessionContent = 
    Source?
    & House
    & attribute pm:seats{text}
    & Period