Firts at all, This repository is an OEG (Ontology Engineering Group) development built upon the original Codemeta Generator.
This repository contains a (client-side) web application to generate
CodeMeta documents (aka. codemeta.json
).
The CodeMeta initiative is a Free and Open Source academic collaboration creating a minimal metadata schema for research software and code.
The academic community recommends on adding a codemeta.json file in the root directory of your repository.
With this linked data metadata file, you can easily declare the authorship, include contextual information and link to other research outputs (publications, data, etc.).
Also, the codemeta.json
file in your source code is indexed in the
Software Heritage (SWH) archive, which will improve findability in searches.
-
SWH guidelines for research software.
-
SWH blog post about metadata indexation.
-
Dan S. Katz's blog post about including metadata in your repository.
-
FORCE11's Software Citation Implementation WG repository
-
RDA & FORCE11's joint Software Source Code Identification WG repository
- create a complete codemeta.json file from scratch
- aggregate existing information and add complementary information to a codemeta.json file
- helpers while completing the form, for example a reference list of spdx licenses
- a validation mechanism after submission
- the possibility to use all the codeMeta terms and schema.org terms
- accessible from multiple platforms (web browsers or OS)
- (extra) the possibility to correct the output after validation as part of the creation process
This tool was initially prepared for the FORCE19 Hackathon.
NB: codemeta v2.0 is generated by default, but v3.0 (v2.0 compatible) can be generated via a dedicated button.
This section only applies to developers who want to contribute to the Codemeta Generator. If you only want to use it, you can use the hosted version instead.
This application is designed to work on popular modern browsers (Firefox, Chromium/Google Chrome, Edge, Safari). Check Caniuse for availability of features for these browsers.
To keep the architecture simple, we serve javascript files directly to browsers, without a compiler or transpiler.
To run Codemeta Generator, you just need an HTTP server serving the files (nginx, apache2, etc.).
The simplest way is probably to use Python's HTTP server:
git clone https://github.com/oeg-upm/auto-codemeta-generator
cd codemeta-generator
python3 -m http.server
then open http://localhost:8000/ in your web browser.
In addition to manual testing, we have automated tests to check for bugs quickly, using Cypress.
To run them, first install Cypress:
sudo apt install npm # or the equivalent on your system
npx [email protected] install
Then, run the tests:
npx [email protected] run
The OEG’s new development adds a small configuration file, config.json, which allows setting the default repository to be migrated and the FastAPI service URL.
git clone https://github.com/oeg-upm/auto-codemeta-generator
cd codemeta-generator
python3 -m http.server 80
or
sudo python3 -m http.server 80
Install service with FAST API to migrate properties from SOMEF
cd codemeta-generator/server/
sudo apt install python3.10-venv
python3 -m venv venv310
source venv310/bin/activate
pip install --upgrade pip
Install from Pypi SOMEF, FASTAPI and UVICORN
SOMEF is available in Pypi!. To install it just type (default version is Python 3.10): (default version is Python 3.10)
pip install somef fastapi uvicorn
pip show somef fastapi uvicorn
somef --help
If everything goes fine, you should see:
Usage: somef [OPTIONS] COMMAND [ARGS]...
Options:
-h, --help Show this message and exit.
Commands:
configure Configure credentials
describe Running the Command Line Interface
version Show somef version.
Configure
Before running SOMEF, you must configure it appropriately. Run:
python -m nltk.downloader wordnet
python -m nltk.downloader omw-1.4
To download two wordnet modules needed. Then run:
somef configure
And you will be asked to provide the following:
- A GitHub authentication token [optional, leave blank if not used], which SOMEF uses to retrieve metadata from GitHub. If you don't include an authentication token, you can still use SOMEF. However, you may be limited to a series of requests per hour. For more information, see https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
- The path to the trained classifiers (pickle files). If you have your own classifiers, you can provide them here. Otherwise, you can leave it blank
If you want to configure SOMEF with the default parameters, just type:
somef configure -a
For showing help about the available options, run:
somef configure --help
Which displays:
Usage: somef configure [OPTIONS]
Configure GitHub credentials and classifiers file path
Options:
-a, --auto Automatically configure SOMEF
-h, --help Show this message and exit.
RUN FAST API cd codemeta-generator/server/ uvicorn app:app --host 0.0.0.0 --port 23705 --log-level debug
CONFIG URL There is a config.json where it can be change the default repository to migrate and the fast api url
{ "default_repo": "https://github.com/tpronk/somef-demo-repo", "fastapi_url": "https://api.autocodemeta.linkeddata.es" }
The authors acknowledge the OSCARS project, which has received funding from the European Commission's Horizon Europe Research and Innovation programme under grant agreement No. 101129751