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

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

# Schema for parliamentary proceedings.
#
# Proceedings consist of one or more Topics, which are usually the different points on the agenda.
#
# Topics may be subdivided in Scenes. A Scene is when a speaker stands in front of the speaker chair. This main speaker is identified with a MemberRef in Scene.
#
# Whenever a new person walks up to the speaker chair, a new Scene is created.
# A Scene (or if there is no such subdivision, a Topic) is subdivided in Speech elements. 
#
# Whenever there is a different speaker (for example with interruptions), there is a new Speech element.
#
# A Scene must at least have one Speech by the speaker identified in Scene.
#
# All meta data (everything outside the spoken word) that can be extracted from the source document is contained in StageDirections. 
# A StageDirection may contain for instance a Pagebreak, a change in chairman (Chair), the results of a Vote, or a reference to a parliamentary document under discussion (Paper).
#
# For UK data, a Scene represents not the time a speaker is in front of the speaker chair, but is used as a subdivision of topics in subtopics.
# To mark the difference, attribute pm:type in Scene is set to 'topic' instead of 'speaker' for the conventional use of Scene.
#
# All spoken text is contained in Paragraph (p) elements. 


Content = Proceedings

Proceedings = element pm:proceedings { ProceedingsContent }

ProceedingsContent = 
                   Id
                   & DcRelation?          # If there is for some reason another proceedings document covering the same meeting, then declare that relationship in an owl:sameAs element here
                   & CommonAttributes
                   & Topic+

Topic =
    element pm:topic {TopicContent}
    
TopicContent =
        Id
        & CommonAttributes
        & Title?
        & Type?
        & ((Scene | StageDirection)* | (Speech | StageDirection)*)

Scene = element pm:scene { SceneContent }

SceneContent =
    Id
    & CommonAttributes
    & Title?
    & ((attribute pm:type {SpeakerType} & SpeakerAttributes) | attribute pm:type {TopicType})
    & (Speech | StageDirection)*
    
    # type =speaker: when topics are partioned into speeches by speakers as in NL and NO. 
    # type =topic: when a topic is subdivided into subtopics (as in UK)     
    # if type ='speaker' or no type at all, then Speakerattributes