{"id":15437102,"url":"https://github.com/awwright/rdfa-template","last_synced_at":"2025-09-14T13:40:31.865Z","repository":{"id":139430676,"uuid":"158896985","full_name":"awwright/rdfa-template","owner":"awwright","description":"Generate RDFa documents from RDF graphs","archived":false,"fork":false,"pushed_at":"2020-08-13T22:57:17.000Z","size":131,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T14:17:26.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://awwright.github.io/rdfa-template/","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/awwright.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":"2018-11-24T02:52:25.000Z","updated_at":"2023-05-25T18:50:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"84694fd0-53bf-46e3-8e1a-53f3aa8c04c3","html_url":"https://github.com/awwright/rdfa-template","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/awwright/rdfa-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Frdfa-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Frdfa-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Frdfa-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Frdfa-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awwright","download_url":"https://codeload.github.com/awwright/rdfa-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Frdfa-template/sbom","scorecard":{"id":219719,"data":{"date":"2025-08-11","repo":{"name":"github.com/awwright/rdfa-template","commit":"f29d585b501d45e28e36e451ab4a4aea5b52e1ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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"}}]},"last_synced_at":"2025-08-17T02:14:32.349Z","repository_id":139430676,"created_at":"2025-08-17T02:14:32.349Z","updated_at":"2025-08-17T02:14:32.349Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275114258,"owners_count":25407923,"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-09-14T02:00:10.474Z","response_time":75,"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-10-01T18:55:05.478Z","updated_at":"2025-09-14T13:40:31.845Z","avatar_url":"https://github.com/awwright.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdfa-template\n\nFill variables on an RDFa page with data from an RDF graph.\n\nGuarentees that the generated RDFa document will contain data also present in the source graph.\n\nAn RDFa template document is first compiled into one or more queries: one top query, and any additional subqueries nested within other queries.\nThe top-level query is filled out into any number of documents; if the top-level query has zero variables to expand, it's filled out into exactly one document (because the multiplicative identity is one).\nIn each of these documents, subqueries may be attached to elements, which are cloned for every subquery result. Subqueries may refer to variables from higher-level queries.\n\n## Features\n\n### Generate a graph query from placeholders in an RDFa document\n\nUse `rdfat.parse(baseIRI, template)` to parse a given DOM document `template`:\n\n```javascript\nconst parse = require('rdfa-template').parserFrom(require('rdfa').RDFaXMLParser);\nconst tpl = parse(document.location.toString(), document);\nparser.queries.forEach(function(v){\n\tconsole.log(v.toString());\n});\n```\n\n### Generate a recordset of documents given a top-level query\n\nDocuments may have variables that are filled in to match statements in the graph. The resulting document will produce only RDF data that exists in the database.\n\nUse the `RDFaTemplateParser#evaluate` call to get this record set of variable bindings:\n\n```xml\n\u003chtml\n  xmlns=\"http://www.w3.org/1999/xhtml\"\n  prefix=\"dc: http://purl.org/dc/terms/\"\n  \u003e\n  \u003chead\u003e\u003ctitle\u003e{?title}\u003c/title\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1 property=\"dc:title\"\u003e{?title}\u003c/h1\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n```javascript\nconst baseIRI = 'http://example.com/';\nconst template = parse(baseIRI, templateDocument);\nconst recordset = template.evaluate(dataGraph, {});\nassert.equal(recordset.length, 1);\nconst filledDOM = template.fillSingle(dataGraph, recordset[0]);\n```\n\n\n### Fill variables in a document given top-level query bindings\n\nDocuments may have variables that are filled in to match statements in the graph. The resulting document will produce RDF that exists in the database.\n\nUse the `RDFaTemplateParser#evaluate` call to get this record set of variable bindings:\n\n\n```javascript\nconst baseIRI = 'http://example.com/';\nconst template = parse(baseIRI, templateDocument);\nconst documentList = template.fillRecordset(dataGraph, {});\n```\n\n\n### Repeat an element for multiple matches\n\nSubqueries are supported using a `subquery` attribute. This will execute an additional query and use the results for a specified purpose.\n\nUse `subquery=\"each\"` to repeat that element multiple times for each match:\n\n```xml\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eMy home-page\u003c/title\u003e\n    \u003cmeta subquery=\"each\" property=\"http://purl.org/dc/terms/creator\" content-bind=\"{?content}\" /\u003e\n    \u003clink subquery=\"each\" rel=\"related\" href-bind=\"{?topic}\" /\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e...\u003c/body\u003e\n\u003c/html\u003e\n```\n\nIf multiple values for the \"related\" link are specified in the graph, this will output the element multiple times, one for every match.\n\n\n## Interface\n\n### parserFrom(RDFaSuper)\n\nGenerate a parser following the rules defined by the given RDFaParser `RDFaSuper`. Returns a parse function with the `\u003cparse\u003e` interface below.\n\nThis can typically be used like:\n\n```javascript\nconst rdfa = require('rdfa');\nconst rdfaParserFrom = require('rdfa-template').parserFrom;\nconst parse = rdfaParserFrom(rdfa.RDFaXMLParser);\n```\n\n\n### \u003cparse\u003e(base, document, options)\n\n* base: URI base of document (location where document was downloaded)\n* document: DOM document\n* options: object with some settings (none yet)\n\nReturns: DocumentGenerator (see below)\n\n\n### DocumentGenerator#evaluate(db, bindings)\n\n* db: Graph/Dataset object\n* bindings: list of variable bindings to apply\n\nReturns an array of variable bindings for the the top-level query in the document, run against `db`.\n\nIf there are no variables, returns a single empty result.\n\nIf `bindings` is supplied, results are filtered (that is, query is initialized with given bindings).\n\n\n### DocumentGenerator#data(bindings)\n\n* bindings: optional list of variable bindings to apply\n\nReturns a list of the RDF statements that can be extracted from the document.\n\nIf any variables in `bindings` are specified, they will be used to generate additional RDF statements.\n\n\n### DocumentGenerator#fillRecordset(db, bindings)\n\n* db: Graph/Dataset object\n* bindings: list of variable bindings to apply\n\nReturns an array of documents that match.\n\nIn cases where there's no variables in the top-level query, this will return a single document.\n\nThis is the same thing as first calling `evaluate` then mapping the result set through `fillSingle`.\n\n\n### DocumentGenerator#fillSingle(db, bindings)\n\n* db: Graph/Dataset object\n* bindings: list of variable bindings to apply\n\nReturns a document with values from `db` after applying `bindings` to variables.\n\n\n## Tests\n\nRun `mocha` to run tests.\n\n\n## Index of Files\n\n* bin/process.js - command line executable\n* demo/index.xhtml - Browser demo of library (run `make` first)\n* lib/query.js - library to query the RDF graph\n* test/ - Mocha tests\n* index.js - Entry point\n* Makefile - generates browser bundle\n* README.md - You're looking at it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawwright%2Frdfa-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawwright%2Frdfa-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawwright%2Frdfa-template/lists"}