Skip to content

This repository contains a (client-side) web application to automatically generate Codemeta documents (aka. codemeta.json).

License

Notifications You must be signed in to change notification settings

oeg-upm/auto-codemeta-generator

 
 

Repository files navigation

Codemeta Generator

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.

References

Specifications

Use case

  1. create a complete codemeta.json file from scratch
  2. aggregate existing information and add complementary information to a codemeta.json file

Functionalities

  • 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.

Code contributions

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.

Code guidelines

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.

Running local changes

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.

Automatic testing

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:

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.

Install Autocodemeta Generator in server

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:

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" }

Funding

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

Contributed by

Image description Ontology Engineering Group

About

This repository contains a (client-side) web application to automatically generate Codemeta documents (aka. codemeta.json).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.4%
  • HTML 10.4%
  • CSS 2.5%
  • Python 0.7%