Get a full data set by name

This method returns a full data set for the given type and name. Note that the name does not have to be unique in an openLCA database, and in this case, it will just return the first entity from the database with the given name.

Rest APIGET /data/{type}/name/{name}
JSON-RPCdata/get
Python/IPCClient.get
Return type:E > RootEntity

Examples

Python IPC

import olca_ipc as ipc
import olca_schema as o

client = ipc.Client()
mass = client.get(o.FlowProperty, name="Mass")
print(mass)
# FlowProperty(
#   name='Mass',
#   id='93a60a56-a3c8-11da-a746-0800200b9a66',
#   unit_group=Ref(id='93a60a57-a4c8-11da-a746-0800200c9a66', ...

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": "FlowProperty",
        "name": "Mass",
      }
    })
  });
  let v = await resp.json();
  console.log(v);
  // {
  //   jsonrpc: "2.0",
  //   result: {
  //     "@type": "FlowProperty",
  //     "@id": "93a60a56-a3c8-11da-a746-0800200b9a66",
  //     name: "Mass",
  //     category: "Technical flow properties",
  //     version: "00.00.000",
  //     flowPropertyType: "PHYSICAL_QUANTITY",