{"id":23158751,"url":"https://github.com/greendelta/olca-ilcd","last_synced_at":"2025-10-13T07:16:20.427Z","repository":{"id":173325368,"uuid":"650575440","full_name":"GreenDelta/olca-ilcd","owner":"GreenDelta","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-14T10:29:54.000Z","size":1081,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-17T21:43:16.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GreenDelta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-07T11:06:20.000Z","updated_at":"2025-05-20T13:53:55.000Z","dependencies_parsed_at":"2024-03-25T07:33:03.555Z","dependency_job_id":"495355c3-f9ad-4b52-815e-0f53fbcb787e","html_url":"https://github.com/GreenDelta/olca-ilcd","commit_stats":{"total_commits":27,"total_committers":3,"mean_commits":9.0,"dds":0.07407407407407407,"last_synced_commit":"f2863595f4104b79212b65f4b7dbddc0d02ebb9a"},"previous_names":["greendelta/olca-ilcd"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GreenDelta/olca-ilcd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-ilcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-ilcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-ilcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-ilcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GreenDelta","download_url":"https://codeload.github.com/GreenDelta/olca-ilcd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Folca-ilcd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014113,"owners_count":26085462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T22:27:24.145Z","updated_at":"2025-10-13T07:16:20.410Z","avatar_url":"https://github.com/GreenDelta.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openLCA ILCD API\n\nThis is a Java library for reading and writing data sets in the\n[ILCD data format](https://eplca.jrc.ec.europa.eu/LCDN/developerILCDDataFormat.xhtml).\nIt was originally part of the [openLCA modules](https://github.com/GreenDelta/olca-modules)\nbut was moved to a separate repository since version 2.0.0.\n\n## Usage\n\nAdd this dependency to your project:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.openlca\u003c/groupId\u003e\n  \u003cartifactId\u003eolca-ilcd\u003c/artifactId\u003e\n  \u003cversion\u003e3.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\n## New in version 3\n\n### Fluent builder API\n\nThe ILCD format defines deeply structured data types. With a fluent API we made it easier to create such structures. Version 2 was based on public properties, you could use them like this (in the most compact form):\n\n```java\nvar flow = new Flow();\nflow.flowInfo = new FlowInformation();\nflow.flowInfo.dataSetInfo = new DataSetInfo();\nflow.flowInfo.dataSetInfo.uuid = \"123abc...\";\nflow.flowInfo.dataSetInfo.flowName = new FlowName();\nflow.flowInfo.dataSetInfo.flowName.baseName.add(\n  LangString.of(\"carbon dioxide\", \"en\"));\n```\n\nIn version 3, you can write the example above like this:\n\n```java\nvar flow = new Flow()\n  .withFlowInfo()\n  .withDataSetInfo()\n  .withUUID(\"123abc...\")\n  .withFlowName()\n  .withBaseName()\n  .add(LangString.of(\"carbon dioxide\", \"en\"));\n```\n\nThe `with{Field}()` methods will create inner data structures if needed and return them directly. The `with{Field}(value)` methods will set the value of the field and return the instance on which this method was called. For example, `withDataSetInfo()` creates a `DataSetInfo` and binds it to `FlowInfo` if it was not created yet, `withUUID(\"123...\")` sets the value of the `UUID` field and returns the `DataSetInfo` instance, on which then the base name list is created if needed.\n\n### Everything lazy\n\nIn version 2, collection fields like lists and maps were all eagerly created and bound to `final` fields, e.g.:\n\n```java\npublic class Process {\n  // ...\n  public final List\u003cExchange\u003e exchanges = new ArrayList\u003c\u003e();\n\n}\n```\n\nNow in version 3, they are all `private` and `null` initially:\n\n```java\npublic class Process {\n  // ...\n  private List\u003cExchange\u003e exchanges = null;\n\n  // ...\n  public List\u003cExchange\u003e getExchanges() {\n    return exchanges != null\n      ? exchanges\n      : Collections.emptyList();\n  }\n}\n```\n\nAs you can see in the example, the accessor will return an empty list if they are `null`, so it is safe to directly query the returned list. However, you should **never** modify a collection that is returned with a `get*` accessor, use the `with*` builder for this, e.g.:\n\n```java\nprocess.withExchanges().add(\n  new Exchange()\n    .withFlow(flow)\n    .withResultingAmount(42));\n```\n\nCollections as any other field can be now simply set to `null` to clear them:\n\n```java\nprocess\n  .withProcessInfo(null)\n  .withExchanges(null);\n```\n\nFor querying deeply nested fields we still have the `null` safe utility methods like in version 2. Remember to always check for `null` when using the `get*` methods for non-collection fields:\n\n```java\nvar pub = Processes.getPublication(process);\nif (pub != null) {\n  println(\"Version is: \" + pub.getVersion());\n}\n```\n\nBecause of this \"laziness\" we could remove some wrapper classes from the API and get rid of arrays. Also, the API is  more memory efficient now.\n\n\n### The `Xml` utility class\n\nReading and writing ILCD datasets from and to files, streams, strings, byte arrays, etc. is easier with the `Xml` utility class:\n\n```java\nvar flow = new Flow();\nflow.withFlowInfo()\n  .withDataSetInfo()\n  .withUUID(\"123abc...\")\n  .withFlowName()\n  .withBaseName()\n  .add(LangString.of(\"carbon dioxide\", \"en\"));\n\nprintln(Xml.toString(flow));\n```\n\nThis will print:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n\u003cf:flowDataSet\n  xmlns:common=\"http://lca.jrc.it/ILCD/Common\" xmlns:f=\"http://lca.jrc.it/ILCD/Flow\"\u003e\n    \u003cf:flowInformation\u003e\n        \u003cf:dataSetInformation\u003e\n            \u003ccommon:UUID\u003e123abc...\u003c/common:UUID\u003e\n            \u003cf:name\u003e\n                \u003cf:baseName xml:lang=\"en\"\u003ecarbon dioxide\u003c/f:baseName\u003e\n            \u003c/f:name\u003e\n        \u003c/f:dataSetInformation\u003e\n    \u003c/f:flowInformation\u003e\n\u003c/f:flowDataSet\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreendelta%2Folca-ilcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreendelta%2Folca-ilcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreendelta%2Folca-ilcd/lists"}