swh.indexer.metadata_dictionary.nuget module#

class swh.indexer.metadata_dictionary.nuget.NuGetMapping(log_suffix='')[source]#

Bases: XmlMapping, SingleFileIntrinsicMapping

dedicated class for NuGet (.nuspec) mapping and translation

name = 'nuget'#
filename: bytes | Pattern[bytes] = re.compile(b'.*\\.nuspec')#
mapping = {'authors': rdflib.term.URIRef('http://schema.org/author'), 'copyright': rdflib.term.URIRef('http://schema.org/copyrightNotice'), 'description': rdflib.term.URIRef('http://schema.org/description'), 'id': rdflib.term.URIRef('http://schema.org/identifier'), 'language': rdflib.term.URIRef('http://schema.org/inLanguage'), 'license': rdflib.term.URIRef('http://schema.org/license'), 'licenseUrl': rdflib.term.URIRef('http://schema.org/license'), 'name': rdflib.term.URIRef('http://schema.org/name'), 'projectUrl': rdflib.term.URIRef('http://schema.org/url'), 'releaseNotes': rdflib.term.URIRef('http://schema.org/releaseNotes'), 'repository.url': rdflib.term.URIRef('http://schema.org/codeRepository'), 'summary': rdflib.term.URIRef('http://schema.org/description'), 'tags': rdflib.term.URIRef('http://schema.org/keywords'), 'version': rdflib.term.URIRef('http://schema.org/version')}#
string_fields: List[str] = ['description', 'version', 'name', 'tags', 'license', 'summary', 'copyright', 'language']#

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

uri_fields: List[str] = ['projectUrl', 'licenseUrl']#

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

translate_repository(graph, root, v)[source]#
normalize_license(v)[source]#
translate_authors(graph: Graph, root, s)[source]#
translate_releaseNotes(graph: Graph, root, s)[source]#
normalize_tags(s)[source]#