Utility scripts for EPO OPS client library development.
Fixes broken XSD import paths in resources/ops.xsd.
Problem: The original ops.xsd file from EPO contains broken import paths from their internal build system:
schemaLocation="../../../../wars/levelx/target/webapp/schema/CPCSchema.xsd"
schemaLocation="../../../../wars/levelx/target/webapp/schema/CPCDefinitions.xsd"Solution: Replaces them with local relative paths:
schemaLocation="CPCSchema.xsd"
schemaLocation="CPCDefinitions.xsd"Usage:
./scripts/fix-xsd-paths.shCreates backup at resources/ops.xsd.backup before making changes.
When to use:
- After downloading updated XSD schemas from EPO
- When importing new versions of ops.xsd
- To fix schema validation errors
Converts EPO OPS Swagger 2.0 specification to OpenAPI 3.0 format.
What it does:
- Converts
resources/ops.yaml(Swagger 2.0) toopenapi.yaml(OpenAPI 3.0) - Fixes OAuth2 flow:
authorizationCode->clientCredentials - Removes invalid
format: stringfrom boolean parameters - Adds missing usage stats endpoint from official OPS v3.2 documentation (EPO forgot to include it in swagger)
Usage:
./scripts/convert-openapi.shRequires npx (comes with Node.js).
When to use:
- After EPO releases updated API specification
- When regenerating code from OpenAPI spec
- One-time setup (already executed)
All XSD files in resources/ are needed and referenced by ops.xsd:
| File | Purpose | Size |
|---|---|---|
ops.xsd |
Main OPS schema (master) | 30 KB |
exchange-documents.xsd |
Bibliographic data | 444 KB |
fulltext-documents.xsd |
Claims, description, abstract | 34 KB |
ops_legal.xsd |
Legal status data | 13 KB |
CPCSchema.xsd |
CPC classification export | 15 KB |
CPCDefinitions.xsd |
CPC definitions | 12 KB |
ccd.xsd |
Common Citation Document | 12 KB |
rplus.xsd |
Register Plus service | 118 KB |
Total: ~680 KB (embedded in compiled library via //go:embed)
Even though only 5 XSDs are currently embedded in xml.go, all 8 files form a complete schema chain:
ops.xsd (master)
+-- imports: exchange-documents.xsd
+-- imports: fulltext-documents.xsd
+-- imports: CPCSchema.xsd
+-- imports: CPCDefinitions.xsd
+-- imports: rplus.xsd
+-- imports: ccd.xsd
+-- includes: ops_legal.xsd
Users who need full XML validation require all schemas in the chain.
Large documentation files are kept in resources/ for reference but should be linked online in README:
14.11_user_documentation_3.1_en.pdf(65 KB) - Legacy docsen-ops-v3.2-documentation-version-1.3.20.pdf(4.7 MB) - Current API docsCPC_International_documentation_and_sample_package.zip(17 KB) - Sample data
These are not embedded in the library and can be deleted if you prefer to reference online documentation.