Class: EpoOps::PatentApplication
- Inherits:
-
Object
- Object
- EpoOps::PatentApplication
- 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
-
#agents ⇒ Array
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.
-
#applicants ⇒ Array
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.
-
#application_nr ⇒ String
readonly
A number by which a patent is uniquely identifiable and querieable.
-
#classifications ⇒ Array
readonly
A list of the IPC-Classifications, as strings.
-
#effective_date ⇒ Object
readonly
Returns the value of attribute effective_date.
-
#inventors ⇒ Array
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.
-
#priority_claims ⇒ Array
readonly
The priority claim describe the first documents that were filed at any patent office in the world regarding this patent.
-
#publication_references ⇒ Array
readonly
List of hashes containing information about publications made, entries exist for multiple types of publications, e.g.
-
#raw_data ⇒ Hash
readonly
The raw application data as recived from EPO.
-
#status ⇒ String
readonly
The string representation of the current patent status as described by the EPO.
Class Method Summary collapse
-
.find(application_number) ⇒ PatentApplication
Finds an application document by application number.
-
.search(cql_query) ⇒ RegisterSearchResult
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.
Instance Method Summary collapse
-
#fetch ⇒ self
Fetches the same document from the register populating all available fields.
-
#initialize(application_nr, data = {}) ⇒ PatentApplication
constructor
A new instance of PatentApplication.
-
#latest_update ⇒ Date
Many fields of the XML the EPO provides have a field ‘change_gazette_num`.
-
#title(lang = 'en') ⇒ String
Returns the Application title in the given languages.
-
#url ⇒ String
The URL at which you can query the original document.
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
#agents ⇒ Array (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.
78 79 80 |
# File 'lib/epo_ops/patent_application.rb', line 78 def agents @agents end |
#applicants ⇒ Array (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.
71 72 73 |
# File 'lib/epo_ops/patent_application.rb', line 71 def applicants @applicants end |
#application_nr ⇒ String (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.
57 58 59 |
# File 'lib/epo_ops/patent_application.rb', line 57 def application_nr @application_nr end |
#classifications ⇒ Array (readonly)
Returns 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_date ⇒ Object (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 |
#inventors ⇒ Array (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.
85 86 87 |
# File 'lib/epo_ops/patent_application.rb', line 85 def inventors @inventors end |
#priority_claims ⇒ Array (readonly)
The priority claim describe the first documents that were filed at any patent office in the world regarding this patent.
95 96 97 |
# File 'lib/epo_ops/patent_application.rb', line 95 def priority_claims @priority_claims end |
#publication_references ⇒ Array (readonly)
Returns 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_data ⇒ Hash (readonly)
Returns 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 |
#status ⇒ String (readonly)
Returns 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
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
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
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
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
#fetch ⇒ self
Fetches the same document from the register populating all available fields
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_update ⇒ Date
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.
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
Titles are usually available at least in english, french and german. Other languages are also possible.
Returns the Application title in the given languages
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 |
#url ⇒ String
Returns 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 |