{"id":17875921,"url":"https://github.com/pietercolpaert/ldfetch","last_synced_at":"2025-08-25T00:12:21.685Z","repository":{"id":21720949,"uuid":"93863904","full_name":"pietercolpaert/ldfetch","owner":"pietercolpaert","description":"An HTTP client for RDF resources","archived":false,"fork":false,"pushed_at":"2024-01-10T06:46:49.000Z","size":4853,"stargazers_count":15,"open_issues_count":11,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T09:45:27.836Z","etag":null,"topics":["http-client","hydra","linked-data","nodejs","rdf","rdf-resources","triples"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ldfetch","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pietercolpaert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-06-09T13:56:21.000Z","updated_at":"2022-10-13T17:29:30.000Z","dependencies_parsed_at":"2024-06-19T01:51:03.475Z","dependency_job_id":"1c64b7da-4e8a-4462-8ff7-56a9f09ce642","html_url":"https://github.com/pietercolpaert/ldfetch","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/pietercolpaert/ldfetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietercolpaert%2Fldfetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietercolpaert%2Fldfetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietercolpaert%2Fldfetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietercolpaert%2Fldfetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pietercolpaert","download_url":"https://codeload.github.com/pietercolpaert/ldfetch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietercolpaert%2Fldfetch/sbom","scorecard":{"id":733538,"data":{"date":"2025-08-11","repo":{"name":"github.com/pietercolpaert/ldfetch","commit":"428d3fd196c9ecd4a914372e1658c3ae683dd149"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T15:06:09.368Z","repository_id":21720949,"created_at":"2025-08-22T15:06:09.369Z","updated_at":"2025-08-22T15:06:09.369Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271983468,"owners_count":24853809,"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-08-24T02:00:11.135Z","response_time":111,"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":["http-client","hydra","linked-data","nodejs","rdf","rdf-resources","triples"],"created_at":"2024-10-28T11:26:11.633Z","updated_at":"2025-08-25T00:12:21.666Z","avatar_url":"https://github.com/pietercolpaert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linked Data Fetch: a HTTP client for RDF resources\n\n[![npm version](https://badge.fury.io/js/ldfetch.svg)](https://badge.fury.io/js/ldfetch) [![CDN JSDelivr](https://data.jsdelivr.com/v1/package/npm/ldfetch/badge)](https://cdn.jsdelivr.net/npm/ldfetch/dist/main.js)\n\nFetch Linked Data documents within your browser, from the command line, or from your NodeJS script.\n\n```bash\nnpm install -g ldfetch\n```\nIn order to use it as a library, you can leave out the `-g`.\n\n## Features\n\nSupports these features over standard `fetch`:\n * Sets an accept header for negotiating an RDF serialization\n * Uses [rdf-parse](https://github.com/rubensworks/rdf-parse.js) by Ruben Taelman to parse a wide variety of RDF serializations\n * Returns the Triples/Quads containing the data in the [RDFJS triple representation](http://rdf.js.org/)\n * Returns the URL of the document after redirects\n * Emits events for: `request`, `response`, `redirect`, `cache-hit`, `cache-miss` and `parsed`\n\nFeatures for the NodeJS framework in specific:\n * Automatically follows redirects\n * Able to be configured with HTTP caching\n * Able to limit the amount of concurrent requests and schedule these\n\nFeatures for the Command Line:\n * Writes data on any URL in TriG on stdout\n * Extra features to automatically follow links (see `ldfetch --help` after `npm install -g ldfetch`)\n\n## How to use it\n\n### Command line\n\n![Quite easy](https://raw.githubusercontent.com/pietercolpaert/ldfetch/master/tty.gif \"Straightforward to use this on a CLI\")\n\nYou can also use [JSON-LD framing](https://json-ld.org/spec/latest/json-ld-framing/) from the CLI: `ldfetch https://pietercolpaert.be/ --frame {}` to return a JSON-LD object complying to your frame.\n\nFor full, well tested and modular SPARQL or GraphQL Web Querying, we refer to the [Comunica project](http://comunica.linkeddatafragments.org).\n\n### Browser\n\nAnd using Browserify you can compile it for browser purposes:\n```bash\nnpm run build\n```\n\n```html\n\u003cscript src=\"dist/main.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  let fetcher = new window.ldfetch();\n  let main = async function () {\n    let objects = await fetcher.get('http://ruben.verborgh.org').then(response =\u003e {\n      //LDFetch also exposes a frame function that can be used on the triples\n      //See https://json-ld.org/spec/latest/json-ld-framing/\n      return fetcher.frame(response.triples, {'@graph':{}});\n    });\n    console.log(objects);\n  }\n  try {\n    main();\n  } catch (e) {\n    console.error(e);\n  }\n\u003c/script\u003e\n```\n\n### NodeJS\n\nA small example fetching the next page of a paged collection and returning the url\n```javascript\n  let ldfetch = require('../lib/ldfetch.js');\n  try {\n    let url = 'https://graph.irail.be/sncb/connections/';\n    let fetch = new ldfetch({}); //options: allow to add more headers if needed\n    let response = await fetch.get(url); \n    for (let i = 0; i \u003c response.triples.length; i ++) {\n      let triple = response.triples[i];\n      if (triple.subject.value === response.url \u0026\u0026 triple.predicate.value === 'http://www.w3.org/ns/hydra/core#next') {\n        console.error('The next page is: ', triple.object.value);\n      }\n    }\n    fetch.frame(response.triples, {'http://www.w3.org/ns/hydra/core#next': {}}).then(object =\u003e {\n      console.error('Or you can also use the JSON-LD frame functionality to get what you want in a JS object', object);\n    });\n  } catch (e) {\n    console.error(e);\n  }\n```\n  \nIf HTTP requests with specific headers are needed, the `options` object may be used by defining an object inside of it, named `headers` containing HTTP header names and values.\n\nThe response object will look like this:\n```json\n{\n  \"responseCode\": 200,\n  \"triples\": [{},{},{}],\n  \"url\": \"https://{url after redirects}\"\n}\n```\n\n## License and copyright\n\nThis library was developed by [Pieter Colpaert](https://pietercolpaert.be) and contributors. The source code is available under an MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpietercolpaert%2Fldfetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpietercolpaert%2Fldfetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpietercolpaert%2Fldfetch/lists"}