Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0afec5e
Add GitLab crosswalk
Aidajafarbigloo Oct 29, 2025
851a4e5
Update codemeta.jsonld according to Paris hackathon decision
dgarijo Jan 20, 2026
dcabcb1
Update codemeta.jsonld
dgarijo Jan 20, 2026
a977519
ci: bump github actions versions (#474)
afuetterer Mar 25, 2026
98b8f88
scripts: Replace os.path with pathlib.Path (#475)
afuetterer Mar 25, 2026
4eb2ed0
Merge pull request #468 from dgarijo/master
moranegg Mar 27, 2026
0517459
Remove 'http_url_to_repo'
Aidajafarbigloo Mar 30, 2026
f46c3a0
Update softwareVersion property match
Aidajafarbigloo Mar 30, 2026
0f5330d
Fix URL field
Aidajafarbigloo Mar 31, 2026
5f27e88
Fix relatedLink field
Aidajafarbigloo Mar 31, 2026
e8ecbc8
Remove proposed match to `fileSize`
Aidajafarbigloo Mar 31, 2026
ca8fd13
Update contributor field
Aidajafarbigloo Mar 31, 2026
1dc5438
Update dateModified field
Aidajafarbigloo Mar 31, 2026
b262226
Switch OR to /
Aidajafarbigloo Mar 31, 2026
b1b4473
Update fileds
Aidajafarbigloo Mar 31, 2026
fb6a40b
Fix fileFormat
Aidajafarbigloo Apr 21, 2026
906ede1
Remove the proposed match to maintainer
Aidajafarbigloo Apr 21, 2026
4255a93
Remove the proposed match to installUrl
Aidajafarbigloo Apr 21, 2026
0bc1f26
Merge pull request #444 from Aidajafarbigloo/master
moranegg Apr 23, 2026
96395d5
Merge pull request #10 from SciCodes/target_codemeta_v4
dgarijo May 19, 2026
9ca896f
first alignment for doc
dgarijo May 19, 2026
71d9b5b
Merge branch 'master' into codemeta_v4_daniel
dgarijo May 19, 2026
0fec51a
Separated definitions from schema. Fix #416
dgarijo May 19, 2026
909ee06
Merge branch 'codemeta_v4_daniel' of https://github.com/SciCodes/code…
dgarijo May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install dependencies
Expand All @@ -21,6 +21,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Run aggregate.py
run: python3 scripts/aggregate.py
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
Expand Down
156 changes: 156 additions & 0 deletions codemeta_all.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"@context": {
"type": "@type",
"id": "@id",
"schema":"https://schema.org/",
"codemeta": "https://w3id.org/codemeta/terms/",
"Organization": {"@id": "schema:Organization"},
"ContactPoint": { "@id": "schema:ContactPoint" },
"Person": {"@id": "schema:Person"},
"Review": {"@id": "schema:Review"},
"Role": {"@id": "schema:Role"},
"SoftwareSourceCode": {"@id": "schema:SoftwareSourceCode"},
"SoftwareApplication": {"@id": "schema:SoftwareApplication"},
"WebAPI": {"@id": "schema:WebAPI"},
"WebApplication": {"@id": "schema:WebApplication"},
"Text": {"@id": "schema:Text"},
"URL": {"@id": "schema:URL"},
"address": { "@id": "schema:address"},
"affiliation": { "@id": "schema:affiliation"},
"applicationCategory": { "@id": "schema:applicationCategory"},
"applicationSubCategory": { "@id": "schema:applicationSubCategory"},
"citation": { "@id": "schema:citation"},
"codeRepository": { "@id": "schema:codeRepository", "@type": "@id"},
"contactPoint": { "@id": "schema:contactPoint" },
"contactType": { "@id": "schema:contactType" },
"contributor": { "@id": "schema:contributor", "@container": "@list" },
"copyrightHolder": { "@id": "schema:copyrightHolder"},
"copyrightYear": { "@id": "schema:copyrightYear"},
"dateCreated": {"@id": "schema:dateCreated", "@type": "schema:Date" },
"dateModified": {"@id": "schema:dateModified", "@type": "schema:Date" },
"datePublished": {"@id": "schema:datePublished", "@type": "schema:Date" },
"description": { "@id": "schema:description"},
"downloadUrl": { "@id": "schema:downloadUrl", "@type": "@id"},
"email": { "@id": "schema:email"},
"editor": { "@id": "schema:editor"},
"encoding": { "@id": "schema:encoding"},
"endDate": { "@id": "schema:endDate"},
"familyName": { "@id": "schema:familyName"},
"fileFormat": { "@id": "schema:fileFormat"},
"fileSize": { "@id": "schema:fileSize"},
"funder": { "@id": "schema:funder"},
"funding": { "@id": "schema:funding"},
"givenName": { "@id": "schema:givenName"},
"hasPart": { "@id": "schema:hasPart" },
"identifier": { "@id": "schema:identifier"},
"installUrl": { "@id": "schema:installUrl", "@type": "@id"},
"isAccessibleForFree": { "@id": "schema:isAccessibleForFree"},
"isPartOf": { "@id": "schema:isPartOf", "@type": "@id"},
"keywords": { "@id": "schema:keywords"},
"license": { "@id": "schema:license", "@type": "@id"},
"maintainer": { "@id": "schema:maintainer" },
"memoryRequirements": { "@id": "schema:memoryRequirements"},
"name": { "@id": "schema:name"},
"operatingSystem": { "@id": "schema:operatingSystem"},
"permissions": { "@id": "schema:permissions"},
"processorRequirements": { "@id": "schema:processorRequirements"},
"producer": { "@id": "schema:producer"},
"programmingLanguage": { "@id": "schema:programmingLanguage"},
"provider": { "@id": "schema:provider"},
"publisher": { "@id": "schema:publisher"},
"relatedLink": { "@id": "schema:relatedLink", "@type": "@id"},
"review": { "@id": "schema:review", "@type": "@id" },
"reviewAspect": { "@id": "schema:reviewAspect" },
"reviewBody": { "@id": "schema:reviewBody" },
"releaseNotes": { "@id": "schema:releaseNotes"},
"roleName": { "@id": "schema:roleName"},
"runtimePlatform": { "@id": "schema:runtimePlatform"},
"sameAs": { "@id": "schema:sameAs", "@type": "@id"},
"softwareHelp": { "@id": "schema:softwareHelp"},
"softwareRequirements": { "@id": "schema:softwareRequirements"},
"softwareVersion": { "@id": "schema:softwareVersion"},
"sponsor": { "@id": "schema:sponsor"},
"startDate": { "@id": "schema:startDate"},
"storageRequirements": { "@id": "schema:storageRequirements"},
"supportingData": { "@id": "schema:supportingData"},
"targetProduct": { "@id": "schema:targetProduct"},
"url": { "@id": "schema:url"},
"version": { "@id": "schema:version"},
"author": { "@id": "schema:author", "@container": "@list" },
"alternateName": { "@id": "schema:alternateName" },
"featureList": { "@id": "schema:featureList"},
"creditText": { "@id": "schema:creditText" },
"archivedAt": { "@id": "schema:archivedAt", "@type": "@id" },
"continuousIntegration": { "@id": "codemeta:continuousIntegration", "@type": "@id"},
"buildInstructions": { "@id": "codemeta:buildInstructions", "@type": "@id"},
"developmentStatus": { "@id": "codemeta:developmentStatus", "@type": "@id"},
"embargoEndDate": { "@id":"codemeta:embargoEndDate", "@type": "schema:Date" },
"readme": { "@id":"codemeta:readme", "@type": "@id" },
"issueTracker": { "@id":"codemeta:issueTracker", "@type": "@id" },
"referencePublication": { "@id": "codemeta:referencePublication", "@type": "@id"},
"hasSourceCode": { "@id": "codemeta:hasSourceCode", "@type": "@id"},
"isSourceCodeOf": { "@id": "codemeta:isSourceCodeOf", "@type": "@id"}
},
"@graph": [
{
"@id": "codemeta:buildInstructions",
"@type": "rdf:Property",
"rdfs:comment": "A link to installation instructions or build documentation.",
"rdfs:label": "buildInstructions",
"schema:domainIncludes": [
{
"@id": "schema:SoftwareApplication"
},
{
"@id": "schema:SoftwareSourceCode"
}
],
"schema:rangeIncludes":
[
{
"@id": "schema:URL"
},
{
"@id": "schema:CreativeWork"
}
]
},
{
"@id": "codemeta:contIntegration",
"@type": "rdf:Property",
"rdfs:comment": "A link to continuous integration service.",
"rdfs:label": "contiIntegration",
"schema:domainIncludes": [
{
"@id": "schema:SoftwareApplication"
},
{
"@id": "schema:SoftwareSourceCode"
}
],
"schema:rangeIncludes": {
"@id": "schema:URL"
},
"schema:supersededBy": {
"@id": "codemeta:continuousIntegration"
}
},
{
"@id": "codemeta:continuousIntegration",
"@type": "rdf:Property",
"rdfs:comment": "A link to continuous integration service.",
"rdfs:label": "continuousIntegration",
"schema:domainIncludes": [
{
"@id": "schema:SoftwareApplication"
},
{
"@id": "schema:SoftwareSourceCode"
}
],
"schema:rangeIncludes": {
"@id": "schema:URL"
}
}
]
}
74 changes: 74 additions & 0 deletions crosswalks/GitLab.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Property,GitLab
codeRepository,web_url
programmingLanguage,/projects/:id/languages
review,
runtimePlatform,
targetProduct,
applicationCategory,
applicationSubCategory,
downloadUrl,
fileSize,
installUrl,
memoryRequirements,
operatingSystem,
permissions,permissions
processorRequirements,
releaseNotes,
softwareHelp,
softwareRequirements,
softwareVersion,/projects/:id/releases/:name
storageRequirements,
supportingData,
author,creator_id
citation,
contributor,/projects/:id/members/:id
copyrightHolder,
copyrightYear,
dateCreated,created_at
dateModified,updated_at
datePublished,
editor,
encoding,
fileFormat,
funder,
keywords,topics / tag_list
license,
producer,
provider,namespace.name
publisher,
sponsor,
version,
isAccessibleForFree,visibility
isPartOf,
hasPart,
position,
description,description
identifier,id
name,name
sameAs,
url,http_url_to_repo
relatedLink,wiki_enabled
givenName,/projects/:id/members/all/:id/name
familyName,/projects/:id/members/all/:id/name
email,/projects/:id/members/all/:id/public_email
affiliation,
identifier,/projects/:id/members/all/:id
name,/projects/:id/members/all/:id/username / /projects/:id/members/all/:id/name
address,/projects/:id/members/all/:id/web_url
reviewAspect,
reviewBody,
endDate,/projects/:id/members/all/:id/expires_at
roleName,
startDate,/projects/:id/members/all/:id/created_at
softwareSuggestions,
maintainer,
continuousIntegration,
buildInstructions,ci_config_path
developmentStatus,archived
embargoEndDate,
funding,
issueTracker,_links.issues / web_url/-/issues
referencePublication,
readme,readme_url
hasSourceCode,
isSourceCodeOf,
29 changes: 11 additions & 18 deletions scripts/aggregate.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/usr/bin/env python3
import os
import csv
from pathlib import Path

REPO_DIR = os.path.join(os.path.dirname(__file__), '..')

PROP_DESC_PATH = os.path.join(REPO_DIR, 'properties_description.csv')
REPO_DIR = Path(__file__).parent.parent


PROP_DESC_PATH = REPO_DIR / "properties_description.csv"
"""The CSV file where the leftmost columns of the aggregate crosswalk table
are (parent type, property name, type, and description."""

SOURCE_DIR = os.path.join(REPO_DIR, 'crosswalks')
SOURCE_DIR = REPO_DIR / "crosswalks"
"""The directories where all other .csv files are."""

DEST_FILENAME = os.path.join(REPO_DIR, 'crosswalk.csv')
DEST_FILENAME = REPO_DIR / "crosswalk.csv"
"""The path/name of the file where the aggregate crosswalk table is
written."""

Expand Down Expand Up @@ -39,7 +40,7 @@ def read_terms(prop_desc, filename):
in properties_description.csv."""

# Read rows from a translation table in crosswalks.
with open(os.path.join(SOURCE_DIR, filename)) as fd:
with open(SOURCE_DIR / filename) as fd:
rows = list(csv.reader(fd))

# Split the two rows of the translation table.
Expand All @@ -54,7 +55,7 @@ def read_terms(prop_desc, filename):
def list_crosswalks():
"""Returns the list of crosswalk files by auto-discovering them from the
crosswalk/ directory."""
return sorted(os.listdir(SOURCE_DIR))
return sorted(SOURCE_DIR.glob("*.csv"))

def aggregate():
"""Get all columns from properties_description.csv and files in
Expand All @@ -67,22 +68,14 @@ def aggregate():
# Get the other columns, one per .csv file in crosswalks/
columns = []
for filename in list_crosswalks():
if filename.endswith('.csv'):
columns.append(read_terms(prop_desc, filename))
columns.append(read_terms(prop_desc, filename))

return prop_desc + columns

def rm_file(filename):
"""Removes a file if it exists, does nothing otherwise."""
try:
os.unlink(filename)
except FileNotFoundError:
pass

def write_aggregate(aggregate_columns):
"""Writes the aggregated crosswalk table."""
rows = rows_from_columns(aggregate_columns)
rm_file(DEST_FILENAME)
DEST_FILENAME.unlink(missing_ok=True)
with open(DEST_FILENAME, 'a') as fd:
writer = csv.writer(fd, lineterminator='\n')
writer.writerows(rows)
Expand Down
27 changes: 9 additions & 18 deletions scripts/split.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
#!/usr/bin/env python3

import os
import csv
from pprint import pprint
from pathlib import Path


REPO_DIR = Path(__file__).parent.parent

REPO_DIR = os.path.join(os.path.dirname(__file__), '..')

PROP_DESC_PATH = os.path.join(REPO_DIR, 'properties_description.csv')
PROP_DESC_PATH = REPO_DIR / "properties_description.csv"
"""The CSV file where the leftmost columns of the aggregate crosswalk table
are (parent type, property name, type, and description."""

SOURCE_DIR = os.path.join(REPO_DIR, 'crosswalks')
SOURCE_DIR = REPO_DIR / "crosswalks"
"""The directories where all other .csv files are."""

CROSSWALK_PATH = os.path.join(REPO_DIR, 'crosswalk.csv')
CROSSWALK_PATH = REPO_DIR / "crosswalk.csv"
"""The path/name of the file where the aggregate crosswalk table is
written."""


def rm_file(filename):
"""Removes a file if it exists, does nothing otherwise."""
try:
os.unlink(filename)
except FileNotFoundError:
pass

with open(CROSSWALK_PATH) as fd:
reader = csv.reader(fd)
lines = list(reader)
cols = list(zip(*lines))
props = cols[1]
for col in cols[4:]:
col_name = col[0]
filename = os.path.join(SOURCE_DIR, col_name + '.csv')
rm_file(filename)
filename = SOURCE_DIR / f"{col_name}.csv"
filename.unlink(missing_ok=True)
with open(filename, 'a') as fd:
writer = csv.writer(fd)
for (prop, trans) in zip(props, col):
writer.writerow((prop, trans))

rm_file(PROP_DESC_PATH)
PROP_DESC_PATH.unlink(missing_ok=True)
with open(PROP_DESC_PATH, 'a') as fd:
writer = csv.writer(fd, lineterminator='\n')
prop_desc = zip(*cols[0:4])
Expand Down