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

Cannot add a role to a contributor #53

Closed
progval opened this issue Jul 15, 2024 · 7 comments
Closed

Cannot add a role to a contributor #53

progval opened this issue Jul 15, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@progval
Copy link
Member

progval commented Jul 15, 2024

When adding a role to a contributor (not an author), I get the error Unknown field "contributor" in "contributor".

cc @hjonin

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

hjonin commented Jul 15, 2024

It is linked to the latest modification; we have to add a contributor property to the roleFieldValidators. However, it means that it does not check if the role is associated to an author (in which case it should be schema:author to be validated) or a contributor (then contributor). Is it still OK with you?

@progval
Copy link
Member Author

progval commented Jul 15, 2024

good catch, thanks.

we should check the properties match eventually, but for now let's only change it so it passes. Could you do it?

hjonin added a commit to hjonin/codemeta-generator that referenced this issue Jul 15, 2024
@megasanjay
Copy link

Adding a reply to this. Should the correct syntax be the following in this instance?

 "author": [
        {
            "id": "_:author_1",
            "type": "Person",
            "givenName": "test"
        },
        {
            "type": "schema:Role",
            "schema:author": "_:author_1",
            "schema:roleName": "test",
            "schema:startDate": "2024-08-15"
        }
    ],
    "contributor": [
        {
            "id": "_:contributor_1",
            "type": "Person",
            "givenName": "Test 2"
        },
        {
            "type": "schema:Role",
            "schema:contributor": "_:contributor_1",
            "schema:roleName": "Test3"
        }
    ]

@progval progval closed this as completed in 83ba935 Aug 5, 2024
@progval
Copy link
Member Author

progval commented Aug 5, 2024

contributor instead of schema:contributor, but that's correct too

@megasanjay
Copy link

@progval so both are valid?

 "contributor": [
        {
            "id": "_:contributor_1",
            "type": "Person",
            "givenName": "Test 2"
        },
        {
            "type": "schema:Role",
            "schema:contributor": "_:contributor_1",
            "schema:roleName": "Test3"
        }
    ],

 "contributor": [
        {
            "id": "_:contributor_1",
            "type": "Person",
            "givenName": "Test 2"
        },
        {
            "type": "schema:Role",
            "contributor": "_:contributor_1",
            "schema:roleName": "Test3"
        }
    ]

@progval
Copy link
Member Author

progval commented Aug 5, 2024

yes, both are semantically equivalent

@megasanjay
Copy link

yes, both are semantically equivalent

Gotcha. It's just that the validator was failing on them. I guess we shall need to wait for an update to the generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants