XML Format

The Public Domain Calculator uses an acyclic directed graph or decision tree as the basis for its calculation software. Available decision trees can be found on the media page. A data format in XML is designed to have a machine readable version of this structure. Choosing this format over a decision tree directly programmed as an algorithm keeps the research accessible for all interested parties and easily implementable in different programming languages. This page explains that format, goes into the design decisions and describes future work for this data formatting.

XML

The Public Domain Calculator has three types and data formats attached to them. The most simple format is a button-based Calculator that only uses a simple user interface to guide a user through the decision tree. The form-based calculator adds to the complexity of the data format, but makes calculation easier by simplifying complex questions like “Was this work published within 50 years of creation?" to edit fields that have the questions “In what year was this work published?” and “In what year was this work created?”. Finally a seperate data model can be introduced to enable (semi) automatic calculation. By adding codification to the questions, information can be formalized and given in advance.

Button-Based Calculation

Button-based calculation needs only the most simple form of this format. An example is given below. Details are described after this example.

<calculator>
	<questions>
		<step nr="1">
			<type>
				multiplechoice
			</type>
			<question>
				<text>
					Is this question foo or bar?
				</text>
				<information>
					Information bubbles can be added to questions, answers, results.
				</information>
			</question>
			<answer>
				<value>
					Foo
				</value>
				<gotoNr>
					2
				</gotoNr>
			</answer>
				<answer>
				<value>
					Bar
				</value>
				<gotoNr>
					3
				</gotoNr>
			</answer>
		</step>
		<step nr="2">
			<type>
				result
			</type>
			<result>
				You choose Foo
			</result>
		</step>
		<step nr="3">
			<type>
				result
			</type>
			<result>
				You choose bar
			</result>
		</step>
	</questions>
</calculator>
			

The root of this XML file is <questions>. Each individual question is identified as a <step> node and a ‘nr’ attribute. This number attribute holds the identifier of the node and is reffered to later with the <gotoNr> in the answer node.

Each <step> has a childnode called <type> that has a vocabulary of [multiplechoice, result, single, double]. Only the first two are used in this example.

The <type> 'multiplechoice' has one question and multiple pre-defined answers. Each of the <answer> nodes have a value that is represented as the content of a button. Upon choosing one of the answers the <gotoNr> is used to look up the next step of the flowchart. Both <question> and <answer> can have an <information> childnode that holds extra information about its parent. In the calculator this is presented as an information bubble.

The <type> results indicate that a leaf node is reached and a result can be presented. The only two childnodes of this type of <step> are <result> and <information>.

Form-Based Calculation

Form-based calculation adds two extra types of <step> nodes to the format [single, double]. These indicate questions that need textual input. Whenever a <step> with <type> single or double is presented one or two edits are given with a submit button. The input in these fields is then compared to indicate either a True or False answer to an underlying question. This formula is stored in <evaluate> node. An evaluate node has some static references:

Variable Description
Q1 First Question
Q2 Second Question
Now Current Year (YYYY)

A next <step> is chosen based on whether the <evaluate> resolves to true or false.

An example of a <question> with <type> single:


<step nr="13">
	<type>
		single
	</type>
	<question>
		<text>
			In what year was the phonogram first manufactored?
		</text>
	</question>
	<answer>
		<value>
			True
		</value>
		<gotoNr>
			14
		</gotoNr>
	</answer>
	<answer>
		<value>
			False
		</value>
		<gotoNr>
			15
		</gotoNr>
	</answer>
	<evaluate>
		NOW-Q1&gt;50
	</evaluate>
</step>

An example of a <question> with <type> double:


<step nr="2">
	<type>
		double
	</type>
	<question>
		<text>
			In what year was the this work created?
		</text>
	</question>
	<question>
		<text>
			In what year was a recording this work first made available to the public?
		</text>
	</question>
	<answer>
		<value>
			True
		</value>
		<gotoNr>
			6
		</gotoNr>
	</answer>
	<answer>
		<value>
			False
		</value>
		<gotoNr>
			7
		</gotoNr>
	</answer>
	<evaluate>
		Q2-Q1&gt;50
	</evaluate>
</step>
			

Automatic Calculation

Automatic calculation adds a new childnode to the <calculator> node called <dataSchema>. This describes the data that a flowchart can handle as well as a <param> to all question nodes.

An example of <step> with a <param> in a <question>:


<step nr="5">
	<type>single</type>
	<question>
		<text>When was this first printed?</text>
		<param>First fixation of a film.first printed year</param>
	</question>
	<answer>
		<value>True</value>
		<gotoNr>3</gotoNr>
	</answer>
	<answer>
		<value>False</value>
		<gotoNr>4</gotoNr>
	</answer>
	<evaluate>NOW-Q1&gt;50</evaluate>
</step>

An example of a <dataSchema>:


<calculator>
	<questions>...</questions>
	<dataSchema>
		<class>
			<name>class</name>
			<param>
				<name>classList</name>
				<option>First fixation of a film</option>
				<option>Phonogram</option>
				<option>Literary or Artistic Works</option>
				<option>Broadcast</option>
				<option>Performance</option>
				<option>Unoriginal Database</option>
			</param>
		</class>
		<class>
			<name>First fixation of a film</name>
			<param>
				<name>publication year</name>
			</param>
			<param>
				<name>first printed year</name>
			</param>
		</class>
	</dataSchema>
</calculator>

The dataSchema holds the entire set of information that is needed to solve one of the main branches of a Public Domain Calculator tree. The first question of every calculator is a classification of works. Each classification needs a different set of information to be solved.

An array with these classes and parameters can be considered a data packet that is then run on the tree. Each question can indicate which information it needs with a class.param format.

It is not possible to create one unified API for all available calculators. Jurisdictions use different definitions for some of the necessary information and require more or less information to determine whether a work is in the public domain.