{"id":23122682,"url":"https://github.com/folio-org/mod-linked-data","last_synced_at":"2025-07-27T12:08:01.803Z","repository":{"id":258217190,"uuid":"873620183","full_name":"folio-org/mod-linked-data","owner":"folio-org","description":"Manage data graph of FOLIO library's catalog","archived":false,"fork":false,"pushed_at":"2025-07-23T18:09:31.000Z","size":3722,"stargazers_count":1,"open_issues_count":2,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-23T18:22:48.322Z","etag":null,"topics":["builde","data-graph","linked-data"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/folio-org.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","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,"zenodo":null}},"created_at":"2024-10-16T13:22:51.000Z","updated_at":"2025-07-23T18:09:35.000Z","dependencies_parsed_at":"2025-05-15T16:29:25.038Z","dependency_job_id":"ca39c9bc-2c2a-475a-add3-754e0b3eea46","html_url":"https://github.com/folio-org/mod-linked-data","commit_stats":null,"previous_names":["folio-org/mod-linked-data"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/folio-org/mod-linked-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-linked-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-linked-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-linked-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-linked-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/folio-org","download_url":"https://codeload.github.com/folio-org/mod-linked-data/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Fmod-linked-data/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267355174,"owners_count":24073922,"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-07-27T02:00:11.917Z","response_time":82,"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":["builde","data-graph","linked-data"],"created_at":"2024-12-17T07:29:39.809Z","updated_at":"2025-07-27T12:08:01.798Z","avatar_url":"https://github.com/folio-org.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mod-linked-data\nCopyright (C) 2024 The Open Library Foundation\n\nThis software is distributed under the terms of the Apache License, Version 2.0.\nSee the file \"[LICENSE](LICENSE)\" for more information.\n## Introduction\nmod-linked-data manages the data graph of the library's catalog, providing REST APIs for CRUD operations on the data graph.\n### Dependencies on libraries\nThis module is dependent on the following libraries:\n- [lib-linked-data-dictionary](https://github.com/folio-org/lib-linked-data-dictionary)\n- [lib-linked-data-fingerprint](https://github.com/folio-org/lib-linked-data-fingerprint)\n- [lib-linked-data-marc4ld](https://github.com/folio-org/lib-linked-data-marc4ld)\n## Compiling\n```bash\nmvn clean install\n```\nSkip tests:\n```bash\nmvn clean install -DskipTests\n```\n## Modes of Execution\nmod-linked-data can be executed in standalone mode or as part of the FOLIO platform.\n### FOLIO mode\nThis is default mode. In FOLIO mode, mod-linked-data integrates with other FOLIO modules:\n- Receives MARC Authority records from [mod-source-record-storage](https://github.com/folio-org/mod-source-record-storage) via Kafka topics and updates the linked data graph.\n- Sends linked data graph updates to the [mod-search](https://github.com/folio-org/mod-search) module via Kafka topics.\n- Sends linked data graph updates to the [mod-inventory](https://github.com/folio-org/mod-inventory) module via Kafka topics.\n\nTo run mod-linked-data in FOLIO mode, do not set the environment variable `SPRING_PROFILES_ACTIVE`.\n### Standalone mode\nIn standalone mode, mod-linked-data operates independently without communication with other FOLIO modules.\nIn this mode, you can create and update graph using REST APIs. However, the graph will not be synced with other FOLIO modules.\n\nTo run mod-linked-data in standalone mode, set the value of the environment variable `SPRING_PROFILES_ACTIVE` to `standalone`.\n## Environment Variables\n| Name                                                | Default Value                   | Description                                                                                                                                                                           |\n|-----------------------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| SERVER_PORT                                         | 8081                            | The port number of the application                                                                                                                                                    |\n| ENV                                                 | folio                           | The logical name of the deployment, must be unique across all environments using the same shared Kafka/Elasticsearch clusters, `a-z (any case)`, `0-9`, `-`, `_` symbols only allowed |\n| DB_HOST                                             | localhost                       | Postgres hostname                                                                                                                                                                     |\n| DB_PORT                                             | 5432                            | Postgres port                                                                                                                                                                         |\n| DB_USERNAME                                         | postgres                        | Postgres username                                                                                                                                                                     |\n| DB_PASSWORD                                         | postgres                        | Postgres password                                                                                                                                                                     |\n| DB_DATABASE                                         | postgres                        | Postgres database name                                                                                                                                                                |\n| SPRING_PROFILES_ACTIVE                              | -                               | Indicates if the application has to be run in FOLIO mode or standalone mode                                                                                                           |\n| KAFKA_HOST`*`                                       | kafka                           | Kafka broker hostname                                                                                                                                                                 |\n| KAFKA_PORT`*`                                       | 9092                            | Kafka broker port                                                                                                                                                                     |\n| KAFKA_SECURITY_PROTOCOL`*`                          | PLAINTEXT                       | Kafka security protocol used to communicate with brokers (SSL or PLAINTEXT)                                                                                                           |\n| KAFKA_SSL_KEYSTORE_LOCATION`*`                      | -                               | The location of the Kafka key store file. This is optional for client and can be used for two-way authentication for client.                                                          |\n| KAFKA_SSL_KEYSTORE_PASSWORD`*`                      | -                               | The store password for the Kafka key store file. This is optional for client and only needed if 'ssl.keystore.location' is configured.                                                |\n| KAFKA_SSL_TRUSTSTORE_LOCATION`*`                    | -                               | The location of the Kafka trust store file.                                                                                                                                           |\n| KAFKA_SSL_TRUSTSTORE_PASSWORD`*`                    | -                               | The password for the Kafka trust store file. If a password is not set, trust store file configured will still be used, but integrity checking is disabled.                            |\n| KAFKA_CONSUMER_MAX_POLL_RECORDS`*`                  | 200                             | Maximum number of records returned in a single call to poll().                                                                                                                        |\n| KAFKA_SOURCE_RECORD_DOMAIN_EVENT_TOPIC_PATTERN`*`   | (ENV\\.)(.*\\.)srs.source_records | Custom Source Record Domain Event topic name pattern                                                                                                                                  |\n| KAFKA_SOURCE_RECORD_DOMAIN_EVENT_CONCURRENCY`*`     | 1                               | Custom number of kafka concurrent threads for Source Record Domain Event message consuming.                                                                                           |\n| KAFKA_INVENTORY_INSTANCE_EVENT_TOPIC_PATTERN`*`     | (ENV\\.)(.*\\.)inventory.instance | Custom Inventory Instance Event topic name pattern                                                                                                                                    |\n| KAFKA_INVENTORY_INSTANCE_EVENT_CONCURRENCY`*`       | 1                               | Custom number of kafka concurrent threads for Inventory Instance message consuming.                                                                                                   |\n| KAFKA_RETRY_INTERVAL_MS`*`                          | 2000                            | Specifies time to wait before reattempting message processing.                                                                                                                        |\n| KAFKA_RETRY_DELIVERY_ATTEMPTS`*`                    | 6                               | Specifies how many queries attempt to perform after the first one failed.                                                                                                             |\n| KAFKA_WORK_SEARCH_INDEX_TOPIC`*`                    | linked-data.work                | Custom Work Search Index topic name                                                                                                                                                   |\n| KAFKA_WORK_SEARCH_INDEX_TOPIC_PARTITIONS`*`         | 1                               | Custom Work Search Index topic partitions number                                                                                                                                      |\n| KAFKA_WORK_SEARCH_INDEX_TOPIC_REPLICATION_FACTOR`*` | -                               | Custom Work Search Index topic replication factor                                                                                                                                     |\n| KAFKA_INVENTORY_INSTANCE_INGRESS_EVENT_TOPIC`*`     | inventory.instance_ingress      | Custom Inventory Instance Ingress Event topic name                                                                                                                                    |\n| CACHE_TTL_SPEC_RULES_MS                             | 18000000                        | Specifies time to live for `spec-rules` cache                                                                                                                                         |\n| CACHE_TTL_SETTINGS_ENTRIES_MS                       | 18000000                        | Specifies time to live for `settings-entries` cache                                                                                                                                   |\n| CACHE_TTL_MODULE_STATE_MS                           | 18000000                        | Specifies time to live for `module-state` cache                                                                                                                                       |\n* Applicable only in FOLIO mode\n## REST API\nFull list of APIs are documented in [src/main/resources/swagger.api/mod-linked-data.yaml](https://github.com/folio-org/mod-linked-data/blob/master/src/main/resources/swagger.api/mod-linked-data.yaml).\nDetails of few important APIs are provided below.\n### Creating Work resources\nAt present, API support creation of Work resource (with many other resource types included, like Instance).\n\nResources can be created by making a POST request to the `/linked-data/resource` endpoint.\nRefer [src/main/resources/swagger.api/schema/resourceRequestDto.json](https://github.com/folio-org/mod-linked-data/blob/master/src/main/resources/swagger.api/schema/resourceRequestDto.json) for the schema of the request body.\n#### Example request for creating a Work resource:\n```bash\ncurl --location '{{ base-uri }}/linked-data/resource' \\\n--header 'x-okapi-tenant: {{ tenant identifier }}' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--header 'x-okapi-token: {{ token }} \\\n--data '{\n    \"resource\": {\n    \"http://bibfra.me/vocab/lite/Work\":{\n      \"http://bibfra.me/vocab/marc/title\":[\n        {\n          \"http://bibfra.me/vocab/marc/Title\":{\n            \"http://bibfra.me/vocab/bflc/nonSortNum\":[\n              \"4\"\n            ],\n            \"http://bibfra.me/vocab/marc/mainTitle\":[\n              \"The main title\"\n            ],\n            \"http://bibfra.me/vocab/marc/partNumber\":[\n              \"1\"\n            ],\n            \"http://bibfra.me/vocab/marc/partName\":[\n              \"part 1\"\n            ]\n          }\n        }\n      ],\n      \"http://bibfra.me/vocab/marc/governmentPublication\":[\n        {\n          \"http://bibfra.me/vocab/marc/term\":[\n            \"Government\"\n          ],\n          \"http://bibfra.me/vocab/lite/link\":[\n            \"http://id.loc.gov/vocabulary/mgovtpubtype/g\"\n          ]\n        }\n      ],\n      \"http://bibfra.me/vocab/lite/dateStart\":[\n        \"2024\"\n      ],\n      \"http://bibfra.me/vocab/marc/originPlace\":[\n        {\n          \"http://bibfra.me/vocab/lite/label\":[\n            \"United States\"\n          ],\n          \"http://bibfra.me/vocab/lite/name\":[\n            \"United States\"\n          ],\n          \"http://bibfra.me/vocab/lite/link\":[\n            \"http://id.loc.gov/vocabulary/countries/xxu\"\n          ]\n        }\n      ],\n      \"http://bibfra.me/vocab/marc/targetAudience\":[\n        {\n          \"http://bibfra.me/vocab/marc/term\":[\n            \"Preschool\"\n          ],\n          \"http://bibfra.me/vocab/lite/link\":[\n            \"http://id.loc.gov/vocabulary/maudience/pre\"\n          ]\n        }\n      ],\n      \"http://bibfra.me/vocab/marc/tableOfContents\":[\n        \"Table of contents\"\n      ],\n      \"http://bibfra.me/vocab/marc/summary\":[\n        \"Summary note\"\n      ],\n      \"http://bibfra.me/vocab/lite/classification\":[\n        {\n          \"http://bibfra.me/vocab/marc/code\":[\n            \"Lib-Congress-number\"\n          ],\n          \"http://bibfra.me/vocab/marc/source\":[\n            \"lc\"\n          ],\n          \"http://bibfra.me/vocab/marc/itemNumber\": [\n            \"Lib-Congress-number-item\"\n          ],\n          \"http://bibfra.me/vocab/marc/status\": [\n            {\n              \"http://bibfra.me/vocab/lite/label\": [\n                \"used by assigner\"\n              ],\n              \"http://bibfra.me/vocab/lite/link\": [\n                \"http://id.loc.gov/vocabulary/mstatus/uba\"\n              ]\n            }\n          ]\n        },\n        {\n          \"http://bibfra.me/vocab/marc/code\":[\n            \"Dewey-number\"\n          ],\n          \"http://bibfra.me/vocab/marc/source\":[\n            \"ddc\"\n          ],\n          \"http://bibfra.me/vocab/marc/itemNumber\": [\n            \"Dewey-number-item\"\n          ],\n          \"http://bibfra.me/vocab/marc/editionNumber\": [\n            \"Dewey-number-editionNumber\"\n          ],\n          \"http://bibfra.me/vocab/marc/edition\": [\n            \"Dewey-number-edition\"\n          ]\n        }\n      ],\n      \"http://bibfra.me/vocab/marc/content\":[\n        {\n          \"http://bibfra.me/vocab/marc/term\":[\n            \"cartographic image\"\n          ],\n          \"http://bibfra.me/vocab/lite/link\":[\n            \"http://id.loc.gov/vocabulary/contentTypes/cri\"\n          ]\n        }\n      ],\n      \"http://bibfra.me/vocab/lite/language\":[\n        {\n          \"http://bibfra.me/vocab/marc/term\": [\n            \"English\"\n          ],\n          \"http://bibfra.me/vocab/lite/link\": [\n            \"http://id.loc.gov/vocabulary/languages/eng\"\n          ]\n        }\n      ],\n      \"_notes\":[\n        {\n          \"type\":[\n            \"http://bibfra.me/vocab/marc/bibliographyNote\"\n          ],\n          \"value\":[\n            \"Bib note\"\n          ]\n        },\n        {\n          \"type\":[\n            \"http://bibfra.me/vocab/marc/languageNote\"\n          ],\n          \"value\":[\n            \"Language note\"\n          ]\n        },\n        {\n          \"type\":[\n            \"http://bibfra.me/vocab/lite/note\"\n          ],\n          \"value\":[\n            \"General note\"\n          ]\n        }\n      ],\n      \"http://bibfra.me/vocab/scholar/dissertation\": [\n        {\n          \"http://bibfra.me/vocab/lite/label\": [\n            \"label\"\n          ],\n          \"http://bibfra.me/vocab/marc/degree\": [\n            \"degree\"\n          ],\n          \"http://bibfra.me/vocab/marc/dissertationYear\": [\n            \"dissertation year\"\n          ],\n          \"http://bibfra.me/vocab/marc/dissertationNote\": [\n            \"dissertation note\"\n          ],\n          \"http://bibfra.me/vocab/marc/dissertationID\": [\n            \"dissertation id\"\n          ]\n        }\n      ]\n    }\n    }\n}'\n```\n### Updating resources\nResource can be updated by making a PUT request to the `/linked-data/resource/{id}` endpoint. At present, only Work resources can be updated through the API.\nRefer [src/main/resources/swagger.api/schema/resourceRequestDto.json](https://github.com/folio-org/mod-linked-data/blob/master/src/main/resources/swagger.api/schema/resourceRequestDto.json) for the schema of the request body.\n### Viewing a graph node\nA graph node can be viewed by making a GET request to the `/linked-data/resource/{id}/graph` endpoint. Any kind of resources can be retrieved through this API.\n\n```bash\ncurl --location '{{ base-uri }}/linked-data/resource/{id}/graph' \\\n--header 'x-okapi-tenant: {tenant}' \\\n--header 'x-okapi-token: {token}'\n```\n# Integration with FOLIO\nWhen running in FOLIO mode, this module integrates with multiple Folio modules via Kafka.\n## Search module\nThe Linked Data module pushes a new and updated Work resource descriptions to the Kafka topic defined by KAFKA_WORK_SEARCH_INDEX_TOPIC env variable.\nThe [mod-search](https://github.com/folio-org/mod-search) module consumes message and indexes a Work resource descriptions in [OpenSearch](https://aws.amazon.com/opensearch-service/) index for search and retrieval.\n## Source Record Storage module\nThe [mod-source-record-storage](https://github.com/folio-org/mod-source-record-storage) module pushes Source Record domain events to the topic defined by KAFKA_SOURCE_RECORD_DOMAIN_EVENT_TOPIC_PATTERN env variable.\nThe Linked Data module consumes a message and creates/updates a corresponding Authority resource in Linked Data graph.\n## Inventory module\n1. The Linked Data module pushes a new and updated Instance resource descriptions to the Kafka topic defined by KAFKA_INVENTORY_INSTANCE_INGRESS_EVENT_TOPIC env variable.\nThe [mod-inventory](https://github.com/folio-org/mod-inventory) module consumes message and creates/updates a corresponding Instance resource in the Inventory storage,\nplus sends according message to the [mod-source-record-storage](https://github.com/folio-org/mod-source-record-storage) to make it create/update according source record.\n2. The [mod-inventory](https://github.com/folio-org/mod-inventory) module pushes Inventory Instance events to the topic defined by KAFKA_INVENTORY_INSTANCE_EVENT_TOPIC_PATTERN env variable.\nThe Linked Data module consumes a message and updates a corresponding Instance resource in Linked Data graph, but only regarding suppression flags.\n\n# Possible error responses\nAll error responses are listed in [src/main/resources/errors.yml](https://github.com/folio-org/mod-linked-data/blob/master/src/main/resources/errors.yml).\nValidation error could contain various message codes listed in [src/main/resources/ValidationMessages.properties](https://github.com/folio-org/mod-linked-data/blob/master/src/main/resources/ValidationMessages.properties).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Fmod-linked-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffolio-org%2Fmod-linked-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Fmod-linked-data/lists"}