Problems and parts
PatentRef's addition, experimental (S1-D): for each patent, the problem it states and the parts it names, each quoted with its place in the text, and links to other patents whose claims name the same part. Deterministic rules over the published text; no language model runs in any request. Every answer says "experimental": true, and the shape can change from one release to the next while the rules are checked.
- Routes
GET /api/v1/structure/units/{patent_id}/, GET /api/v1/structure/relations/{patent_id}/, GET /api/v1/structure/locate/, GET or POST /api/v1/structure/units/
- Key
X-Api-Key, as every data path; each call counts toward the monthly allowance
- Built
- units when they are asked for, from the long-text file; the links from a structure file built once from that file and attached read only
- Versions
s1d_version (X-S1D-Version), data_version (X-Data-Version), text_data_version (X-Text-Data-Version) and, for the links and the units query, structure_data_version
- Machine-readable
- the operations in openapi.json (operationIds
StructureUnits, StructureRelations, StructureLocate, StructureUnitsQuery)
Example
curl -s -H "X-Api-Key: $KEY" https://patentref.io/api/v1/structure/units/4063763/
import os, requests
base_url = "https://patentref.io"
headers = {"X-Api-Key": os.environ["PATENTREF_KEY"]}
r = requests.get(base_url + "/api/v1/structure/units/4063763/", headers=headers)
r.raise_for_status()
ans = r.json()
for u in ans["units"]:
loc = u["locator"]
back = requests.get(base_url + "/api/v1/structure/locate/", params=loc, headers=headers).json()
assert back["text"] == u["text"] # every quote is the text at its locator
print(u["type"], u.get("part"), loc["field"], loc["start"], loc["end"])
How S1-D reads a patent
- What it is: for each patent, the problem it states and the parts it names, each quoted with its place in the text, and links to other patents whose claims name the same part. Deterministic rules over the published text (s1d 0.3.2 on claimgraph 0.3.0): no language model runs in any request, and the same text gives the same answer. Experimental: every answer says "experimental": true and names the version of its rules in s1d_version ("s1d-11"; the claim tree's structure_version is another field); the shape can change from one release to the next while the rules are checked.
- GET /structure/units/{patent_id}/ (the trailing slash is optional): one patent's units, {"error": false, "patent_id", "patent_unit_id", "s1d_version", "generator", "data_version", "text_data_version", "as_of", "experimental", "units": [...], "relations": [...], "counts", "none_found", "texts_read", "left_out", "unread"}, built when asked for from the long-text file in service. types is a comma list of Component and StatedProblem (both by default), relations is all or none, f a JSON array of the unit fields to keep (unit_id, type and locator are always kept). At most 400 parts and 50 stated units of a type in one answer; beyond that truncated is true and omitted counts the rest.
- A unit: {"unit_id", "type", "part", "text", "term_id", "locator", "cue", "section", "key_withheld", "s1d_version"}. A part (type Component, unit_id US<patent_id>-k<n>) is a term the claims introduce, ended where the claim tree ends it: part is its normalized form (lower case, no determiner, the last word singular), text the claim's own words, term_id the claim tree's term; a part whose words the rules do not settle has part null and key_withheld (longer phrase, frequent word or unsure end). A part is a term, not always a physical component. A stated problem (type StatedProblem, unit_id US<patent_id>-p<n>) is the patent's own sentence or clause in its brief summary or in the background part of its detailed description, where a named cue rule (cue) finds a problem, need or aim, under a named heading (section). relations: recites (a claim to a part, at the claim's own mention, with its text and locator) and states (the patent to a stated problem).
- Locators: every unit and every located relation carries {"patent_id", "field", "sequence", "start", "end"}: the text of field (claims, brief_summary or detail_description) at sequence (the claim_sequence for claims, the row for the other two), from start to end, is the quote (Unicode code points, as in the claim tree). The server checks every quote before the answer leaves; left_out counts what that check took out (0 in normal service). GET /structure/locate/?patent_id=&field=&sequence=&start=&end= (end minus start at most 2,000) reads any locator back: {"error": false, "text", "locator", "s1d_version", "data_version", "text_data_version", "as_of", "experimental"}; a detailed description row is read to its opening 160,000 bytes.
- none_found names each unit type with no unit: the rules found no such sentence, not that the patent has none (on fresh patents they find about 60 percent of the problems a person reading the patent finds). unread names what could not be read and why: a patent with a claim row that has no claim_sequence (RE31177 in this data) gives its stated problems and no part.
- GET /structure/relations/{patent_id}/?rel=names_same_part&o={"size":20}: the patents whose claims name the same parts, read from the structure file (built once from the long-text file, attached read only; structure_data_version and X-Structure-Data-Version name it). Parts are compared without leading ordinal words ("a second gear" and "a gear" name the same part). Links rank by the number of shared parts, then by how many patents name those parts (fewer before more), then by patent number; rank is the place in that order. A link: {"src", "rel", "dst", "shared_count", "shared_parts": [{"part", "patents_with_key", "src": {"text", "locator"}, "dst": {"text", "locator"}}], "rank", "s1d_version"}, up to 10 shared parts listed; patents_with_key counts the patents in the file whose claims introduce that part. A part named by more than 0.2 percent of the patents in the file takes no part in links (link_lookup.df_max gives that number); a lookup reads at most 60,000 index rows, rarer parts before common ones, and says budget_reached: true when it stops there. o.size is 1 to 100 (20 by default); o.after is the last link's [shared_count, patents_with_key_total, patent_number, rank], as next_after gives it, and next_after is null on the last page. rel=recites and rel=states give what the units endpoint gives, with no structure file. A link says only that both patents' claims name these part words.
- GET or POST /structure/units/?q=&f=&s=&o=: units across patents in the PatentsView grammar. q names patent_id (a value or a list of up to 100) or part (one part, compared as the links compare it, answered from the index: one row per patent, at the lowest claim that introduces it, unit_id null); type, cue and section filter it. Plain values and _eq, combined with _and, and _or on one field; another operator, or one on text or locator, answers 400 ERR_Q. f: patent_id, unit_id, type, part, cue, section, field, text, locator. s: patent_id asc or desc, then unit_id, type, part, cue or section (patent_id, then unit_id by default); an order that does not name unit_id ends with it (ascending, since 1.25.0), so rows that tie on what s names keep one order and no page ends inside a tie. o: size 1 to 100 (25 by default) and after, the last row's sort values, as next_after gives them (the values s names, then unit_id when s does not name it; an after of the values s names alone, as 1.24.0 gave it, starts the page at the rows that tie with it). Stated problems come from the structure file, each quote read from the long-text file and kept only when it hashes to the digest stored with it; the parts of named patents are built when asked for, at most 10 patents a request (budget_reached then says so), and total_hits_exact says whether total_hits counted every unit.
- Limits and errors: the claim tree's work caps (1,000 claim rows, 1,000,000 characters, 5 s a read of the long-text file) and 20 s a lookup in the structure file answer 500 ERR_ES. A string that is not a patent number, or a parameter out of its range, is 400 ERR_Q with X-Status-Reason saying which; a patent the data in service does not have, a patent with neither claim text nor a brief summary in the long-text file, and a locator with no text answer 404 {"error": true} with X-Status-Reason-Code NOT_FOUND. While no structure file is attached, rel=names_same_part and the units query answer 501 ERR_NO_STRUCTURE_FILE ("The structure file is not attached on this server."); with no long-text file in service every S1-D path answers 501 ERR_NOT_IMPLEMENTED. The answers carry X-Data-Version, X-Text-Data-Version and X-S1D-Version.
- Example: GET /structure/units/4063763/?types=StatedProblem with X-Api-Key gives the patent's stated problem with its locator in the brief summary; GET /structure/relations/7062158/ its ranked links; GET /structure/locate/ with any locator from either answer reads the quote back.
The units of one patent
A unit
The links
A link
The units query
Errors keep the upstream form, with X-Status-Reason and X-Status-Reason-Code; send Accept: application/problem+json for RFC 9457 problem details. The codes are on the keys, limits and errors page, at /docs/errors/NOT_FOUND and at /docs/errors/ERR_NO_STRUCTURE_FILE.