Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-codemeta contexts introducing their own terms for Codemeta/schema.org properties #44

Open
progval opened this issue May 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@progval
Copy link
Member

progval commented May 7, 2024

For example:

{
    "@context": [
        "https://w3id.org/codemeta/3.0",
        {"alias_of_name": "name"}
    ],
    "type": "SoftwareSourceCode",
    "alias_of_name": "My Software"
}

is equivalent to

{
    "@context": "https://w3id.org/codemeta/3.0",
    "type": "SoftwareSourceCode",
    "name": "My Software"
}

but is rejected because we unconditionally substitute the context with our own before validating

@progval progval added the bug Something isn't working label May 7, 2024
@hjonin
Copy link
Contributor

hjonin commented May 8, 2024

We currently yet do not substitute the context before validating:

https://github.com/codemeta/codemeta-generator/blob/9bf79ad784a0e7b99be3c7ced5f7b6f8d8e7ace3/js/validation/index.js#L82C19-L82C35

Tested with revision 83e6919, we already got the error message:

@context must be "https://doi.org/10.5063/schema/codemeta-2.0", not ["https://w3id.org/codemeta/3.0",{"alias_of_name":"name"}]

What is the expected behavior in this case?

@progval
Copy link
Member Author

progval commented May 8, 2024

We currently yet do not substitute the context before validating:

I meant when importing

Tested with revision 83e6919, we already got the error message:

On the current version, I get Unknown field "alias_of_name".. The expected behavior is that it should be considered valid and be imported like

{
    "@context": "https://w3id.org/codemeta/3.0",
    "type": "SoftwareSourceCode",
    "name": "My Software"
}

@hjonin
Copy link
Contributor

hjonin commented May 8, 2024

On the current version, I get Unknown field "alias_of_name"..

Yes, it is already this behavior I'm getting with even an older revision (c1bce7d, if we comment out

setError(`@context must be "https://doi.org/10.5063/schema/codemeta-2.0", not ${JSON.stringify(context)}`);
so we don't get the @context error).

Screenshot from 2024-05-08 15-27-41

This issue might be recategorized as enhancement (as it is not a regression) and the reason to work on in the description updated.

@progval progval added enhancement New feature or request and removed bug Something isn't working labels May 8, 2024
@progval progval changed the title Non-codemeta contexts introducing their own terms for Codemeta/schema.org properties are not supported Add support for non-codemeta contexts introducing their own terms for Codemeta/schema.org properties May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants