{"id":13565341,"url":"https://github.com/filip26/titanium-json-ld","last_synced_at":"2025-05-15T15:04:26.646Z","repository":{"id":37080629,"uuid":"263463271","full_name":"filip26/titanium-json-ld","owner":"filip26","description":"A JSON-LD 1.1 Processor \u0026 API","archived":false,"fork":false,"pushed_at":"2025-04-02T20:31:59.000Z","size":4944,"stargazers_count":143,"open_issues_count":2,"forks_count":34,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-07T21:08:30.642Z","etag":null,"topics":["java","json","json-ld","json-ld-11","jsonld","linked-data","rdf","semantic-web","structured-data"],"latest_commit_sha":null,"homepage":"https://apicatalog.com","language":"Java","has_issues":true,"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/filip26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["filip26"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://wise.com/share/filipk558","https://paypal.me/FilipKolarik"]}},"created_at":"2020-05-12T22:10:07.000Z","updated_at":"2025-04-02T20:31:56.000Z","dependencies_parsed_at":"2023-10-10T17:34:27.345Z","dependency_job_id":"b2b6bb21-9b73-4961-bc06-ffc68d1a7baa","html_url":"https://github.com/filip26/titanium-json-ld","commit_stats":{"total_commits":1347,"total_committers":16,"mean_commits":84.1875,"dds":0.1180400890868597,"last_synced_commit":"b8dc5f879f94d0f857a046757c89bd96e5a638d5"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Ftitanium-json-ld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Ftitanium-json-ld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Ftitanium-json-ld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filip26%2Ftitanium-json-ld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filip26","download_url":"https://codeload.github.com/filip26/titanium-json-ld/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364270,"owners_count":22058878,"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","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":["java","json","json-ld","json-ld-11","jsonld","linked-data","rdf","semantic-web","structured-data"],"created_at":"2024-08-01T13:01:44.998Z","updated_at":"2025-05-15T15:04:26.609Z","avatar_url":"https://github.com/filip26.png","language":"Java","funding_links":["https://github.com/sponsors/filip26","https://wise.com/share/filipk558","https://paypal.me/FilipKolarik"],"categories":["Java","Implementations","Programming","Formats"],"sub_categories":["Java"],"readme":"# Titanium JSON-LD 1.1 Processor \u0026 API\n\nAn implementation of the [JSON-LD 1.1](https://www.w3.org/TR/json-ld/) (JSON-based Serialization for Linked Data) specification in Java, utilizing [Jakarta JSON Processing](https://github.com/eclipse-ee4j/jsonp).\n\n### Goals\n- Full conformance to the specification\n- Secure, stable, fast, high-quality code (covered by **~1800 tests**)\n- Minimal external dependencies\n- Easy to use\n\n### Status\n\n[![Java 11 CI](https://github.com/filip26/titanium-json-ld/actions/workflows/java11-build.yml/badge.svg)](https://github.com/filip26/titanium-json-ld/actions/workflows/java11-build.yml)\n[![Android (Java 8) CI](https://github.com/filip26/titanium-json-ld/actions/workflows/java8-build.yml/badge.svg)](https://github.com/filip26/titanium-json-ld/actions/workflows/java8-build.yml)\n[![CodeQL](https://github.com/filip26/titanium-json-ld/actions/workflows/codeql.yml/badge.svg)](https://github.com/filip26/titanium-json-ld/actions/workflows/codeql.yml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c530c6b43b0243c08ce81521c5b4cf6a)](https://app.codacy.com/gh/filip26/titanium-json-ld/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/c530c6b43b0243c08ce81521c5b4cf6a)](https://app.codacy.com/gh/filip26/titanium-json-ld/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage)\n[![Maven Central](https://img.shields.io/maven-central/v/com.apicatalog/titanium-json-ld.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:com.apicatalog%20AND%20a:titanium-json-ld)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n### Extensions\n\n- [LD-CLI](https://github.com/filip26/ld-cli) - A native command line utility for Ubuntu, Mac, and Windows\n- [JSON-LD-star](https://json-ld.github.io/json-ld-star) - Expansion and compaction built-in support (experimental)\n- [Titanium RDFC](https://github.com/filip26/titanium-rdfc) - W3C Standard RDF Dataset Canonicalization\n- [Titanium N-QUADS](https://github.com/filip26/titanium-rdf-n-quads) - W3C RDF 1.1 N-Quads\n- [Titanium JCS](https://github.com/filip26/titanium-jcs) - RFC 8785 JSON Canonicalization Scheme (JCS)\n- [Iridium CBOR-LD](https://github.com/filip26/iridium-cbor-ld) - A CBOR-based Processor for Linked Data\n- [RDF-URDNA](https://github.com/simon-greatrix/rdf-urdna) - Universal RDF Dataset Normalization Algorithm 2015\n\n## Table of Contents  \n- [Conformance](#conformance)\n- [Examples](#examples)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [Resources](#resources)\n- [Commercial Support](#commercial-support)\n\n## Conformance\n\n| Feature | Tests | Pass | Status | Notes |\n| --- | ---: | ---: | ---: | --- |\n| [Expansion](https://www.w3.org/TR/json-ld/#expanded-document-form) | 373 | 373 | 100% | |\n| [Compaction](https://www.w3.org/TR/json-ld/#compacted-document-form) | 243 | 243 | 100% | |\n| [Flattening](https://www.w3.org/TR/json-ld/#flattened-document-form) | 55 | 55 | 100% | |\n| [JSON-LD to RDF](https://www.w3.org/TR/json-ld/#relationship-to-rdf) | 453 | 451 | 99.5% | \u003cul\u003e\u003cli\u003e[te075 - @vocab as blank node identifier](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#te075)\u003c/li\u003e\u003cli\u003e[tli12 - List with bad @base](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#tli12)\u003c/li\u003e\u003c/ul\u003e |\n| [RDF to JSON-LD](https://www.w3.org/TR/json-ld/#relationship-to-rdf) | 51 | 51 | 100% | |\n| [Framing](https://www.w3.org/TR/json-ld11-framing/#framing) | 89 | 88 | 98.8% | \u003cul\u003e\u003cli\u003e[t0059 - @embed: @last](https://w3c.github.io/json-ld-framing/tests/frame-manifest#t0059)\u003c/li\u003e\u003c/ul\u003e |\n| [Remote Document and Context Retrieval](https://www.w3.org/TR/json-ld11-api/#remote-document-and-context-retrieval) | 18 | 17 | 94.4% | \u003cul\u003e\u003cli\u003e[t0013 - HTML document](https://w3c.github.io/json-ld-api/tests/remote-doc-manifest#t0013)\u003c/li\u003e\u003c/ul\u003e |\n\nSee [EARL results from the JSON-LD 1.1 Test Suite](https://w3c.github.io/json-ld-api/reports/#subj_Titanium_JSON_LD_Java) for more details.\n\n## Examples\n\nTitanium provides a high-level [JsonLd](https://javadoc.io/doc/com.apicatalog/titanium-json-ld/latest/com/apicatalog/jsonld/JsonLd.html) API to interact with the processor.\n\n### Transformations\n\n```javascript\n// Expansion\nJsonLd.expand(\"https://w3c.github.io/json-ld-api/tests/expand/0001-in.jsonld\")\n      .ordered()\n      .get();\n\nJsonLd.expand(\"file:/home/filip/document.json\")    // HTTP(S) and File schemes supported\n      .context(\"file:/home/filip/context.jsonld\")  // external context\n      .get();\n\n// Compaction\nJsonLd.compact(\"https://example/expanded.jsonld\", \"https://example/context.jsonld\")\n      .compactToRelative(false)\n      .get();\n\n// Flattening\nJsonLd.flatten(\"https://example/document.jsonld\").get();\n\n// JSON-LD to RDF \nJsonLd.toRdf(\"https://example/document.jsonld\").get();\n// or, since 1.6.0\nJsonLd.toRdf(\"https://example/document.jsonld\").provide(RdfConsumer); \n\n// Standard RDF Dataset Canonicalization with Titanium RDFC, since 1.6.0\nvar canonicalizer = new RdfCanon.create(...);\nJsonLd.toRdf(\"https://example/document.jsonld\").provide(canonicalizer);\ncanonicalizer.provide(RdfConsumer);\n// or, with NQuadsWriter\ncanonicalizer.provide(new NQuadsWriter(...));\n\n// RDF to JSON-LD\nJsonLd.fromRdf(\"https://example/document.nq\").get();\n\n// Framing\nJsonLd.frame(\"https://example/document.jsonld\", \"https://example/frame.jsonld\").get();\n```\n\n### Local JSON Document\n\n```javascript\n// Create a JSON document from InputStream or Reader\nDocument document = JsonDocument.of(InputStream) or JsonDocument.of(Reader) ...\n\n// Expand the document\nJsonLd.expand(document).get();\n\n// Compact the document with a context document\nJsonLd.compact(document, contextDocument).get();\n...\n```\n\n### Processing Timeout [Experimental]\nThe processor will be terminated after a specified duration. \nPlease note that the duration does not include the time taken by `DocumentLoader` for processing. \nYou must set up a separate read timeout for document loading.\n\n```javascript\n// Available since 1.4.0\nJsonLd.expand(...).timeout(duration)...get();\n```\n\n### HTTP Document Loader Timeout\nYou can configure a custom HTTP document loader instance with a set read timeout.\n\n```javascript\n// Available since 1.4.0 - Set read timeout for HTTP document loader\nstatic DocumentLoader LOADER = HttpLoader.defaultInstance().timeout(Duration.ofSeconds(30));\n...\nJsonLd.expand(...).loader(LOADER).get();\n```\n\n### Document Caching\nConfigure an LRU-based cache for loading documents. The `capacity` argument specifies the size of the LRU cache.\n\n```javascript\n// Available since 1.4.0 - Load documents with an LRU-based cache\nJsonLd.toRdf(\"https://example/document.jsonld\").loader(new LRUDocumentCache(loader, capacity)).get();\n```\n\nYou can reuse an instance of `LRUDocumentCache` across multiple calls to benefit from cached documents.\n\n```javascript\n// Available since 1.4.0 - Reuse LRU cache across multiple document loads\nDocumentLoader cachedLoader = new LRUDocumentCache(loader, capacity);\n\nJsonLd.toRdf(\"https://example/document.jsonld\").loader(cachedLoader).get();\nJsonLd.toRdf(\"https://example/another-document.jsonld\").loader(cachedLoader).get();\n```\n\n### Undefined Terms Processing Policy\n\nSet a processing policy for undefined terms. The default policy is `Ignore`.\n\n```javascript\n// Available since 1.4.1 - Define processing policy for undefined terms\nJsonLd.expand(...).undefinedTermsPolicy(Fail|Warn|Ignore).get();\n```\n\n## Installation\n\n### Titanium\n\n#### Maven (Java 11+)\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.apicatalog\u003c/groupId\u003e\n    \u003cartifactId\u003etitanium-json-ld\u003c/artifactId\u003e\n    \u003cversion\u003e1.6.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Gradle (Java 8+, Android API Level \u003e= 24)\n\n```gradle\nimplementation(\"com.apicatalog:titanium-json-ld-jre8:1.6.0\")\n```\n\n### JSON-P Provider\n\nEnsure that the JSON-P provider is added to the classpath if it is not already present.\n\n#### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.glassfish\u003c/groupId\u003e\n    \u003cartifactId\u003ejakarta.json\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Gradle\n\n```gradle\nimplementation(\"org.glassfish:jakarta.json:2.0.1\")\n```\n\n## Documentation\n\n[![javadoc](https://javadoc.io/badge2/com.apicatalog/titanium-json-ld/javadoc.svg)](https://javadoc.io/doc/com.apicatalog/titanium-json-ld)\n\n\n## Contributing\n\nAll PR's welcome!\n\n- Develop\n  - Implement a new feature \n  - Fix an existing issue\n  - Improve an existing implementation\n- Test\n  - Report a bug\n  - Implement a new test case\n- Document\n  - Write Javadoc comments\n  - Write a tutorial or guide\n  - Proofread existing documentation for clarity and accuracy\n- Promote\n  - Star, share, the project\n  - Write an article or blog post about the project\n- Sponsor\n  - Sponsorship gives your requests top priority\n\n### Building\n\nFork and clone the project repository.\n\n#### Java 11\n\n```bash\n\u003e cd titanium-json-ld\n\u003e mvn clean package\n```\n\n#### Java 8\n\n```bash\n\u003e cd titanium-json-ld\n\u003e mvn -f pom_jre8.xml clean package\n```\n\n## Resources\n- [JSON-LD 1.1](https://www.w3.org/TR/json-ld/)\n- [JSON-LD 1.1 Processing Algorithms and API](https://www.w3.org/TR/json-ld-api/)\n- [JSON-LD 1.1 Framing](https://www.w3.org/TR/json-ld-framing/)\n- [JSON-LD Best Practices](https://w3c.github.io/json-ld-bp/)\n- [JSON-LD-star](https://json-ld.github.io/json-ld-star/)\n- [JSON-LD Playground](https://json-ld.org/playground/)\n\n## Commercial Support\nCommercial support is available at filip26@gmail.com\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilip26%2Ftitanium-json-ld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilip26%2Ftitanium-json-ld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilip26%2Ftitanium-json-ld/lists"}