{"id":13929079,"url":"https://github.com/logseq/rdf-export","last_synced_at":"2025-07-26T21:38:35.368Z","repository":{"id":166115487,"uuid":"609339608","full_name":"logseq/rdf-export","owner":"logseq","description":"Export a logseq graph to RDF","archived":false,"fork":false,"pushed_at":"2025-01-23T14:40:50.000Z","size":76,"stargazers_count":37,"open_issues_count":1,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-10T04:30:25.840Z","etag":null,"topics":["github-actions","logseq","nbb","rdf"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/logseq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-03T22:42:02.000Z","updated_at":"2025-04-04T04:22:42.000Z","dependencies_parsed_at":"2023-07-05T18:32:28.930Z","dependency_job_id":null,"html_url":"https://github.com/logseq/rdf-export","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"ec4f6341b4753e96c4ced29fc881677f2774ee0a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Frdf-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Frdf-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Frdf-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Frdf-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logseq","download_url":"https://codeload.github.com/logseq/rdf-export/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665783,"owners_count":21142123,"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":["github-actions","logseq","nbb","rdf"],"created_at":"2024-08-07T18:02:06.141Z","updated_at":"2025-04-13T04:41:50.960Z","avatar_url":"https://github.com/logseq.png","language":"Clojure","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"## Description\n\nThis is a [github action](https://github.com/features/actions) to export a\nconfigurable portion of a Logseq graph to [RDF](https://www.w3.org/RDF/). Some\nbasic validation is also done on the exported rdf file. This action can also be\nrun as a [CLI](#cli).\n\n## Usage\n\n### Setup\n\nBy default, this action is configured to export the portion of your Logseq graph that:\n\n* has class pages with properties `type:: [[Class]]`\n* has property pages with properties `type:: [[Property]]`\n* has pages with properties `type:: [[X]]` where X are pages with `type:: [[Class]]`\n\nFor an example of such a graph, see https://github.com/logseq/docs. If you would like\nto organize your graph differently, you can [configure it](#configuration).\n\n### Github Action\n\nTo setup this action, add the file `.github/workflows/ci.yml` to your graph's\ngithub repository with the following content:\n\n``` yaml\non: [push]\n\njobs:\n  rdf-export:\n    runs-on: ubuntu-latest\n    name: Test rdf export\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Export graph as RDF\n        uses: logseq/rdf-export@main\n```\n\nThat's it! This job will then run on future git pushes and build RDF files from your graph.\n\nNOTE: The above example defaults to picking up new changes. If you'd prefer to stay on a stable version use the format `logseq/rdf-export@VERSION` e.g. `logseq/rdf-export@v0.1.0`. See CHANGELOG.md for released versions.\n\n#### Action Inputs\n\nThis action can take inputs e.g.:\n\n```yaml\n- name: Export graph as RDF\n  uses: logseq/rdf-export@main\n  with:\n    rdfFile: my-graph-name.ttl\n    directory: logseq-graph-directory\n```\n\nThis action has the following inputs:\n\n##### `rdfFile`\n\n**Required:** Name of the exported rdf file. Defaults to `test.ttl`.\n\n##### `directory`\n\nOptional: The directory of the graph to rdf. Defaults to `.`.\n\n#### Use with other actions\n\nSince this action produces a valid RDF file, it is easy to save this file for\nlater usage using [upload-artifact](https://github.com/actions/upload-artifact):\n\n```yaml\n...\n- name: Export graph as RDF\n  uses: logseq/rdf-export@main\n  with:\n    rdfFile: my-graph.ttl\n\n- uses: actions/upload-artifact@v4\n  with:\n    name: Exported RDF\n    path: my-graph.ttl\n```\n\n### CLI\n\nTo use this as a CLI locally, first install\n[babashka](https://github.com/babashka/babashka#installation) and\n[clojure](https://clojure.org/guides/install_clojure). Then:\n\n```sh\n$ git clone https://github.com/logseq/rdf-export\n$ cd rdf-export \u0026\u0026 yarn install\n$ yarn global add $PWD\n```\n\nThen use it from any logseq graph directory!\n```sh\n$ logseq-rdf-export docs.ttl\nParsing 301 files...\n...\nWriting 295 triples to file docs.ttl\n```\n\n## Configuration\n\nTo configure how and what is exported to RDF, create a `.rdf-export/config.edn`\nfile in your graph's directory. It's recommended to configure the `:base-url`\nkey so that urls point to your Logseq graph. To configure what is exported,\nknowledge of [advanced\nqueries](https://docs.logseq.com/#/page/advanced%20queries) is required. See\n[the config\nfile](https://github.com/logseq/rdf-export/blob/main/src/logseq/rdf_export/config.cljs)\nfor the full list of configuration keys.\n\n## Development\n\nThis github action use [nbb-logseq](https://github.com/logseq/nbb-logseq) and the [graph-parser\nlibrary](https://github.com/logseq/logseq/tree/master/deps/graph-parser) to export a Logseq graph\nfrom its database.\n\n## LICENSE\nSee LICENSE.md\n\n## Additional Links\n* https://github.com/logseq/graph-validator - Github action that this one is modeled after\n* https://github.com/Matdata-eu/logseq-rdf-export-docker - Docker image of this repository which\n  also supports GitLab use\n* https://github.com/rdfjs/N3.js - Library that handles the rdf exporting\n* https://github.com/logseq/docs - Logseq graph that uses this action\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogseq%2Frdf-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogseq%2Frdf-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogseq%2Frdf-export/lists"}