{"id":19179486,"url":"https://github.com/hypermedia-app/webpack-loader-rdf","last_synced_at":"2025-06-22T05:36:40.591Z","repository":{"id":42530694,"uuid":"442195915","full_name":"hypermedia-app/webpack-loader-rdf","owner":"hypermedia-app","description":"Bundle static RDF documents with webpack","archived":false,"fork":false,"pushed_at":"2023-01-08T03:19:43.000Z","size":208,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-04T03:12:21.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypermedia-app.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-27T15:24:21.000Z","updated_at":"2022-05-06T07:51:20.000Z","dependencies_parsed_at":"2023-02-08T04:31:44.074Z","dependency_job_id":null,"html_url":"https://github.com/hypermedia-app/webpack-loader-rdf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermedia-app%2Fwebpack-loader-rdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermedia-app%2Fwebpack-loader-rdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermedia-app%2Fwebpack-loader-rdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermedia-app%2Fwebpack-loader-rdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypermedia-app","download_url":"https://codeload.github.com/hypermedia-app/webpack-loader-rdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240258116,"owners_count":19772969,"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":[],"created_at":"2024-11-09T10:43:19.170Z","updated_at":"2025-02-23T01:40:27.042Z","avatar_url":"https://github.com/hypermedia-app.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-loader-rdf [![Published on npm](https://img.shields.io/npm/v/webpack-loader-rdf.svg)](https://npm.im/webpack-loader-rdf)\n\nRDF/JS parsers (and serializers) are quite heavy, only work asynchronously, and depend on various node-native modules, such as `stream` and `crypto`. This can be a nuisance when static RDF is imported early in an application becasue it unnecessarily increases the size of the initial bundle and thus slows down the initial page load.\n\nA webpack loader reserializes RDF into JS code so that it can be bundled along all other sources.\n\n## Usage\n\n```\nnpm i -D webpack-loader-rdf\n```\n\nIn `webpack.config.js`\n\n```js\nmodule.exports = {\n  module: {\n    rules: [{\n      test: /\\.(ttl|nt|nq|rdf|jsonld|trig)$/,\n      use: 'webpack-loader-rdf',\n    }],\n  }\n}\n```\n\nIn code:\n\n1. Import your favourire [RDF/JS DataFatory](http://rdf.js.org/data-model-spec/#datafactory-interface)\n2. Default-import RDF module\n3. Combine the two to get a `Quad[]`\n\n```js\nimport * as $rdf from '@rdf-esm/data-model'\nimport getPersonQuads from './data/person.ttl`\n\nconst personQuads = getPersonQuads($rdf)\n```\n\n## In TypeScript\n\nDeclare this module, for example in a `global.d.ts`, to get types for Turtle imports\n\n```typescript \ndeclare module '*.ttl' {\n  import { Quad, DataFactory } from 'rdf-js'\n\n  export default function (factory: DataFactory): Quad[]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypermedia-app%2Fwebpack-loader-rdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypermedia-app%2Fwebpack-loader-rdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypermedia-app%2Fwebpack-loader-rdf/lists"}