Get a full data set by ID

This method returns the full data set of a given type and ID.

Rest APIGET /data/{type}/{id}
JSON-RPCdata/get
Python/IPCClient.get
Return typeE > RootEntity

Examples

Python IPC

import olca_ipc as ipc
import olca_schema as o

client = ipc.Client()
process = client.get(o.Process, "eacc4872-6f4e-4ff1-946e-c1bddeda24be")
print(process)
# Process(
#   id='eacc4872-6f4e-4ff1-946e-c1bddeda24be',
#   exchanges=[Exchange(amount=1.0, flow=Ref(id='b254bbdf- ...

JSON-RPC via Fetch API

The example below shows the usage of this method using the JSON-RPC protocol via the Fetch API which is available in modern web-browsers or platforms like Deno.

  let resp = await fetch("http://localhost:8080", {
    method: "POST",
    body: JSON.stringify({
      jsonrpc: "2.0",
      id: 1,
      method: "data/get",
      params: {
        "@type": "Process",
        "@id": "eacc4872-6f4e-4ff1-946e-c1bddeda24be"
      }
    })
  });
  let v = await resp.json();
  console.log(v);
  // {
  //   jsonrpc: "2.0",
  //   result: {
  //     "@type": "Process",
  //     "@id": "eacc4872-6f4e-4ff1-946e-c1bddeda24be",
  //     name: "blast furnace gas, Recycled Content cut-off",
  //     processType: "LCI_RESULT",

Curl

endpoint="http://localhost:8080"
process_id="eacc4872-6f4e-4ff1-946e-c1bddeda24be"

curl "$endpoint/data/process/$process_id"
# { "@type":"Process",
#   "@id":"eacc4872-6f4e-4ff1-946e-c1bddeda24be",
#   "name":"blast furnace gas, Recycled Content cut-off