Code

Public Domain Calculators

A new version of the public domain calculators has recently been released and is available at github.

The public domain calculators are developed by the Public Domain Working Group of the Open Knowledege Foundation. They rely on two important piece of information:

National Copyright laws

The public domain calculators are linked with the national copyright flowcharts developed as part of the Europeana project, which represents the provision of copyright law in the form of a decision tree (in Graphmlz format). For an overview of all jurisdictions currently available to the public domain calculators, check out the list of all implemented flowcharts.

These flowcharts are converted (with the script Graphml2json.rb) into simple json files that describe the national copyright regime. These files can be processed by the public domain calculators, but subsist independently of the underlying code. The files have to be augmented adding the specific queries to every decision of the flow. The calculator offers a set of basic simple queries that can be extended. For example:

{

“type”: “question”,

“text”: “Was the film published or communicated to the public within 50 years from the fixation?”,

“query”: {

“template”: “pdcalc:issued”,

“parameters”:{

“pdcalc:years”:50

}

},

“options”: [

{

“value”:true,

“text”: “Yes”,

“node”: “n2”

},

{

“value”:false,

“text”: “No”,

“node”: “n5”

}

]

}

All templates are based on “default queries” which are globally defined  for all jurisdictions in the file global.json. They can be overridden for a local jurisdiction in the region-specific file local.json.

In this specific example, “pdcalc:issued” is defined as “{  ?a a %(pdcalc:Film)s ; %(pdcalc:publicationDate)s ?b.  FILTER (year(xsd:dateTime(?b)) +%(pdcalc:years)s < year(now()) )  } }” with pdcalc:publicationDate defined as “dc:issued” and a parameter pdcalc:years set to 50 .

This string is converted into a SPARQL query, which implies a True/False return value. For every possible “options”, we must therefore assign a True/False value, so that the reasoner can understand how to proceed with the results.

Bibliographic Metadata

Metadata files describe the essential characteristics of a work from a bibliographic perspective, this includes information concerning the work itself (date of creation, date of first publication, etc.) and its author (legal person, natural person, date of death, etc).

The public domain calculators can take bibliographic metadata in RDF (xml, n3, turtle) and BibJSON formats.


Here is a general overview of how the public domain calculators work:

 

The backend of the public domain calculators consists of two elements:

  • Global.json globally defines the templates for the reasoner to construct a SPARQL query.

  • Local.json overrides the templates for a specific jurisdiction (if needed).

The actual public domain calculator (reasoner.py) takes the following 2 files as an input:

  • A national jurisdiction

  • The metadata of the work that the users wants to process (metadata.rdf or metadata.json)

and process them to declare whether or not the work described in metadata.rdf is in the public domain according to the national copyright regime of the selected jurisdiction.

The latest version of the software is available at github.

For a technical overview of the public domain calculators, check out the code page.

Implementing new Flowcharts

1. Download the national flowchart in .graphmlz format from outofcopyright.eu
2. Run graphm2rdf.rb to generate a flowchart in RDF/Flow format
3. Download the metadata for a work in RDF format
4. Implement the national calculator by mapping the questions from the flowchart with the answer in the metadata by means of specific Sparql queries. In you are confused as to how to proceed, take a look at the current implementation of the Austrian flowchart (map.rdf) which is the basic model over which all calculators can be derived.
5. Test it with several metadata files to make sure that the calculator never fails
6. Submit the calculator to pd-discuss for peer-review

Leave a Reply

Your email address will not be published. Required fields are marked *