swh.indexer.metadata_dictionary.cff module#

class swh.indexer.metadata_dictionary.cff.CffMapping(log_suffix='')[source]#

Bases: YamlMapping, SingleFileIntrinsicMapping

Dedicated class for Citation (CITATION.cff) mapping and translation

name = 'cff'#
filename: bytes | Pattern[bytes] = b'CITATION.cff'#
mapping = {'abstract': rdflib.term.URIRef('http://schema.org/description'), 'authors': rdflib.term.URIRef('http://schema.org/author'), 'date-released': rdflib.term.URIRef('http://schema.org/datePublished'), 'doi': rdflib.term.URIRef('http://schema.org/identifier'), 'entity.address + entity.city + entity.region + entity.post-code + entity.country': rdflib.term.URIRef('http://schema.org/address'), 'entity.email': rdflib.term.URIRef('http://schema.org/email'), 'entity.name': rdflib.term.URIRef('http://schema.org/name'), 'entity.orcid': rdflib.term.URIRef('http://schema.org/identifier'), 'keywords': rdflib.term.URIRef('http://schema.org/keywords'), 'license': rdflib.term.URIRef('http://schema.org/license'), 'license-url': rdflib.term.URIRef('http://schema.org/license'), 'person.address + person.city + person.region + person.post-code + person.country': rdflib.term.URIRef('http://schema.org/address'), 'person.affiliation': rdflib.term.URIRef('http://schema.org/affiliation'), 'person.email': rdflib.term.URIRef('http://schema.org/email'), 'person.given-names': rdflib.term.URIRef('http://schema.org/givenName'), 'person.name-particle + person.family-names + person.name-suffix': rdflib.term.URIRef('http://schema.org/familyName'), 'person.orcid': rdflib.term.URIRef('http://schema.org/identifier'), 'reference.type': rdflib.term.URIRef('@type'), 'references': rdflib.term.URIRef('https://codemeta.github.io/terms/referencePublication'), 'repository': rdflib.term.URIRef('https://codemeta.github.io/terms/issueTracker'), 'repository-artifact': rdflib.term.URIRef('http://schema.org/downloadUrl'), 'repository-code': rdflib.term.URIRef('http://schema.org/codeRepository'), 'title': rdflib.term.URIRef('http://schema.org/name'), 'url': rdflib.term.URIRef('http://schema.org/url'), 'version': rdflib.term.URIRef('http://schema.org/version')}#
string_fields: List[str] = ['keywords', 'license', 'abstract', 'version', 'doi']#

List of fields that are simple strings, and don’t need any normalization.

date_fields: List[str] = ['date-released']#

//schema.org/Date

Type:

List of fields that are strings that should be typed as http

uri_fields: List[str] = ['repository-code']#

List of fields that are simple URIs, and don’t need any normalization.

translate_authors(graph: Graph, root: URIRef, authors: List[dict]) None[source]#
normalize_doi(s: str) URIRef[source]#
normalize_license(s: str) URIRef[source]#