php-codemeta-crosswalk

Codemeta conversions - https://doi.org/10.5281/zenodo.12808884

https://github.com/ramy-badr-ahmed/php-codemeta-crosswalk

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

biblatex bibtex codemeta codemeta-converter codemeta-crosswalk codemeta-generator codemeta-json datacite illuminate-collections illuminate-validation metadata psysh
Last synced: 6 months ago · JSON representation

Repository

Codemeta conversions - https://doi.org/10.5281/zenodo.12808884

Basic Info
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 2
Topics
biblatex bibtex codemeta codemeta-converter codemeta-crosswalk codemeta-generator codemeta-json datacite illuminate-collections illuminate-validation metadata psysh
Created almost 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Codemeta

README.md

GitHub top language GitHub DOI

SWH

Codemeta.json Crosswalk

This repository has been developed as part of the FAIR4CoreEOSC project to address two project's pillars (Describe and Cite).

[!Note] A demonstrable version can be accessed here: Demo Version

Sample snapshot of the codemeta generator and converter demo:

snap.PNG

It currently addresses metadata conversions for the following use cases:

| From | To | |----------|---------------| | CodeMeta | DataCite [^1] | | CodeMeta | BibLatex [^2] | | CodeMeta | BibTex ^3 |

The codemeta conversion pattern to the above schemes is extendable to other metadata schemes as template classes located under Schemes directory. The initial keys correspondence is defined in this repository [^4].

[!Note] There's a scheme template class that can help see this pattern. Please consult the crosswalk [^4] and scheme documentations to properly construct this class.

Installation Steps:

1) Clone this project.

2) Open a console session and navigate to the cloned directory:

    Run "composer install"

    This should involve installing the PHP REPL, PsySH

3) (optional) Add psysh to PATH

        Example, Bash: 
                echo 'export PATH="$PATH:/The_Cloned_Directory/vendor/bin"' >> ~/.bashrc
                source ~/.bashrc

4) (Optional) Create your local branch.

Usage:

  • In a console session inside the cloned directory, start the php REPL:

```php $ psysh // if not added to PATH replace with: vendor/bin/psysh

Psy Shell v0.12.0 (PHP 8.2.0 — cli) by Justin Hileman ```

  • Define namespace:

```php

namespace Conversions; use Conversions; ```

  • Specify codemeta.json path:

```php

$codeMetaPath = 'CodeMeta/codeMeta.json' ```

[!Note] By default, codemeta.json is located under 'CodeMeta' directory where an example already exists. $codeMetaPath can also directly take codemeta.json as an array

  • Specify target scheme (as fully qualified class name)

```php

$dataCite = \Schemes\DataCite::class $bibLatex = \Schemes\BibLatex::class $bibTex = \Schemes\BibTex::class ```

[!Note] By default, scheme classes are located under 'Schemes' directory.

  • Get the conversion from the specified Codemeta.json:

```php

$errors = NULL; // initialise errors variable

$dataCiteFromCodeMeta = CodeMetaConversion::To($dataCite, $codeMetaPath, $errors) // array-formatted

$bibLatexFromCodeMeta = CodeMetaConversion::To($bibLatex, $codeMetaPath, $errors) // string-formatted

$bibTexFromCodeMeta = CodeMetaConversion::To($bibTex, $codeMetaPath, $errors) // string-formatted ```

  • Retrieve errors (if occurred) from the Illuminate\Support\MessageBag() instance:

```php

$errors->messages() // gets error messages as specified in CodeMeta/conversionsValidations.php

$errors->keys() // gets codemeta keys where errors occurred

$errors->first() // gets the first occurred error message

$errors->has('identifier') // checks whether an error has occurred in the codemeta identifier key ```

[!Note] Validations use the Illuminate\Validation\Validator package. Error messages and rules can be customised in CodeMeta/conversionsValidations.php as per the package syntax.

References

[^1]: DataCite Metadata Schema. [^2]: BibLATEX style extension for Software.

[^4]: Codemeta Crosswalk.

Owner

  • Login: Ramy-Badr-Ahmed
  • Kind: user
  • Location: Germany

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "datePublished": "2023-10-06",
  "dateCreated": "2023-07-31",
  "description": " Codemeta conversions ",
  "name": "codemeta-crosswalk",
  "license": "https://spdx.org/licenses/Apache-2.0.html",
  "dateModified": "2024-05-06",
  "softwareVersion": "1.0-Beta",
  "developmentStatus": "active",
  "programmingLanguage": "PHP",
  "operatingSystem": "cross-platform",
  "runtimePlatform": "PHP Interpreter",
  "relatedLink": "https://1959e979-c58a-4d3c-86bb-09ec2dfcec8a.ka.bw-cloud-instance.org",
  "codeRepository": "https://github.com/Ramy-Badr-Ahmed/codemetaCrosswalk",
  "readme": "https://github.com/Ramy-Badr-Ahmed/codemetaCrosswalk/blob/main/README.md",
  "identifier": "https://archive.softwareheritage.org/swh:1:dir:b00c5e6af70451deb1960215c2a4b34e53586820;origin=https://github.com/Ramy-Badr-Ahmed/codemetaCrosswalk;visit=swh:1:snp:9e3fdc7155f39bf4fdd94c0af65efa2c31178b15;anchor=swh:1:rev:8224c09eefbf9c1df87de7c0edbeae18e849ca32",
  "author": [
    {
      "@type": "Person",
      "email": "126559907+Ramy-Badr-Ahmed@users.noreply.github.com",
      "familyName": "Ahmed",
      "givenName": "Ramy-Badr"
    }
  ],
  "keywords": [
    "bibtex",
    "biblatex",
    "datacite",
    "codemeta-json",
    "codemeta-crosswalk"
  ],
  "softwareRequirements": [
    "PHP >=8.0",
    "illuminate/validation>=10.43",
    "composer/spdx-licenses>=1.5",
    "illuminate/support>=10.39"
  ],
  "maintainer": {
    "@type": "Person",
    "email": "126559907+Ramy-Badr-Ahmed@users.noreply.github.com",
    "familyName": "Ahmed",
    "givenName": "Ramy-Badr"
  },
  "applicationCategory": [
    "codemeta.json",
    "Metadata",
    "Conversions of Metadata"
  ],
  "funder": {
    "@type": "Organization",
    "funding": "EU-Horizon: 101057264",
    "@id": "https://doi.org/10.3030/101057264",
    "name": "European Comission"
  }
}

GitHub Events

Total
  • Pull request event: 1
  • Create event: 1
Last Year
  • Pull request event: 1
  • Create event: 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (2)
  • Ramy-Badr-Ahmed (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2)

Dependencies

composer.json packagist
  • composer/spdx-licenses ^1.5
  • illuminate/support ^10.39
  • illuminate/validation ^10.43
  • php ^8.2
  • psy/psysh ^0.12.0
composer.lock packagist
  • brick/math 0.12.1
  • carbonphp/carbon-doctrine-types 3.2.0
  • composer/spdx-licenses 1.5.8
  • doctrine/inflector 2.0.10
  • doctrine/lexer 3.0.1
  • egulias/email-validator 4.0.2
  • illuminate/collections v10.47.0
  • illuminate/conditionable v10.47.0
  • illuminate/container v10.47.0
  • illuminate/contracts v10.47.0
  • illuminate/filesystem v10.47.0
  • illuminate/macroable v10.47.0
  • illuminate/support v10.47.0
  • illuminate/translation v10.47.0
  • illuminate/validation v10.47.0
  • nesbot/carbon 2.72.3
  • nikic/php-parser v5.0.2
  • psr/clock 1.0.0
  • psr/container 2.0.2
  • psr/simple-cache 3.0.0
  • psy/psysh v0.12.0
  • symfony/console v7.0.4
  • symfony/deprecation-contracts v3.4.0
  • symfony/finder v6.4.0
  • symfony/http-foundation v6.4.4
  • symfony/mime v6.4.3
  • symfony/polyfill-ctype v1.29.0
  • symfony/polyfill-intl-grapheme v1.29.0
  • symfony/polyfill-intl-idn v1.29.0
  • symfony/polyfill-intl-normalizer v1.29.0
  • symfony/polyfill-mbstring v1.29.0
  • symfony/polyfill-php72 v1.29.0
  • symfony/polyfill-php80 v1.29.0
  • symfony/polyfill-php83 v1.29.0
  • symfony/service-contracts v3.4.1
  • symfony/string v7.0.4
  • symfony/translation v6.4.4
  • symfony/translation-contracts v3.4.1
  • symfony/var-dumper v7.0.4
  • voku/portable-ascii 2.0.1