{"id":20650953,"url":"https://github.com/niklr/oaipmhnet","last_synced_at":"2025-04-17T12:43:33.898Z","repository":{"id":84678160,"uuid":"140689938","full_name":"niklr/OaiPmhNet","owner":"niklr","description":"OaiPmhNet is a .NET library implementing the OAI-PMH specification.","archived":false,"fork":false,"pushed_at":"2019-10-26T07:46:49.000Z","size":49,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T17:50:46.750Z","etag":null,"topics":["oai-pmh","oai-pmh-provider","oai-pmh-repository","oai-pmh-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niklr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-12T09:13:36.000Z","updated_at":"2023-04-14T06:17:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"afb4259a-ca26-46db-b030-411cb17282a5","html_url":"https://github.com/niklr/OaiPmhNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklr%2FOaiPmhNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklr%2FOaiPmhNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklr%2FOaiPmhNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklr%2FOaiPmhNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklr","download_url":"https://codeload.github.com/niklr/OaiPmhNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249342162,"owners_count":21254235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oai-pmh","oai-pmh-provider","oai-pmh-repository","oai-pmh-server"],"created_at":"2024-11-16T17:24:39.822Z","updated_at":"2025-04-17T12:43:33.892Z","avatar_url":"https://github.com/niklr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"OaiPmhNet\n=========\n\nOaiPmhNet is a .NET library implementing the OAI-PMH specification. \nThe Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH) is a low-barrier mechanism for repository interoperability. \nData Providers are repositories that expose structured metadata via OAI-PMH. \nService Providers then make OAI-PMH service requests to harvest that metadata. \nOAI-PMH is a set of six verbs or services that are invoked within HTTP.\n\n[http://www.openarchives.org/pmh/](http://www.openarchives.org/pmh/)\n\n### Dependencies:\n* [NETStandard.Library 2.0.1](https://www.nuget.org/packages/NETStandard.Library/2.0.1)\n\n## Implementation steps\n\nThe OaiPmhNet library can be customized to work with arbitrary data repositories by implementing 3 interfaces. \nA demonstration implementation can be found in the unit test project.\n\n### 1. Implement IRecordRepository interface\n```csharp\npublic interface IRecordRepository\n{\n\tRecord GetRecord(string identifier, string metadataPrefix);\n\tRecordContainer GetRecords(ArgumentContainer arguments, IResumptionToken resumptionToken = null);\n\tRecordContainer GetIdentifiers(ArgumentContainer arguments, IResumptionToken resumptionToken = null);\n}\n```\n\n### 2. Implement IMetadataFormatRepository interface\n```csharp\npublic interface IMetadataFormatRepository\n{\n\tMetadataFormat GetMetadataFormat(string prefix);\n\tIEnumerable\u003cMetadataFormat\u003e GetMetadataFormats();\n}\n```\n\n### 3. Implement ISetRepository interface\n```csharp\npublic interface ISetRepository\n{\n\tSetContainer GetSets(ArgumentContainer arguments, IResumptionToken resumptionToken = null);\n}\n```\n\n### 4. Override default configuration (example)\n```csharp\nvar config = OaiConfiguration.Instance;\n\nconfig.RepositoryName = constants.APPLICATION_NAME;\nconfig.BaseUrl = () =\u003e\n{\n\tUri baseUri = new Uri(UrlHelper.BaseSiteUri, \"oai2\");\n\treturn baseUri.AbsoluteUri;\n};\nconfig.DeletedRecord = \"transient\";\nconfig.AdminEmails = new string[] { constants.SUPPORT_EMAIL };\nconfig.ResumptionTokenCustomParameterNames.Add(\"offset\");\n```\n\n### 5. Initialize the DataProvider class\n```csharp\nDataProvider provider = new DataProvider(config, metadataFormatRepository, recordRepository, setRepository);\n```\n\n### 6. Pass ArgumentContainer to DataProvider\n```csharp\nArgumentContainer arguments = new ArgumentContainer(verb, metadataPrefix, resumptionToken, identifier, from, until, set);\nXDocument document = provider.ToXDocument(DateTime.Now, arguments);\n```\n\n### 7. (Optional) Convert response to XHTML using XSLT\n```csharp\ndocument?.Root?.AddBeforeSelf(new XProcessingInstruction(\"xml-stylesheet\", \"type='text/xsl' href='/Content/xsl/oai2.xsl'\"));\nreturn this.Content(provider.ToString(document), \"application/xml\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklr%2Foaipmhnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklr%2Foaipmhnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklr%2Foaipmhnet/lists"}