Open science and licensing (code, hardware, data)
Why sharing methods, code, designs and data makes research stronger, why public is not the same as open, and a general summary of common licences: MIT, Apache-2.0, GPL, Creative Commons and CERN-OHL.
Lesson 6 of 6 · 35 min · Self-paced · Free
Sharing so others can check and build
Earlier lessons kept returning to one idea: research is trustworthy when other people can check it. Open science takes that seriously by sharing not just conclusions but the materials behind them: methods, code, hardware designs, raw data and, where possible, the papers themselves, freely available to read.
Sharing these things has practical benefits:
- Checking. Others can rerun your analysis and find mistakes, including ones you would want to know about.
- Repeating. Someone with your design files and protocol can rebuild your experiment and see whether the result holds.
- Building. Others can start from your work instead of from scratch.
- Access. Students and researchers without large budgets can take part.
The proposed TV-01 project, for example, states an intention to release its hardware designs, firmware, evaluation protocol and raw logs under open licences, so that its experiments can be repeated and challenged. That is a stated plan for a project that has not yet produced results.
But sharing raises a practical question: what are other people actually allowed to do with what you share? That is what licences are for.
Public is not the same as open
In most countries, when you write code, text or a design file, you automatically own the copyright in it. You do not need to register anything. Copyright means that, by default, other people do not have permission to copy, modify or share your work.
So a project posted publicly online with no licence is visible, but others have no clear permission to reuse it. Many people do not realise this. "I found it on the internet" is not permission, as the credit lesson noted.
A licence is the creator's statement granting permissions to everyone, usually with some conditions. Choosing a licence is how you turn "public" into "open".
Licences for software
Software licences are often grouped into two families.
Permissive licences
Permissive licences let people do almost anything with the code, including using it in closed, commercial products, as long as they meet a few simple conditions.
- MIT License. Very short and widely used. Anyone may use, copy, modify, merge, publish, distribute, sublicense and sell the software. The main condition is that the copyright notice and the licence text must be included in all copies or substantial portions of the software. The software comes with no warranty.
- Apache License 2.0 (Apache-2.0). Also permissive, but longer and more detailed. Its conditions include keeping copyright and licence notices, including a copy of the licence, and stating significant changes you made to files. It also includes an explicit patent licence from contributors, which protects users from being sued by those contributors over patents covering their contributions. That patent licence ends for anyone who sues claiming the software infringes their patent.
Copyleft licences
Copyleft licences also allow use, modification and sharing, but add a key condition: if you distribute the software or a modified version of it, you must make the source code available under the same licence. The aim is that improvements stay open.
- GNU General Public License (GPL). The best-known copyleft licence, with versions 2 and 3 in wide use. If you distribute a program that includes GPL code, you generally have to release the source of the whole program under the GPL. If you modify GPL code only for your own private use and never distribute it, the sharing requirement does not apply.
Licences have to fit together
When you combine code under different licences, their conditions must be compatible. For example, the Free Software Foundation considers Apache-2.0 compatible with GPL version 3, but not with GPL version 2. Before mixing code from different sources, check each licence, and choose a licence for your own project that respects them all.
Licences for writing, images and data
Creative Commons licences are designed for creative works and other content: text, images, videos, documentation and often data.
- CC BY 4.0 (Attribution) lets anyone share and adapt the work, including commercially, as long as they give appropriate credit, provide a link to the licence and indicate whether they made changes.
- Other variants add conditions: SA (ShareAlike) requires adaptations to use the same licence, a copyleft idea; NC (NonCommercial) forbids commercial use; ND (NoDerivatives) forbids sharing modified versions.
- CC0 is not a licence with conditions but a way of giving up your rights as far as the law allows, placing the work as close to the public domain as possible. It is popular for data sets because it removes doubt about reuse.
Creative Commons itself recommends against using its licences (other than CC0) for software, because they were not written with software in mind. Use a software licence for code and a Creative Commons licence for documentation and media.
For data, the legal picture varies: in many places plain facts cannot be copyrighted, but collections of data may have some protection, and the rules differ between countries. Putting a clear licence such as CC0 or CC BY on a data set removes the uncertainty for people who want to reuse it.
Licences for hardware
Hardware is trickier, because a physical object is not the same as the files that describe it. Open hardware licences mainly work through rights in the design files and documentation: schematics, circuit board layouts, CAD models and assembly instructions.
The CERN Open Hardware Licence (CERN-OHL), created at CERN, is widely used for this. Version 2, released in 2020, comes in three variants:
- CERN-OHL-P: permissive, similar in spirit to MIT or Apache-2.0.
- CERN-OHL-W: weakly reciprocal: changes to the licensed design must be shared, but it can be combined with other designs that are not.
- CERN-OHL-S: strongly reciprocal: designs that incorporate it must be shared under the same licence, similar in spirit to the GPL.
Some open hardware projects instead use a Creative Commons licence such as CC BY-SA for their design files and documentation. Note that licences do not cover everything: an invention's working principle may be covered by a patent, or by no protection at all, and that is separate from the licence on your files.
Choosing licences for your own project
Ask yourself:
- Do I want others to be able to use my work in closed or commercial products? If yes, a permissive licence (MIT, Apache-2.0, CERN-OHL-P, CC BY) fits. If you want improvements to stay open, consider a copyleft or reciprocal licence (GPL, CERN-OHL-S or -W, CC BY-SA).
- What does my project contain? Code, documentation, hardware designs and data may each need a different licence. It is normal for one project to use several, for example MIT for firmware, CERN-OHL for the circuit board and CC BY for the documentation.
- What licences apply to things I reused? Your choice must be compatible with them, and you must keep their notices.
Then make it obvious:
- Put the licence text in a file named LICENSE at the top of your project.
- Say in the README which licence covers which parts.
- Keep the copyright and licence notices of anything you reused.
- If you are under 18 or working through a school, check with a teacher or parent before publishing, as the school may have its own rules.
Sharing data well
Releasing data is only useful if others can understand it. A widely used set of guidelines, the FAIR principles, says shared data should be Findable, Accessible, Interoperable (in formats other tools can read) and Reusable (with enough documentation and a clear licence). In practice, for a student project:
- Use plain, common formats such as CSV.
- Include a short README: what each column means, its units, how and when the data was collected, and anything unusual.
- Share the raw data, not only the cleaned version, and explain how one became the other.
- Remove personal information before sharing anything.
When not to share everything
Open is a good default, not an absolute rule. Do not share personal data about participants, information that could seriously help someone cause harm, or material that belongs to someone else without their permission. Explaining clearly what you have shared, what you have not, and why, is itself part of open science.
Project
Paper project: license a project
Imagine you are about to publish a small robotics project online. It contains:
- Python code you wrote, plus one function adapted from an MIT-licensed project;
- a circuit diagram and a CAD model of a bracket;
- a written guide with photos you took;
- a CSV file of your test results.
On paper:
- Choose a licence for each part, and explain your choice in one or two sentences.
- Write what you must do to respect the MIT licence of the adapted function.
- Draft the "Licence" section of the project's README.
- Draft a short README for the CSV file: columns, units, how the data was collected, and its licence.
You do not need to publish anything. Remember that this exercise is for learning and is not legal advice.
Deliverables
- A chosen licence for each of the four parts, with reasons
- The steps needed to respect the MIT-licensed function
- A draft Licence section for the README
- A draft data README describing columns, units and collection method
Knowledge check
Check your understanding
Go further
- Choose a License: licences overview ↗
A plain-language comparison of common software licences, showing their permissions, conditions and limitations.
- Creative Commons Attribution 4.0 (CC BY 4.0) deed ↗
The official human-readable summary of CC BY 4.0, with a link to the full legal text.
- CERN Open Hardware Licence — Wikipedia ↗
Background on the CERN-OHL and its three version 2 variants.
- Various licenses and comments about them — GNU Project ↗
The Free Software Foundation's notes on many licences, including which are compatible with the GPL.
- FAIR data — Wikipedia ↗
An overview of the Findable, Accessible, Interoperable and Reusable principles for sharing data.
Lesson materials · free to download
Sign in to track your progress. Reading is free without an account.