dpmaconnect

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

DPMA Connect Plus Go Client

CI Go Reference Go Report Card

A Go client for the German Patent and Trade Mark Office (DPMA) Connect Plus REST API (DPMAregister web services), covering German patent, design, and trademark data over HTTP Basic authentication.

Overview

  • Three services - patents and utility models, designs, and trademarks, selected with the dpma.ServicePatent, dpma.ServiceDesign, and dpma.ServiceTrademark constants.
  • Expert search - SearchPatents, SearchDesigns, SearchTrademarks using DPMAregister expert search syntax, with optional client-side query validation.
  • Register data - register info by number, register extracts, and searchable full text.
  • Bulk and single downloads - weekly XML/PDF bulk archives, single publication PDFs, and design/trademark images.
  • Streaming variants - every bulk and register-extract method has a *Stream variant that writes to an io.Writer without buffering the whole response.
  • Typed errors - NotFoundError, DataNotAvailableError, APIError, and XMLParseError for errors.As handling.

Installation

go get github.com/patent-dev/dpma-connect-plus

Getting access

DPMAconnectPlus is a contractual data-supply service. The DPMA issues an HTTP Basic username and password after a signed standard agreement is in place; there is no self-service web portal. A one-time connection fee applies (200 EUR at time of writing); data retrieval itself is free.

  1. Review the service and terms on the DPMAconnectPlus page.

  2. Complete the standard agreement (Standardvertrag DPMAconnectPlus) including the purpose-of-use paragraph, and send two signed originals to Deutsches Patent- und Markenamt, Referat 2.1.2 - Kundenservice Datenabgabe, 80297 München, Germany.

  3. The DPMA creates an account with a username and a password of your choice.

  4. Export the credentials for the client and demo:

    export DPMA_CONNECT_PLUS_USERNAME=your-username
    export DPMA_CONNECT_PLUS_PASSWORD=your-password
    

Quick start

package main

import (
    "context"
    "fmt"
    "log"

    dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
    client, err := dpma.NewClient(&dpma.Config{
        Username: "your-dpma-username",
        Password: "your-dpma-password",
    })
    if err != nil {
        log.Fatal(err)
    }

    ctx := context.Background()

    // Get service version
    version, err := client.GetVersion(ctx, dpma.ServicePatent)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Version: %s\n", version)

    // Validate query before sending (optional but recommended)
    if err := dpma.ValidatePatentQuery("TI=Elektrofahrzeug"); err != nil {
        log.Fatal(err)
    }

    // Search patents (uses DPMAregister expert search syntax)
    results, err := client.SearchPatents(ctx, "TI=Elektrofahrzeug")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Results: %d bytes\n", len(results))
}

Usage

All methods accept context.Context for timeout and cancellation support.

Configuration
config := &dpma.Config{
    Username: "your-username",                                    // Required
    Password: "your-password",                                    // Required
    BaseURL:  "https://dpmaconnect.dpma.de/dpmaws/rest-services", // Default
    Timeout:  20 * time.Minute,                                   // Default: 20 minutes
    HTTPClient: myCustomHTTPClient,                               // Optional: your own *http.Client
}

client, err := dpma.NewClient(config)

If HTTPClient is set, Timeout is ignored and the custom client's timeout applies instead.

Common operations
// Get service version
GetVersion(ctx, service string) (string, error)

Use the service constants: dpma.ServicePatent, dpma.ServiceDesign, dpma.ServiceTrademark.

Query validation
// Validate a query against service-specific field codes (returns nil or error)
ValidatePatentQuery(query string) error
ValidateDesignQuery(query string) error
ValidateTrademarkQuery(query string) error

For advanced usage (tokenization, field inspection), use the query sub-package directly:

import "github.com/patent-dev/dpma-connect-plus/query"

// Parse and validate a patent query
q, err := query.ParseQuery("TI=Elektrofahrzeug AND INH=Siemens", query.ServicePatent)
if err != nil {
    log.Fatal(err)
}
if err := q.Validate(); err != nil {
    log.Fatal(err) // e.g. unknown field, unmatched parentheses
}

// Inspect the query
fmt.Println(q.GetFields())    // ["TI", "INH"]
fmt.Println(q.HasField("TI")) // true

// Look up field definitions
f, ok := query.GetField("TI", query.ServicePatent)
fmt.Println(f.Description) // "title / designation"

// List all valid fields for a service
fields := query.GetValidFields(query.ServiceDesign)

The parser supports quoted values, comparison operators (=, >=, <=, >, <), parentheses and curly braces (procedure data), bracket/brace matching, and both English (AND, OR, NOT) and German (UND, ODER, NICHT) Boolean operators. Field validation is per service, based on the official DPMAregister field codes.

Patent service
// Search patents and utility models
SearchPatents(ctx, query string) ([]byte, error)

// Get patent info by registered number
GetPatentInfo(ctx, registeredNumber string) ([]byte, error)

// Parsed register record. GetPatentInfoParsed takes a registered number
// ("100273629", "E247834666" for an EP file) or a publication number
// ("DE10027362C2", "EP4780303A1"), resolving the latter by one search and one
// fetch. GetPatentInfoByRegisteredNumber fetches a number exactly as a search
// hit reported it (e.g. "CN2019089592" for a PCT application).
GetPatentInfoParsed(ctx, patentNumber string) (*PatentInfo, error)
GetPatentInfoByPublicationNumber(ctx, publicationNumber string) (*PatentInfo, error)
GetPatentInfoByRegisteredNumber(ctx, registeredNumber string) (*PatentInfo, error)

// Get searchable full text for a document
GetSearchableFullText(ctx, documentID string) ([]byte, error)

// Download single patent publication PDF
GetPatentPublicationPDF(ctx, documentID string) ([]byte, error)

// Weekly bulk downloads (XML)
GetDisclosureDocumentsXML(ctx, year, week int) ([]byte, error)
GetPatentSpecificationsXML(ctx, year, week int) ([]byte, error)
GetUtilityModelsXML(ctx, year, week int) ([]byte, error)
GetPublicationDataXML(ctx, year, week int) ([]byte, error)
GetApplicantCitationsXML(ctx, year, week int) ([]byte, error)
GetEuropeanPatentSpecificationsXML(ctx, year, week int) ([]byte, error)

// Weekly bulk downloads (PDF)
GetDisclosureDocumentsPDF(ctx, year, week int) ([]byte, error)
GetPatentSpecificationsPDF(ctx, year, week int) ([]byte, error)
GetEuropeanPatentSpecificationsPDF(ctx, year, week int) ([]byte, error)
GetUtilityModelsPDF(ctx, year, week int) ([]byte, error)

// Register extract
GetPatentRegisterExtract(ctx, date time.Time, period string) ([]byte, error)
Design service
// Search designs
SearchDesigns(ctx, query string) ([]byte, error)

// Get design info by design number
GetDesignInfo(ctx, designNumber string) ([]byte, error)

// Get design image/thumbnail
GetDesignImage(ctx, designNumber, imageNumber string) ([]byte, error)
GetDesignThumbnail(ctx, designNumber, thumbnailNumber string) ([]byte, error)

// Weekly bulk downloads
GetDesignBibliographicDataXML(ctx, year, week int) ([]byte, error)
GetDesignImages(ctx, year, week int) ([]byte, error)

// Register extract
GetDesignRegisterExtract(ctx, date time.Time, period string) ([]byte, error)
Trademark service
// Search trademarks
SearchTrademarks(ctx, query string) ([]byte, error)

// Get trademark info by application number
GetTrademarkInfo(ctx, applicationNumber string) ([]byte, error)

// Get trademark image/thumbnail
GetTrademarkImage(ctx, applicationNumber string) ([]byte, error)
GetTrademarkThumbnail(ctx, applicationNumber string) ([]byte, error)

// Weekly bulk downloads
GetTrademarkBibDataApplied(ctx, year, week int) ([]byte, error)
GetTrademarkBibDataRegistered(ctx, year, week int) ([]byte, error)
GetTrademarkBibDataRejected(ctx, year, week int) ([]byte, error)

// Register extract
GetTrademarkRegisterExtract(ctx, date time.Time, period string) ([]byte, error)
Streaming downloads (memory-efficient)

Every bulk download and register extract method has a *Stream variant that writes to an io.Writer:

file, err := os.Create("patents_202445.zip")
if err != nil {
    log.Fatal(err)
}
defer file.Close()

err = client.GetPatentSpecificationsXMLStream(ctx, 2024, 45, file)
if err != nil {
    log.Fatal(err)
}

The full set of *Stream methods mirrors the buffered bulk and register-extract methods above (GetDisclosureDocumentsXMLStream, GetDesignImagesStream, GetTrademarkRegisterExtractStream, and so on).

Search query syntax

All search methods use DPMAregister expert search syntax. The format is FIELD=value with Boolean operators AND/UND, OR/ODER, NOT/NICHT (English and German are both accepted), comparison operators (=, >=, <=, >, <), wildcards (? any chars, ! one char, # one or no char), quoted values, and parentheses. Procedure-data fields are written inside curly braces, for example {VST=pub-offenlegungsschrift UND VSTT=05.01.2011}.

The query subpackage parses and validates queries against per-service field definitions (see Query validation). Each service supports a different set of field codes.

Full query syntax: SEARCH-SYNTAX.md.

The official DPMAregister help pages list every field code per service:

Date and week formatting

Publication weeks use YYYYWW format (6 digits); register extracts use YYYY-MM-DD:

pubWeek, err := dpma.FormatPublicationWeek(2024, 45) // "202445", nil
year, week, err := dpma.ParsePublicationWeek("202445") // 2024, 45, nil

date := time.Date(2024, 10, 23, 0, 0, 0, 0, time.UTC)
dateStr := dpma.FormatDate(date) // "2024-10-23"
Data availability
  • Publication data is updated weekly: patents/utility models on Thursdays, designs/trademarks on Fridays.
  • Register data is updated daily.

DataNotAvailableError is common for future publication weeks, very old weeks (before digital archiving), and weeks with no publications.

Error handling

The library returns typed errors you can match with errors.As:

// Resource not found (404)
var notFoundErr *dpma.NotFoundError
if errors.As(err, &notFoundErr) {
    fmt.Printf("not found: %s %s\n", notFoundErr.Resource, notFoundErr.ID)
}

// Data not available (common for old/future publication weeks)
var dataErr *dpma.DataNotAvailableError
if errors.As(err, &dataErr) {
    fmt.Println("data not available for the requested period")
}

// Generic API errors
var apiErr *dpma.APIError
if errors.As(err, &apiErr) {
    fmt.Printf("API error: %s (code: %s, HTTP %d)\n", apiErr.Message, apiErr.Code, apiErr.StatusCode)
}

// XML parsing failures (malformed response data)
var xmlErr *dpma.XMLParseError
if errors.As(err, &xmlErr) {
    fmt.Printf("failed to parse response in %s: %v\n", xmlErr.Operation, xmlErr.Unwrap())
}

Testing

make test              # unit tests (race), mock HTTP server
make test-integration  # integration tests (//go:build integration), needs credentials
make lint

Integration tests hit the live DPMA API and skip unless credentials are set:

export DPMA_CONNECT_PLUS_USERNAME=your-username
export DPMA_CONNECT_PLUS_PASSWORD=your-password
make test-integration

An interactive demo application is included under demo/; it reads the same environment variables and offers a menu for the patent, design, and trademark services.

Implementation status

Every endpoint of the DPMA Connect Plus API is implemented across the patent, design, and trademark services (see the Usage method lists). How much of that surface a given account can exercise depends on the permissions DPMA grants it.

A subset is covered by the integration test suite and verified against the live API, including GetVersion, the three Search* methods (and their *Parsed variants), GetPatentInfo / GetDesignInfo / GetTrademarkInfo, GetPatentRegisterExtract, GetPatentPublicationPDF, GetDisclosureDocumentsXML, and GetDesignBibliographicDataXML.

The remaining bulk endpoints (for example GetPublicationDataXML, GetApplicantCitationsXML, GetDesignImages, and the GetTrademarkBibData* methods) are implemented but require permissions the test account does not currently hold, so they are not yet exercised end to end.

Development

Regenerate the typed client when the OpenAPI spec (openapi.yaml) changes:

make generate

This re-applies any local OpenAPI fixes and runs go generate ./..., which drives oapi-codegen to rewrite generated/types_gen.go and generated/client_gen.go. Do not edit the files under generated/ by hand.

Other common targets:

make fmt     # gofmt
make lint    # golangci-lint
make tidy    # go mod tidy

Part of the patent.dev open-source patent data ecosystem:

  • epo-ops - EPO Open Patent Services client (bibliographic, full text, families, legal status, images)
  • epo-bdds - EPO Bulk Data Distribution Service client (DOCDB, INPADOC, EP full text)
  • uspto-odp - USPTO Open Data Portal client (patents, PTAB, TSDR, full text)

The bulk-file-loader uses these libraries for automated patent data downloads.

License

MIT - Funktionslust GmbH / patent.dev.

Documentation

Overview

Package dpmaconnect provides a Go client for the DPMA Connect Plus API (DPMAregister web services) for accessing German patent, design, and trademark data from the German Patent and Trade Mark Office (DPMA).

Usage:

config := dpmaconnect.DefaultConfig()
config.Username = "your-username"
config.Password = "your-password"
client, err := dpmaconnect.NewClient(config)

The client is safe for concurrent use by multiple goroutines.

Index

Examples

Constants

View Source
const (
	PeriodDaily   = "daily"
	PeriodWeekly  = "weekly"
	PeriodMonthly = "monthly"
	PeriodYearly  = "yearly"
)

Period constants for register extract queries

View Source
const (
	ServicePatent    = "DPMAregisterPatService"
	ServiceDesign    = "DPMAregisterGsmService"
	ServiceTrademark = "DPMAregisterMarkeService"
)

Service name constants for GetVersion

View Source
const (
	RelationUtilityModelBasis = "utility-model-basis"
	RelationDivision          = "division"
	RelationAddition          = "addition"
)

Relation types of PatentRelation.Type: the related-documents child element names.

View Source
const DefaultUserAgent = "dpma-connect-plus-go/" + Version + " (patent.dev; +https://github.com/patent-dev/dpma-connect-plus)"

DefaultUserAgent identifies this library in outbound requests.

View Source
const Version = "0.5.0"

Version is the library version. It surfaces through the default User-Agent.

Variables

This section is empty.

Functions

func FormatDate

func FormatDate(date time.Time) string

FormatDate formats a time.Time into YYYY-MM-DD format for register extract queries. The date is formatted in the input's location (no timezone conversion). Example: FormatDate(time.Date(2024, 10, 23, 0, 0, 0, 0, time.UTC)) returns "2024-10-23"

Example
package main

import (
	"fmt"
	"time"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	date := time.Date(2024, 10, 23, 0, 0, 0, 0, time.UTC)
	fmt.Println(dpma.FormatDate(date))
}
Output:
2024-10-23

func FormatPublicationWeek

func FormatPublicationWeek(year, week int) (string, error)

FormatPublicationWeek formats year and week into YYYYWW format. Returns an error if year < 1 or week is outside [1, 53]. Example: FormatPublicationWeek(2024, 45) returns "202445"

Example
package main

import (
	"fmt"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	pubWeek, err := dpma.FormatPublicationWeek(2024, 45)
	if err != nil {
		panic(err)
	}
	fmt.Println(pubWeek)
}
Output:
202445

func NormalizePublicationDocNumber added in v0.5.0

func NormalizePublicationDocNumber(docNumber string) string

NormalizePublicationDocNumber removes whitespace and the leading zeros the register pads a publication doc-number with: "000010027360" becomes "10027360", "112019001234" stays as it is. A value of zeros only becomes "0".

func ParsePublicationWeek

func ParsePublicationWeek(pubWeek string) (year, week int, err error)

ParsePublicationWeek parses a publication week string (YYYYWW) into year and week integers Returns an error if the format is invalid

func ValidateDesignQuery

func ValidateDesignQuery(q string) error

ValidateDesignQuery parses and validates a query against design field codes. Returns nil if valid, or an error describing the validation failure.

func ValidatePatentQuery

func ValidatePatentQuery(q string) error

ValidatePatentQuery parses and validates a query against patent field codes. Returns nil if valid, or an error describing the validation failure.

Example
package main

import (
	"fmt"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	// A valid query against the patent field codes returns nil.
	fmt.Println(dpma.ValidatePatentQuery("TI=Elektrofahrzeug AND INH=Siemens"))
	// An unknown field code is rejected.
	fmt.Println(dpma.ValidatePatentQuery("MARKE=test") != nil)
}
Output:
<nil>
true

func ValidatePeriod

func ValidatePeriod(period string) error

ValidatePeriod checks that a period string is one of the valid values.

func ValidateTrademarkQuery

func ValidateTrademarkQuery(q string) error

ValidateTrademarkQuery parses and validates a query against trademark field codes. Returns nil if valid, or an error describing the validation failure.

Types

type APIError

type APIError struct {
	Code       string
	Message    string
	StatusCode int
}

APIError represents a generic API error from DPMA

func (*APIError) Error

func (e *APIError) Error() string

type AuthError added in v0.3.5

type AuthError struct {
	StatusCode int
	Message    string
}

AuthError is returned for HTTP 401/403 responses that carry no DPMA error XML (real DPMA authentication failures arrive without a Transaction body). Responses that do carry error XML keep their content-typed *APIError.

func (*AuthError) Error added in v0.3.5

func (e *AuthError) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the main DPMA Connect Plus API client. It is safe for concurrent use by multiple goroutines.

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient creates a new DPMA Connect Plus API client

Example
package main

import (
	"fmt"

	dpma "github.com/patent-dev/dpma-connect-plus"
)

func main() {
	config := dpma.DefaultConfig()
	config.Username = "your-username"
	config.Password = "your-password"

	client, err := dpma.NewClient(config)
	if err != nil {
		panic(err)
	}
	fmt.Println(client != nil)
}
Output:
true

func (*Client) GetApplicantCitationsXML

func (c *Client) GetApplicantCitationsXML(ctx context.Context, year, week int) ([]byte, error)

GetApplicantCitationsXML downloads applicant citations as XML for a publication week

func (*Client) GetApplicantCitationsXMLStream

func (c *Client) GetApplicantCitationsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetApplicantCitationsXMLStream downloads applicant citations as XML and writes to dst

func (*Client) GetDesignBibliographicDataXML

func (c *Client) GetDesignBibliographicDataXML(ctx context.Context, year, week int) ([]byte, error)

GetDesignBibliographicDataXML downloads design bibliographic data as XML for a publication week

func (*Client) GetDesignBibliographicDataXMLStream

func (c *Client) GetDesignBibliographicDataXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetDesignBibliographicDataXMLStream downloads design bibliographic data as XML and writes to dst

func (*Client) GetDesignImage

func (c *Client) GetDesignImage(ctx context.Context, designNumber, imageNumber string) ([]byte, error)

GetDesignImage downloads a design image by design number and image number

func (*Client) GetDesignImages

func (c *Client) GetDesignImages(ctx context.Context, year, week int) ([]byte, error)

GetDesignImages downloads design images for a publication week

func (*Client) GetDesignImagesStream

func (c *Client) GetDesignImagesStream(ctx context.Context, year, week int, dst io.Writer) error

GetDesignImagesStream downloads design images and writes to dst

func (*Client) GetDesignInfo

func (c *Client) GetDesignInfo(ctx context.Context, designNumber string) ([]byte, error)

GetDesignInfo retrieves design information by design number

func (*Client) GetDesignInfoParsed

func (c *Client) GetDesignInfoParsed(ctx context.Context, designNumber string) (*DesignInfo, error)

GetDesignInfoParsed retrieves design info and returns parsed data.

func (*Client) GetDesignRegisterExtract

func (c *Client) GetDesignRegisterExtract(ctx context.Context, date time.Time, period string) ([]byte, error)

GetDesignRegisterExtract downloads design register extract data for a date and period

func (*Client) GetDesignRegisterExtractStream

func (c *Client) GetDesignRegisterExtractStream(ctx context.Context, date time.Time, period string, dst io.Writer) error

GetDesignRegisterExtractStream downloads design register extract data and writes to dst

func (*Client) GetDesignThumbnail

func (c *Client) GetDesignThumbnail(ctx context.Context, designNumber, thumbnailNumber string) ([]byte, error)

GetDesignThumbnail downloads a design thumbnail by design number and thumbnail number

func (*Client) GetDisclosureDocumentsPDF

func (c *Client) GetDisclosureDocumentsPDF(ctx context.Context, year, week int) ([]byte, error)

GetDisclosureDocumentsPDF downloads disclosure documents as PDF for a publication week

func (*Client) GetDisclosureDocumentsPDFStream

func (c *Client) GetDisclosureDocumentsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetDisclosureDocumentsPDFStream downloads disclosure documents as PDF and writes to dst

func (*Client) GetDisclosureDocumentsXML

func (c *Client) GetDisclosureDocumentsXML(ctx context.Context, year, week int) ([]byte, error)

GetDisclosureDocumentsXML downloads disclosure documents (A) as XML for a publication week

func (*Client) GetDisclosureDocumentsXMLStream

func (c *Client) GetDisclosureDocumentsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetDisclosureDocumentsXMLStream downloads disclosure documents as XML and writes to dst

func (*Client) GetEuropeanPatentSpecificationsPDF

func (c *Client) GetEuropeanPatentSpecificationsPDF(ctx context.Context, year, week int) ([]byte, error)

GetEuropeanPatentSpecificationsPDF downloads European patent specifications as PDF for a publication week

func (*Client) GetEuropeanPatentSpecificationsPDFStream

func (c *Client) GetEuropeanPatentSpecificationsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetEuropeanPatentSpecificationsPDFStream downloads European patent specifications as PDF and writes to dst

func (*Client) GetEuropeanPatentSpecificationsXML

func (c *Client) GetEuropeanPatentSpecificationsXML(ctx context.Context, year, week int) ([]byte, error)

GetEuropeanPatentSpecificationsXML downloads European patent specifications as XML for a publication week

func (*Client) GetEuropeanPatentSpecificationsXMLStream

func (c *Client) GetEuropeanPatentSpecificationsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetEuropeanPatentSpecificationsXMLStream downloads European patent specifications as XML and writes to dst

func (*Client) GetPatentInfo

func (c *Client) GetPatentInfo(ctx context.Context, registeredNumber string) ([]byte, error)

GetPatentInfo retrieves patent information by registered number (digits only, including check digit).

func (*Client) GetPatentInfoByPublicationNumber

func (c *Client) GetPatentInfoByPublicationNumber(ctx context.Context, publicationNumber string) (*PatentInfo, error)

GetPatentInfoByPublicationNumber resolves a publication number (e.g. "DE102019200907A1", "EP4780303A1") to a registered number via search and returns the parsed patent info. The search hit's leading-registered-number is fetched as reported (see GetPatentInfoByRegisteredNumber), so resolution is always exactly one search followed by one fetch.

func (*Client) GetPatentInfoByRegisteredNumber added in v0.4.0

func (c *Client) GetPatentInfoByRegisteredNumber(ctx context.Context, registeredNumber string) (*PatentInfo, error)

GetPatentInfoByRegisteredNumber fetches and parses the register record for a registered number exactly as given. Use it for a number the register itself reported (a search hit's leading-registered-number): those come in forms such as "CN2019089592" that cannot be told apart from a publication number by shape, so they must not go through GetPatentInfoParsed's classification.

func (*Client) GetPatentInfoParsed

func (c *Client) GetPatentInfoParsed(ctx context.Context, patentNumber string) (*PatentInfo, error)

GetPatentInfoParsed retrieves patent info and returns parsed bibliographic data. Accepts a registered number ("100273629", "E247834666" for an EP file) or a publication number with country prefix and/or kind code ("DE10027362C2", "DE102019200907A1", "EP4780303A1"). Anything that is not a registered number is resolved via a publication number search automatically.

func (*Client) GetPatentPublicationPDF

func (c *Client) GetPatentPublicationPDF(ctx context.Context, documentID string) ([]byte, error)

GetPatentPublicationPDF downloads a single patent publication in PDF format

func (*Client) GetPatentRegisterExtract

func (c *Client) GetPatentRegisterExtract(ctx context.Context, date time.Time, period string) ([]byte, error)

GetPatentRegisterExtract downloads patent register extract data for a date and period

func (*Client) GetPatentRegisterExtractStream

func (c *Client) GetPatentRegisterExtractStream(ctx context.Context, date time.Time, period string, dst io.Writer) error

GetPatentRegisterExtractStream downloads patent register extract data and writes to dst

func (*Client) GetPatentSpecificationsPDF

func (c *Client) GetPatentSpecificationsPDF(ctx context.Context, year, week int) ([]byte, error)

GetPatentSpecificationsPDF downloads patent specifications as PDF for a publication week

func (*Client) GetPatentSpecificationsPDFStream

func (c *Client) GetPatentSpecificationsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetPatentSpecificationsPDFStream downloads patent specifications as PDF and writes to dst

func (*Client) GetPatentSpecificationsXML

func (c *Client) GetPatentSpecificationsXML(ctx context.Context, year, week int) ([]byte, error)

GetPatentSpecificationsXML downloads patent specifications (B, C) as XML for a publication week

func (*Client) GetPatentSpecificationsXMLStream

func (c *Client) GetPatentSpecificationsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetPatentSpecificationsXMLStream downloads patent specifications as XML and writes to dst

func (*Client) GetPublicationDataXML

func (c *Client) GetPublicationDataXML(ctx context.Context, year, week int) ([]byte, error)

GetPublicationDataXML downloads publication data as XML for a publication week

func (*Client) GetPublicationDataXMLStream

func (c *Client) GetPublicationDataXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetPublicationDataXMLStream downloads publication data as XML and writes to dst

func (*Client) GetSearchableFullText

func (c *Client) GetSearchableFullText(ctx context.Context, documentID string) ([]byte, error)

GetSearchableFullText retrieves the searchable full text for a document

func (*Client) GetTrademarkBibDataApplied

func (c *Client) GetTrademarkBibDataApplied(ctx context.Context, year, week int) ([]byte, error)

GetTrademarkBibDataApplied downloads trademark bibliographic data (applied) for a publication week

func (*Client) GetTrademarkBibDataAppliedStream

func (c *Client) GetTrademarkBibDataAppliedStream(ctx context.Context, year, week int, dst io.Writer) error

GetTrademarkBibDataAppliedStream downloads trademark bib data (applied) and writes to dst

func (*Client) GetTrademarkBibDataRegistered

func (c *Client) GetTrademarkBibDataRegistered(ctx context.Context, year, week int) ([]byte, error)

GetTrademarkBibDataRegistered downloads trademark bibliographic data (registered) for a publication week

func (*Client) GetTrademarkBibDataRegisteredStream

func (c *Client) GetTrademarkBibDataRegisteredStream(ctx context.Context, year, week int, dst io.Writer) error

GetTrademarkBibDataRegisteredStream downloads trademark bib data (registered) and writes to dst

func (*Client) GetTrademarkBibDataRejected

func (c *Client) GetTrademarkBibDataRejected(ctx context.Context, year, week int) ([]byte, error)

GetTrademarkBibDataRejected downloads trademark bibliographic data (rejected) for a publication week

func (*Client) GetTrademarkBibDataRejectedStream

func (c *Client) GetTrademarkBibDataRejectedStream(ctx context.Context, year, week int, dst io.Writer) error

GetTrademarkBibDataRejectedStream downloads trademark bib data (rejected) and writes to dst

func (*Client) GetTrademarkImage

func (c *Client) GetTrademarkImage(ctx context.Context, applicationNumber string) ([]byte, error)

GetTrademarkImage downloads a trademark image by application number

func (*Client) GetTrademarkInfo

func (c *Client) GetTrademarkInfo(ctx context.Context, applicationNumber string) ([]byte, error)

GetTrademarkInfo retrieves trademark information by application number

func (*Client) GetTrademarkInfoParsed

func (c *Client) GetTrademarkInfoParsed(ctx context.Context, applicationNumber string) (*TrademarkInfo, error)

GetTrademarkInfoParsed retrieves trademark info and returns parsed data.

func (*Client) GetTrademarkRegisterExtract

func (c *Client) GetTrademarkRegisterExtract(ctx context.Context, date time.Time, period string) ([]byte, error)

GetTrademarkRegisterExtract downloads trademark register extract data for a date and period

func (*Client) GetTrademarkRegisterExtractStream

func (c *Client) GetTrademarkRegisterExtractStream(ctx context.Context, date time.Time, period string, dst io.Writer) error

GetTrademarkRegisterExtractStream downloads trademark register extract data and writes to dst

func (*Client) GetTrademarkThumbnail

func (c *Client) GetTrademarkThumbnail(ctx context.Context, applicationNumber string) ([]byte, error)

GetTrademarkThumbnail downloads a trademark thumbnail by application number

func (*Client) GetUtilityModelsPDF

func (c *Client) GetUtilityModelsPDF(ctx context.Context, year, week int) ([]byte, error)

GetUtilityModelsPDF downloads utility models as PDF for a publication week

func (*Client) GetUtilityModelsPDFStream

func (c *Client) GetUtilityModelsPDFStream(ctx context.Context, year, week int, dst io.Writer) error

GetUtilityModelsPDFStream downloads utility models as PDF and writes to dst

func (*Client) GetUtilityModelsXML

func (c *Client) GetUtilityModelsXML(ctx context.Context, year, week int) ([]byte, error)

GetUtilityModelsXML downloads utility models (U) as XML for a publication week

func (*Client) GetUtilityModelsXMLStream

func (c *Client) GetUtilityModelsXMLStream(ctx context.Context, year, week int, dst io.Writer) error

GetUtilityModelsXMLStream downloads utility models as XML and writes to dst

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context, service string) (string, error)

GetVersion retrieves version information for a service

func (*Client) SearchDesigns

func (c *Client) SearchDesigns(ctx context.Context, query string) ([]byte, error)

SearchDesigns executes a design expert search query

func (*Client) SearchDesignsParsed

func (c *Client) SearchDesignsParsed(ctx context.Context, query string) (*DesignSearchResult, error)

SearchDesignsParsed executes a design search and returns parsed results.

func (*Client) SearchPatents

func (c *Client) SearchPatents(ctx context.Context, query string) ([]byte, error)

SearchPatents executes a patent/utility model expert search query

func (*Client) SearchPatentsParsed

func (c *Client) SearchPatentsParsed(ctx context.Context, query string) (*PatentSearchResult, error)

SearchPatentsParsed executes a patent search and returns parsed results.

func (*Client) SearchTrademarks

func (c *Client) SearchTrademarks(ctx context.Context, query string) ([]byte, error)

SearchTrademarks executes a trademark expert search query

func (*Client) SearchTrademarksParsed

func (c *Client) SearchTrademarksParsed(ctx context.Context, query string) (*TrademarkSearchResult, error)

SearchTrademarksParsed executes a trademark search and returns parsed results.

type Config

type Config struct {
	BaseURL    string
	Username   string
	Password   string
	Timeout    time.Duration // HTTP client timeout (default: 20 minutes for bulk downloads)
	HTTPClient *http.Client  // Optional custom HTTP client; if set, Timeout is ignored
	UserAgent  string        // UserAgent overrides the outbound User-Agent header.
}

Config holds client configuration.

If HTTPClient is set, Timeout is ignored and the custom client's timeout applies instead. Callers should configure timeouts on the custom client directly.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default configuration

type DataNotAvailableError

type DataNotAvailableError struct{}

DataNotAvailableError represents data unavailable for requested period

func (*DataNotAvailableError) Error

func (e *DataNotAvailableError) Error() string

type DesignClass added in v0.3.1

type DesignClass struct {
	ClassificationKindCode string
	ClassificationVersion  string
	Comment                string
	ClassNumber            string
	Description            string
}

DesignClass represents an indication-product classification entry.

type DesignEntry added in v0.3.1

type DesignEntry struct {
	DesignIdentifier   string
	RegistrationNumber string
	RegistrationDate   string
	Title              string
	TotalSpecimen      string
	Status             string
	Classes            []DesignClass
	Priorities         []DesignPriority
	Representations    []DesignView // representation sheet views
	PreferedView       *DesignView
	Records            []DesignRecord // register-event history
	Applicants         []Party        // design-level applicants
	Representatives    []Party
	Extension          DesignExtensionInfo
	Publications       []DesignPublication // PublicationDetails/Publication
}

DesignEntry represents one design within a registration.

type DesignExtensionInfo added in v0.3.1

type DesignExtensionInfo struct {
	RegisterNumber                string
	DesignFileNumber              string
	DesignNumber                  string
	DateOfCaptureInSystem         string
	TypeOfDeposit                 string
	DefermentStatus               string
	TermProtectionObtained        string
	PaymentDeadline               string
	KindOfFee                     string
	DestructionPaperFile          string
	DesignDescriptionNotPublished string
	CancellationDate              string
}

DesignExtensionInfo holds the DE_ST86Extension scalar fields.

type DesignHit

type DesignHit struct {
	DesignIdentifier                 string
	ApplicationNumber                string
	RegistrationNumber               string
	TotalRepresentationSheet         string
	FirstRepresentationSheetFilename string
	Title                            string
	Applicant                        string
	Representative                   string
	StaffName                        string
	ClassNumber                      string
	Status                           string
	ApplicationDate                  string
	RegistrationDate                 string
	PublicationDate                  string
}

DesignHit represents a single design search result entry.

type DesignInfo

type DesignInfo struct {
	RegistrationOfficeCode string
	ApplicationNumber      string
	ApplicationReference   string
	ApplicationDate        string
	TotalDesign            string
	Designs                []DesignEntry // all designs in a multi-design registration
	Applicants             []Party       // application-level applicants
	CorrespondenceParty    Party
	RawXML                 []byte // original XML response bytes

	// Convenience fields mirroring the first design (back-compat).
	DesignIdentifier   string
	RegistrationNumber string
	RegistrationDate   string
	Title              string
	Status             string
	ClassNumber        string
	ClassDescription   string

	// ApplicationApplicants are the application-level applicants as sent.
	// Applicants above is replaced by the first design's applicants when that
	// design lists its own, so this field keeps the application-level list.
	ApplicationApplicants []Party
	// SchemaLocation, TransactionIdentifier and TransactionCode are the ST86
	// envelope values.
	SchemaLocation        string
	TransactionIdentifier string
	TransactionCode       string
}

DesignInfo holds parsed design register info (ST86).

func ParseDesignInfo

func ParseDesignInfo(data []byte) (*DesignInfo, error)

ParseDesignInfo parses a design info XML response (ST86 format).

type DesignPriority added in v0.3.1

type DesignPriority struct {
	CountryCode string
	Number      string
	Date        string
}

DesignPriority represents a priority claim of a design.

type DesignPublication added in v0.5.0

type DesignPublication struct {
	Identifier string
	Date       string
}

DesignPublication is one PublicationDetails/Publication entry of a design.

type DesignRecord added in v0.3.1

type DesignRecord struct {
	FilingDate            string
	LanguageCode          string
	PublicationIdentifier string
	PublicationSubsection string
	PublicationDate       string
	LegalStatus           string
}

DesignRecord represents one design register-event (DesignRecord) entry.

type DesignSearchResult

type DesignSearchResult struct {
	TotalHits    int
	DocumentHits int
	DatabaseHits int
	// MaxHitsReached is true when the query matched more than the 10000-hit cap
	// and the returned list is truncated (see PatentSearchResult.MaxHitsReached).
	MaxHitsReached bool
	Hits           []DesignHit
	RawXML         []byte // original XML response bytes
	// MessageDE, MessageEN, ListMaxHitsReached, DocumentHitsCounter and
	// DatabaseHitsCounter: see PatentSearchResult.
	MessageDE           string
	MessageEN           string
	ListMaxHitsReached  bool
	DocumentHitsCounter HitCounter
	DatabaseHitsCounter HitCounter
}

DesignSearchResult holds parsed design search results.

func ParseDesignSearch

func ParseDesignSearch(data []byte) (*DesignSearchResult, error)

ParseDesignSearch parses a design search XML response.

type DesignView added in v0.3.1

type DesignView struct {
	Filename string
	Format   string
	Number   string
	Height   string
	Width    string
	Unit     string
}

DesignView represents an image/representation view.

type ErrorResponse

type ErrorResponse struct {
	XMLName       xml.Name        `xml:"Transaction"`
	TradeMarkBody transactionBody `xml:"TradeMarkTransactionBody"`
	DesignBody    transactionBody `xml:"DesignTransactionBody"`
	PatentBody    transactionBody `xml:"PatentTransactionBody"`
}

ErrorResponse represents the XML error response structure from DPMA API. The DPMA API uses different body element names depending on the service:

  • TradeMarkTransactionBody (trademark service)
  • DesignTransactionBody (design service)
  • PatentTransactionBody (patent service)

All share the same nested TransactionErrorDetails structure. We parse all three variants and use whichever has error content.

type HitCounter added in v0.5.0

type HitCounter struct {
	Text           string
	MaxHitsReached bool
}

HitCounter is one <Counter> child of a search response, verbatim: Text is the element text (a number, or on capped lists the truncation notice the register writes in its place) and MaxHitsReached its maxHitsReched attribute (the register's own spelling).

type NotFoundError

type NotFoundError struct {
	Resource string
	ID       string
}

NotFoundError represents resource not found errors

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type Party

type Party struct {
	Text     string // full free-format line as returned by the office, if present
	Name     string
	Address  string
	Street   string
	Postcode string
	Country  string
	Sequence string // @sequence attribute, when present
	AppType  string // applicant @app-type attribute, when present
	// County, State, CountryCode and PostOfficeBox are the ST66/ST86 address
	// elements AddressCounty, AddressState, FormattedAddressCountryCode and
	// AddressPostOfficeBox, verbatim. Country above is a convenience pick of the
	// first non-empty of County, State and CountryCode (the register writes the
	// country code into any of them); these fields carry each element as sent.
	County        string
	State         string
	CountryCode   string
	PostOfficeBox string
}

Party represents a person or organization (applicant, inventor, agent, etc.)

type PatentCitation added in v0.5.0

type PatentCitation struct {
	Sequence            string
	NonPatent           bool
	Country             string
	DocNumber           string
	Kind                string
	Date                string
	Text                string
	RelevanceIndicators []string
}

PatentCitation is one references-cited entry. A patent citation (patcit) carries the cited document-id; the register writes the whole cited publication into DocNumber (e.g. "DE000010151502A1") and leaves Country, Kind and Date absent. A non-patent citation (nplcit) carries Text and has NonPatent set. RelevanceIndicators are the relevance-ind elements (X, Y, A...).

type PatentClassification added in v0.3.1

type PatentClassification struct {
	Sequence         string
	Symbol           string // <text>
	VersionIndicator string // <ipc-version-indicator>
	SymbolPosition   string // <symbol-position>, when present
}

PatentClassification represents a classification-ipcr entry with version.

type PatentDesignatedRegion added in v0.4.0

type PatentDesignatedRegion struct {
	Region    string
	Countries []string
}

PatentDesignatedRegion is one designation-pct/regional entry: the region (e.g. EP) and the states designated under it.

type PatentDocumentRef

type PatentDocumentRef struct {
	Country string
	Number  string
	Date    string
	Kind    string // document-id/kind, when present
}

PatentDocumentRef represents an application or document reference.

func (PatentDocumentRef) MatchesPublicationNumber added in v0.5.0

func (r PatentDocumentRef) MatchesPublicationNumber(publicationNumber string) bool

MatchesPublicationNumber is PatentPublication.MatchesNumber for a document reference such as a PatentInfo.RegionalPublications entry (EP and WO publications, which the register lists without kind code).

type PatentEvent added in v0.3.1

type PatentEvent struct {
	TypeOfProcedure        string
	ProceduralStatus       string
	DateOfProceduralStatus string
	PublicationInfo        *PatentEventPublication
	IPCMainClass           *PatentIPCClass
	PreviousIPCMainClass   *PatentIPCClass
	PublishedDocuments     []string
	DateLastRegisterUpdate string
	// Party changes. The register sends each party list twice: as verbatim
	// lines (Applicants, PreviousApplicants, Inventors, PreviousInventors,
	// Representative, PreviousRepresentative) and structured (the *Parties
	// fields, from the *-structured elements). Both are kept as sent.
	Applicants                    []string
	ApplicantParties              []Party
	PreviousApplicants            []string
	PreviousApplicantParties      []Party
	Inventors                     []string
	InventorParties               []Party
	PreviousInventors             []string
	PreviousInventorParties       []Party
	Representative                string
	RepresentativeParties         []Party
	RepresentativeType            string
	PreviousRepresentative        string
	PreviousRepresentativeParties []Party
	PreviousRepresentativeType    string
	// Further optional event fields of the register schema, verbatim.
	DateOfCapture               string
	IPCSecondaryClasses         []PatentIPCClass
	PreviousIPCSecondaryClasses []PatentIPCClass
	ThirdPartyRequest           string
	BPatGFileNumber             string
	SuspendedUntil              string
	Information                 string
	DateOfReceipt               string
	BasicPatentFileNumber       string
}

PatentEvent represents one legal-event / prosecution-history entry.

type PatentEventPublication added in v0.3.1

type PatentEventPublication struct {
	IssueNumber     string
	Year            string
	PublicationDate string
	PublicationType string
	Part            string
}

PatentEventPublication represents the publication-info of an event.

type PatentHit

type PatentHit struct {
	LeadingRegisteredNumber string
	RegisteredNumber        string
	Type                    string // "Patent", "Utility model"
	LegalStatus             string
	Title                   string
	Applicants              []string
	Inventors               []string
	Agent                   string
	IPCClasses              []string          // main + further classification symbols
	Classifications         []PatentSearchIPC // main + further with edition
	MainClassification      PatentSearchIPC   // main classification with edition
	FurtherClassifications  []PatentSearchIPC // further classifications with edition
	ApplicationDate         string
	PublicationDate         string
	RegistrationDate        string
	// NumberSystem, Country and ReceivingOffice classify the record by its
	// LeadingRegisteredNumber (see ClassifyRegisteredNumber): the register also
	// lists GDR patents, European files and PCT applications, so a hit is not
	// necessarily a German file. They are derived from the number's form, not
	// sent as separate elements; all three are empty for an unrecognised form.
	NumberSystem    PatentNumberSystem
	Country         string
	ReceivingOffice string
}

PatentHit represents a single patent search result entry.

type PatentIPCClass added in v0.3.1

type PatentIPCClass struct {
	Symbol  string
	Version string
}

PatentIPCClass represents an ipc-main-class / previous-ipc-main-class.

type PatentInfo

type PatentInfo struct {
	SchemaVersion string // @schema-version
	Publications  []PatentPublication
	// ApplicationRef is the register file's own application reference: the
	// first application-reference element (DE for a national file or a
	// validated EP, EP for a pending EP application, WO for a PCT application
	// before the DE phase). ApplicationRefs carries every one of them in
	// document order, e.g. DE, EP and WO for a validated EP that started as a PCT.
	ApplicationRef  PatentDocumentRef
	ApplicationRefs []PatentDocumentRef
	// RegionalPublications and RegionalFilings carry the
	// pct-or-regional-publishing-data and pct-or-regional-filing-data elements:
	// the EP and WO publication numbers and filing dates of a right that did not
	// start as a German national filing.
	RegionalPublications []PatentDocumentRef
	RegionalFilings      []PatentDocumentRef
	// DesignatedRegions carries designation-of-states/designation-pct/regional:
	// each region (e.g. EP) with the states designated under it.
	DesignatedRegions      []PatentDesignatedRegion
	Title                  string
	TitleLang              string
	IPCClasses             []string // classification symbols (back-compat convenience)
	Classifications        []PatentClassification
	Applicants             []Party
	Inventors              []Party
	Agents                 []Party // representatives
	CorrespondenceParty    Party   // parties/correspondence-address
	PriorityClaims         []PatentPriorityClaim
	IPRightType            string // patent, gebrauchsmuster, schutzzertifikat, etc.
	Status                 string // anhaengig-in-kraft, nicht-anhaengig-erloschen
	AgentType              string // office-specific agent-type
	Abstract               string
	FilingDate             string
	FirstPubDate           string
	DateLastRegisterUpdate string
	// GrantPubDate is office-specific-bib-data/date-of-publication-of-grant.
	GrantPubDate string
	// PCTNationalPhaseEntryDate is date-pct-national-phase-entry-pat.
	PCTNationalPhaseEntryDate string
	// DueDate and DueDateFee are the next fee due date and the fee it refers to
	// (e.g. "pat-zer-jahr-12"), verbatim.
	DueDate    string
	DueDateFee string
	// PublicationLanguageEP and PublicationLanguageWO are
	// language-of-publication-ep / -wo, verbatim (e.g. "EN - Englisch").
	PublicationLanguageEP string
	PublicationLanguageWO string
	Events                []PatentEvent // legal-event / prosecution history
	RawXML                []byte        // original XML response bytes
	// Citations carries references-cited/citation: the patcit entries, then
	// the nplcit entries, each with the register's own Sequence.
	// ReferencesCitedHash is the references-cited @hash attribute.
	Citations           []PatentCitation
	ReferencesCitedHash string
	// RelatedDocuments carries related-documents: each utility-model-basis,
	// division and addition relation with its parent and child files.
	RelatedDocuments []PatentRelation
}

PatentInfo holds parsed patent register info (ST36 bibliographic data).

func ParsePatentInfo

func ParsePatentInfo(data []byte) (*PatentInfo, error)

ParsePatentInfo parses a patent info XML response (ST36 format).

type PatentNumberSystem added in v0.5.0

type PatentNumberSystem string

PatentNumberSystem names the numbering system of a register record's leading-registered-number.

const (
	// NumberSystemDE is a German file number: digits only, check digit last
	// ("100273602" for 100 27 360.2, "82337144" for G 82 33 714.4).
	NumberSystemDE PatentNumberSystem = "DE"
	// NumberSystemDD is a patent of the former GDR: "DD" and the patent number
	// ("DD136869").
	NumberSystemDD PatentNumberSystem = "DD"
	// NumberSystemEP is a European application: "E" and the EPO application
	// number with its check digit ("E247834666" for 24 78 3466.6).
	NumberSystemEP PatentNumberSystem = "EP"
	// NumberSystemPCT is a PCT application: receiving office, year and serial
	// ("CN2019089592" for PCT/CN2019/089592).
	NumberSystemPCT PatentNumberSystem = "PCT"
)

Number systems the patent register reports in search hits.

type PatentPriorityClaim added in v0.3.1

type PatentPriorityClaim struct {
	Sequence  string
	Country   string
	Date      string
	DocNumber string
}

PatentPriorityClaim represents a priority-claim entry.

type PatentPublication

type PatentPublication struct {
	Sequence string
	Country  string
	Number   string
	Kind     string
	Date     string
}

PatentPublication represents a publication reference within patent info.

func (PatentPublication) MatchesNumber added in v0.5.0

func (p PatentPublication) MatchesNumber(publicationNumber string) bool

MatchesNumber reports whether the publication reference is the publication a caller wrote as publicationNumber (e.g. "DE10027360A1"), see PublicationNumber.Matches. The register's zero padding is ignored.

type PatentRelation added in v0.5.0

type PatentRelation struct {
	Type     string
	Parents  []PatentDocumentRef
	Children []PatentDocumentRef
}

PatentRelation is one related-documents relation: Type is the element name (RelationUtilityModelBasis, RelationDivision, RelationAddition), Parents and Children are the parent-doc and child-doc files as the register lists them. The register file itself appears on one of the two sides.

type PatentSearchIPC added in v0.3.1

type PatentSearchIPC struct {
	Classification string
	Edition        string
}

PatentSearchIPC is a classification symbol with its edition (patent search).

type PatentSearchResult

type PatentSearchResult struct {
	TotalHits    int
	DocumentHits int // <Counter><DocumentHits>; 0 when the cap notice replaces the number (see MaxHitsReached)
	DatabaseHits int // <Counter><DatabaseHits>
	// MaxHitsReached is true when the query matched more than the 10000-hit cap
	// and the returned list is truncated. DPMA then replaces the DocumentHits
	// count with the notice text ("Result list is limited - Not all results are
	// returned"), so DatabaseHits carries the register-wide total.
	MaxHitsReached bool
	Hits           []PatentHit
	RawXML         []byte // original XML response bytes
	// MessageDE and MessageEN are the Message_DE / Message_EN attributes of the
	// hit list (e.g. the truncation notice of a capped list), verbatim.
	MessageDE string
	MessageEN string
	// ListMaxHitsReached is the hit list's own maxHitsReached attribute;
	// DocumentHitsCounter and DatabaseHitsCounter are the two <Counter> children
	// as sent. MaxHitsReached above is the summary of these flags.
	ListMaxHitsReached  bool
	DocumentHitsCounter HitCounter
	DatabaseHitsCounter HitCounter
}

PatentSearchResult holds parsed patent search results.

func ParsePatentSearch

func ParsePatentSearch(data []byte) (*PatentSearchResult, error)

ParsePatentSearch parses a patent search XML response.

type PublicationNumber added in v0.5.0

type PublicationNumber struct {
	Country string // two-letter office code, empty when the input had none
	Number  string // digits, leading zeros removed
	Kind    string // kind code ("A1", "B4", "U1"), empty when the input had none
}

PublicationNumber is a publication number split into its parts. Number holds the digits without leading zeros, so the register's zero-padded form ("000010027360") and the usual written form ("10027360") compare equal.

func ParsePublicationNumber added in v0.5.0

func ParsePublicationNumber(s string) (pn PublicationNumber, ok bool)

ParsePublicationNumber splits a publication number into country, number and kind code. It accepts the forms callers write ("DE10027360A1", "de 100 27 360 A1", "EP4780303", "10027360") and the forms the register writes: a zero-padded doc-number ("000010027360") and the combined published-documents / citation form ("DD000000136869A1", "US000005371412A"). Whitespace is ignored and letters are upper-cased. ok is false when the input is not an optional two-letter country, digits, and an optional kind code (one letter, optionally followed by one digit).

func (PublicationNumber) Matches added in v0.5.0

func (pn PublicationNumber) Matches(other PublicationNumber) bool

Matches reports whether two publication numbers denote the same publication: the numbers are equal, and country and kind code are equal wherever BOTH sides state them. A side that omits the country or the kind code does not constrain it, so "DE10027360" matches both the A1 and the B4 publication.

type RateLimitError added in v0.3.5

type RateLimitError struct {
	RetryAfter int
	Message    string
}

RateLimitError is returned for HTTP 429 responses. RetryAfter is the value of the Retry-After header in seconds when known (0 otherwise).

func (*RateLimitError) Error added in v0.3.5

func (e *RateLimitError) Error() string

type RegisteredNumberClass added in v0.5.0

type RegisteredNumberClass struct {
	// System is the numbering system, empty when the form is not recognised.
	System PatentNumberSystem
	// Country is the code the register itself uses for such a record: "DE",
	// "DD", "EP", or "WO" for a PCT application.
	Country string
	// ReceivingOffice is the PCT receiving office ("CN"), PCT only.
	ReceivingOffice string
}

RegisteredNumberClass is the result of ClassifyRegisteredNumber.

func ClassifyRegisteredNumber added in v0.5.0

func ClassifyRegisteredNumber(leading string) RegisteredNumberClass

ClassifyRegisteredNumber classifies a leading-registered-number AS REPORTED BY THE REGISTER in a search hit (PatentHit.LeadingRegisteredNumber). It is a pure function of the number's form:

digits only                -> German file      (DE)
"E" + digits               -> European file    (EP)
two letters + ten digits   -> PCT application  (WO, receiving office = the letters)
"DD" + digits              -> GDR patent       (DD)

Do not feed it user input: a publication number such as "DE10027362" has the shape of a PCT registered number, which is why the register's own value is required. Anything else yields the zero value.

type ResolutionLoopError deprecated added in v0.3.5

type ResolutionLoopError struct {
	Number string
}

ResolutionLoopError was returned when resolving a patent number kept producing another non-registered number instead of terminating.

Deprecated: resolution is now always one search followed by one direct fetch of the reported registered number, so it cannot loop and this error is no longer returned. The type is kept so existing errors.As checks still compile.

func (*ResolutionLoopError) Error added in v0.3.5

func (e *ResolutionLoopError) Error() string

type TrademarkClass

type TrademarkClass struct {
	Number          string
	Description     string
	DescriptionLang string // GoodsServicesDescription @languageCode
}

TrademarkClass represents a Nice classification entry.

type TrademarkHit

type TrademarkHit struct {
	Number                 string
	RegistrationOfficeCode string
	ApplicationNumber      string
	MarkText               string
	MarkDescriptionText    string // MarkDescriptionDetails/DescriptionText
	MarkFeature            string // wortmarke, wort-bildmarke, etc.
	Classification         string
	Status                 string
	ApplicationDate        string
	RegistrationDate       string
	Applicant              string
	Representative         string
}

TrademarkHit represents a single trademark search result entry.

type TrademarkInfo

type TrademarkInfo struct {
	RegistrationOfficeCode     string
	ApplicationNumber          string
	RegistrationNumber         string
	ApplicationDate            string
	RegistrationDate           string
	ExpiryDate                 string
	TerminationDate            string
	Status                     string
	KindMark                   string
	MarkFeature                string
	OppositionPeriodStartDate  string
	OppositionPeriodEndDate    string
	MarkText                   string
	MarkTextLang               string // MarkVerbalElementText @languageCode
	StandardCharacterIndicator string // MarkStandardCharacterIndicator
	ProposedLeadingClassNumber string
	Applicants                 []Party
	Representatives            []Party
	CorrespondenceParty        Party
	Classifications            []TrademarkClass
	Records                    []TrademarkRecord // register-event history
	FileNumber                 string            // de:FileNumber
	MarkFeatureDPMA            string            // de:MarkFeatureDPMA
	RawXML                     []byte            // original XML response bytes
	// SchemaLocation, TransactionIdentifier and TransactionCode are the ST66
	// envelope values; PublicationDates are PublicationDetails/Publication dates.
	SchemaLocation        string
	TransactionIdentifier string
	TransactionCode       string
	PublicationDates      []string
}

TrademarkInfo holds parsed trademark register info (ST66).

func ParseTrademarkInfo

func ParseTrademarkInfo(data []byte) (*TrademarkInfo, error)

ParseTrademarkInfo parses a trademark info XML response (ST66 format).

type TrademarkRecord added in v0.3.1

type TrademarkRecord struct {
	RecordIdentifier       string
	BasicRecordKind        string
	PublicationIdentifier  string
	PublicationSection     string
	PublicationDate        string
	CurrentStatusCode      string
	CurrentStatusDate      string
	LegalGround            string // de:Record5f/de:LegalGround
	CancellationDate       string // de:Record5f/de:CancellationDate
	CorrectionText         string // de:CorrectionIncomplete/de:CorrectionText
	ImageCorrected         string // de:CorrectionIncomplete/de:ImageCorrected
	ReceiptDeclarationDate string // de:TransferIncomplete/de:ReceiptDeclarationDate
	PreviousHolder         *Party
	NewHolder              *Party
	// NewCorrespondenceParty is de:TransferIncomplete/de:CorrespondenceAddressDetails/
	// de:NewCorrespondenceAddress, nil when the record has none.
	NewCorrespondenceParty *Party
}

TrademarkRecord represents one register-event (MarkRecord) entry, including the de:-namespaced extension details (ownership transfer, cancellation, correction history).

type TrademarkSearchResult

type TrademarkSearchResult struct {
	TotalHits    int
	DocumentHits int
	DatabaseHits int
	// MaxHitsReached is true when the query matched more than the 10000-hit cap
	// and the returned list is truncated (see PatentSearchResult.MaxHitsReached).
	MaxHitsReached bool
	Hits           []TrademarkHit
	RawXML         []byte // original XML response bytes
	// ListMaxHitsReached, DocumentHitsCounter and DatabaseHitsCounter: see
	// PatentSearchResult.
	ListMaxHitsReached  bool
	DocumentHitsCounter HitCounter
	DatabaseHitsCounter HitCounter
}

TrademarkSearchResult holds parsed trademark search results.

func ParseTrademarkSearch

func ParseTrademarkSearch(data []byte) (*TrademarkSearchResult, error)

ParseTrademarkSearch parses a trademark search XML response.

type XMLParseError

type XMLParseError struct {
	Operation string // e.g. "ParsePatentSearch"
	Err       error  // underlying xml.Unmarshal error
}

XMLParseError indicates a failure to parse XML response data.

func (*XMLParseError) Error

func (e *XMLParseError) Error() string

func (*XMLParseError) Unwrap

func (e *XMLParseError) Unwrap() error

Directories

Path Synopsis
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.
Package query provides a query parser and validator for DPMAregister expert search syntax.
Package query provides a query parser and validator for DPMAregister expert search syntax.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL