Class: EpoOps::PatentApplication

Inherits:
Object
  • Object
show all
Defined in:
lib/epo_ops/patent_application.rb

Overview

This class represents a Patent Application as returned by EPO OPS returns for bibliographic documents. Some elements are not yet fully parsed but hashes returned instead. Not all information available is parsed, but the full data can be accesses via #raw_data

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_nr, data = {}) ⇒ PatentApplication

Returns a new instance of PatentApplication.



103
104
105
106
107
108
# File 'lib/epo_ops/patent_application.rb', line 103

def initialize(application_nr, data={})
  @application_nr = application_nr
  data.each_pair do |key,value|
    instance_variable_set("@#{key.to_s}",value)
  end
end

Instance Attribute Details

#agentsArray (readonly)

Lists the Agents of the Application Agents are subject to change at EPO, often their names or addresses are updated, sometimes other people/companies appear or disappear.

Returns:



78
79
80
# File 'lib/epo_ops/patent_application.rb', line 78

def agents
  @agents
end

#applicantsArray (readonly)

Lists the Applicants of the Application Applicants are subject to change at EPO, often their names or addresses are updated, sometimes other people/companies appear or disappear.

Returns:



71
72
73
# File 'lib/epo_ops/patent_application.rb', line 71

def applicants
  @applicants
end

#application_nrString (readonly)

A number by which a patent is uniquely identifiable and querieable. The first two letters are the country code of the processing patent office, for european patents this is EP.

Returns:

  • (String)

    application number.



57
58
59
# File 'lib/epo_ops/patent_application.rb', line 57

def application_nr
  @application_nr
end

#classificationsArray (readonly)

Returns a list of the IPC-Classifications, as strings. Format is set by EPO, should be similar to: E06B7/23.

Returns:

  • (Array)

    a list of the IPC-Classifications, as strings. Format is set by EPO, should be similar to: E06B7/23



64
65
66
# File 'lib/epo_ops/patent_application.rb', line 64

def classifications
  @classifications
end

#effective_dateObject (readonly)

Returns the value of attribute effective_date.



101
102
103
# File 'lib/epo_ops/patent_application.rb', line 101

def effective_date
  @effective_date
end

#inventorsArray (readonly)

Lists the Inventors of the Application Agents are subject to change at EPO, often their names or addresses are updated, sometimes other people/companies appear or disappear.

Returns:



85
86
87
# File 'lib/epo_ops/patent_application.rb', line 85

def inventors
  @inventors
end

#priority_claimsArray (readonly)

The priority claim describe the first documents that were filed at any patent office in the world regarding this patent.

Returns:

  • (Array)

    an Array of hashes which descibe the filed priorities with the fields: ‘country` `doc_number`, `date`, `kind`, and `sequence`



95
96
97
# File 'lib/epo_ops/patent_application.rb', line 95

def priority_claims
  @priority_claims
end

#publication_referencesArray (readonly)

Returns List of hashes containing information about publications made, entries exist for multiple types of publications, e.g. A1, B1.

Returns:

  • (Array)

    List of hashes containing information about publications made, entries exist for multiple types of publications, e.g. A1, B1.



99
100
101
# File 'lib/epo_ops/patent_application.rb', line 99

def publication_references
  @publication_references
end

#raw_dataHash (readonly)

Returns The raw application data as recived from EPO.

Returns:

  • (Hash)

    The raw application data as recived from EPO



60
61
62
# File 'lib/epo_ops/patent_application.rb', line 60

def raw_data
  @raw_data
end

#statusString (readonly)

Returns the string representation of the current patent status as described by the EPO.

Returns:

  • (String)

    the string representation of the current patent status as described by the EPO



89
90
91
# File 'lib/epo_ops/patent_application.rb', line 89

def status
  @status
end

Class Method Details

.find(application_number) ⇒ PatentApplication

Note:

API url: /3.1/rest-services/register/application/epodoc/#application_number/biblio

Finds an application document by application number. As an application may have several numbers assigned (for example EP and WO) we pick the first one returned - thus the returned document may have a different number

Parameters:

  • application_number (String)

    identifies the application document at EPO

Returns:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/epo_ops/patent_application.rb', line 15

def find(application_number)
  raw_data = EpoOps::Client.request(
    :get,
    "/3.1/rest-services/register/application/epodoc/#{application_number}/biblio"
  ).parsed

  data = EpoOps::Util.flat_dig(
    raw_data,
    'world_patent_data', 'register_search', 'register_documents', 'register_document'
  ).first

  return nil unless data

  Factories::PatentApplicationFactory.build(data)
end

.search(cql_query) ⇒ RegisterSearchResult

Note:

API url: /3.1/rest-services/register/search

Searches for application documents using a CQl query Returned documents are not fully populated with data, only publication references, application id and IPC classes are available to retrive all data use #fetch

Parameters:

  • cql_query (String)

    a CQL query string

Returns:

See Also:



41
42
43
44
45
46
47
48
49
50
# File 'lib/epo_ops/patent_application.rb', line 41

def search(cql_query)
  data = Client.request(
    :get,
    '/3.1/rest-services/register/search?' + cql_query
  ).parsed

  EpoOps::Factories::RegisterSearchResultFactory.build(data)
rescue EpoOps::Error::NotFound
  EpoOps::RegisterSearchResult::NullResult.new
end

Instance Method Details

#fetchself

Fetches the same document from the register populating all available fields

Returns:

  • (self)

See Also:

  • EpoOps::PatentApplication.{PatentApplication{PatentApplication.find}


140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/epo_ops/patent_application.rb', line 140

def fetch
  raise "Application Number must be set!" unless application_nr

  new_data = self.class.find(application_nr)

  @raw_data = new_data.raw_data
  @title = new_data.instance_variable_get('@title')
  @status = new_data.status
  @agents = new_data.agents
  @applicants = new_data.applicants
  @inventors = new_data.inventors
  @classifications = new_data.classifications
  @priority_claims = new_data.priority_claims
  @publication_references = new_data.publication_references
  @effective_date = new_data.effective_date

  self
end

#latest_updateDate

Many fields of the XML the EPO provides have a field ‘change_gazette_num`. It is a commercial date (year + week) that describes in which week the element has been changed. This method parses them and returns the most recent date found.

Returns:

  • (Date)

    the latest date found in the document.



126
127
128
129
130
# File 'lib/epo_ops/patent_application.rb', line 126

def latest_update
  gazette_nums = EpoOps::Util.parse_hash_flat(@raw_data, 'change_gazette_num')
  nums = gazette_nums.map { |num| EpoOps::Util.parse_change_gazette_num(num) }.keep_if { |match| !match.nil? }
  nums.max
end

#title(lang = 'en') ⇒ String

Note:

Titles are usually available at least in english, french and german. Other languages are also possible.

Returns the Application title in the given languages

Parameters:

  • lang (Integer) (defaults to: 'en')

    language identifier for the title

Returns:

  • (String)

    the english title of the patent



115
116
117
118
# File 'lib/epo_ops/patent_application.rb', line 115

def title(lang='en')
  return nil unless @title.instance_of?(Hash)
  @title[lang]
end

#urlString

Returns The URL at which you can query the original document.

Returns:

  • (String)

    The URL at which you can query the original document.



133
134
135
# File 'lib/epo_ops/patent_application.rb', line 133

def url
  @url ||= "https://ops.epo.org/3.1/rest-services/register/application/epodoc/#{application_nr}"
end