Skip to content

Conversation

@mkovalua
Copy link
Contributor

@mkovalua mkovalua commented Feb 11, 2026

Ticket

Purpose

We currently use DataCite URI/terminology to refer to an object’s type (e.g. AudioVisual, Book, BookChapter, etc). FAIR Signposting expects these object types to be represented using schema.org terms/URIs. We will need to a mapping to convert between DataCite and schema.org when we get the linkset doc for a given object.

For projects, registrations, and preprints, if a user has specified a resourceType using the DataCite resource type terminology (AudioVisual, Book, BookChapter), then we should use that and map it to an appropriate schema.org URI. Otherwise, we should just the OSF object type (Project, Registration, Preprint) and map that to an appropriate schema.org URI. Projects, registrations, and preprints should have a second type link: “Provide a second link that has as target https://schema.org/AboutPage in the common case where an actual landing page is concerned” from FAIR Signposting Profile - Signposting the Scholarly Web

Changes

Implementing mapping for datacite to scheme

(created from the following one linkset related PR #11571 to keep its changings )

image

Side Effects

QE Notes

CE Notes

Documentation

…eed tests updates and maybe some type yield logic )
@mkovalua mkovalua marked this pull request as draft February 11, 2026 14:25
@mkovalua mkovalua changed the base branch from develop to feature/fair-signposting February 12, 2026 15:00
@mkovalua mkovalua marked this pull request as ready for review February 12, 2026 15:00
Copy link
Contributor

@aaxelb aaxelb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! two suggestions

Comment on lines 69 to 70
yield SignpostLink(focus_iri, 'type', f'https://schema.org/{schema_type}')
yield SignpostLink(focus_iri, 'type', 'https://schema.org/AboutPage')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're using it this much, may as well add a namespace to osf.metadata.rdfutils like SDO = rdflib.Namespace('https://schema.org/')

and replace all the hard-coded "https://sche.../foo"" with SDO.foo

}


RESOURCE_SCHEMA_RESOURCE_TYPE_GENERAL_MAPPING = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like these two mappings could be combined into one (their keys won't collide, thanks iri namespaces)

then could skip the branch on _type_iri.startswith(DATACITE), handle all the same way

@mkovalua mkovalua requested a review from aaxelb February 12, 2026 18:09
)

def map_resource_type_general_datacite_to_scheme(_type_iri: rdflib.URIRef, resource_rdftype: rdflib.URIRef) -> str:
return DATACITE_SCHEMA_RESOURCE_TYPE_GENERAL_MAPPING.get(_type_iri) or DATACITE_SCHEMA_RESOURCE_TYPE_GENERAL_MAPPING.get(resource_rdftype, 'Text')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the default value to a constant (and make it a full iri to match my other suggestion)

DEFAULT_SCHEMADOTORG_RESOURCE_TYPE = SCHEMA.CreativeWork

(CreativeWork seems a more sensical default than Text, but either way, as long as it's clearly defined in one place)



DATACITE_SCHEMA_RESOURCE_TYPE_GENERAL_MAPPING = {
DATACITE.Audiovisual: 'MediaObject',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may as well use the namespace you added, then can avoid all the manual f"https://schema.org/{...}"

    DATACITE.Audiovisual: SCHEMA.MediaObject,
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants