triplelite 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. triplelite-1.0.0/.github/workflows/pages.yml +73 -0
  2. triplelite-1.0.0/.github/workflows/release.yml +46 -0
  3. triplelite-1.0.0/.github/workflows/reuse.yml +16 -0
  4. triplelite-1.0.0/.github/workflows/test.yml +30 -0
  5. triplelite-1.0.0/.gitignore +10 -0
  6. triplelite-1.0.0/.releaserc.json +16 -0
  7. triplelite-1.0.0/CHANGELOG.md +26 -0
  8. triplelite-1.0.0/LICENSE +15 -0
  9. triplelite-1.0.0/LICENSES/CC0-1.0.txt +121 -0
  10. triplelite-1.0.0/LICENSES/ISC.txt +8 -0
  11. triplelite-1.0.0/PKG-INFO +56 -0
  12. triplelite-1.0.0/README.md +40 -0
  13. triplelite-1.0.0/REUSE.toml +21 -0
  14. triplelite-1.0.0/docs/.gitignore +21 -0
  15. triplelite-1.0.0/docs/.vscode/extensions.json +4 -0
  16. triplelite-1.0.0/docs/.vscode/launch.json +11 -0
  17. triplelite-1.0.0/docs/astro.config.mjs +45 -0
  18. triplelite-1.0.0/docs/package-lock.json +6264 -0
  19. triplelite-1.0.0/docs/package.json +18 -0
  20. triplelite-1.0.0/docs/public/favicon.svg +1 -0
  21. triplelite-1.0.0/docs/src/content/docs/guide/indexing.md +51 -0
  22. triplelite-1.0.0/docs/src/content/docs/guide/rdflib.md +39 -0
  23. triplelite-1.0.0/docs/src/content/docs/guide/rdfterm.md +31 -0
  24. triplelite-1.0.0/docs/src/content/docs/guide/subgraph.md +15 -0
  25. triplelite-1.0.0/docs/src/content/docs/index.md +94 -0
  26. triplelite-1.0.0/docs/src/content.config.ts +7 -0
  27. triplelite-1.0.0/docs/tsconfig.json +5 -0
  28. triplelite-1.0.0/pyproject.toml +46 -0
  29. triplelite-1.0.0/tests/test_properties.py +136 -0
  30. triplelite-1.0.0/tests/test_triplelite.py +537 -0
  31. triplelite-1.0.0/triplelite/__init__.py +18 -0
  32. triplelite-1.0.0/triplelite/_graph.py +401 -0
  33. triplelite-1.0.0/triplelite/_rdflib_bridge.py +63 -0
  34. triplelite-1.0.0/triplelite/_types.py +23 -0
  35. triplelite-1.0.0/triplelite/py.typed +0 -0
  36. triplelite-1.0.0/uv.lock +704 -0
@@ -0,0 +1,73 @@
1
+ name: Deploy Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23
+
24
+ - name: Setup Node
25
+ uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
26
+ with:
27
+ node-version: 22
28
+
29
+ - name: Install docs dependencies
30
+ working-directory: docs
31
+ run: npm ci
32
+
33
+ - name: Build docs
34
+ working-directory: docs
35
+ run: npx astro build
36
+
37
+ - name: Install uv
38
+ uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
39
+ with:
40
+ enable-cache: true
41
+
42
+ - name: Set up Python
43
+ run: uv python install 3.13
44
+
45
+ - name: Install dependencies
46
+ run: uv sync --locked
47
+
48
+ - name: Run tests with coverage
49
+ run: uv run pytest --cov=triplelite --cov-report=xml:coverage.xml --cov-report=html:htmlcov
50
+
51
+ - name: Generate coverage badge
52
+ run: uv run genbadge coverage -i coverage.xml -o badge.svg
53
+
54
+ - name: Merge coverage into docs output
55
+ run: |
56
+ cp -r htmlcov docs/dist/coverage
57
+ cp badge.svg docs/dist/coverage-badge.svg
58
+
59
+ - name: Upload pages artifact
60
+ uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
61
+ with:
62
+ path: docs/dist
63
+
64
+ deploy:
65
+ needs: build
66
+ runs-on: ubuntu-latest
67
+ environment:
68
+ name: github-pages
69
+ url: ${{ steps.deployment.outputs.page_url }}
70
+ steps:
71
+ - name: Deploy to GitHub Pages
72
+ id: deployment
73
+ uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
@@ -0,0 +1,46 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ release:
9
+ if: contains(github.event.head_commit.message, '[release]')
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ id-token: write
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Setup Node
21
+ uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
22
+ with:
23
+ node-version: 22
24
+
25
+ - name: Semantic Release
26
+ id: semantic
27
+ uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
28
+ with:
29
+ extra_plugins: |
30
+ @semantic-release/changelog
31
+ @semantic-release/exec
32
+ @semantic-release/git
33
+ env:
34
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35
+
36
+ - name: Install uv
37
+ if: steps.semantic.outputs.new_release_published == 'true'
38
+ uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
39
+ with:
40
+ enable-cache: true
41
+
42
+ - name: Build and publish
43
+ if: steps.semantic.outputs.new_release_published == 'true'
44
+ run: uv build && uv publish
45
+ env:
46
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,16 @@
1
+ name: REUSE
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
14
+
15
+ - name: REUSE lint
16
+ uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
@@ -0,0 +1,30 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
20
+ with:
21
+ enable-cache: true
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ run: uv python install ${{ matrix.python-version }}
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --locked
28
+
29
+ - name: Run tests
30
+ run: uv run pytest
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .hypothesis/
7
+ .coverage
8
+ coverage.xml
9
+ htmlcov/
10
+ badge.svg
@@ -0,0 +1,16 @@
1
+ {
2
+ "branches": ["main"],
3
+ "plugins": [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ "@semantic-release/changelog",
7
+ ["@semantic-release/exec", {
8
+ "prepareCmd": "sed -i 's/^version = .*/version = \"${nextRelease.version}\"/' pyproject.toml"
9
+ }],
10
+ ["@semantic-release/git", {
11
+ "assets": ["pyproject.toml", "CHANGELOG.md"],
12
+ "message": "chore(release): ${nextRelease.version}"
13
+ }],
14
+ "@semantic-release/github"
15
+ ]
16
+ }
@@ -0,0 +1,26 @@
1
+ # 1.0.0 (2026-04-15)
2
+
3
+
4
+ * refactor!: rename package from litegraph to triplelite ([f889b86](https://github.com/opencitations/triplelite/commit/f889b865846d21590e6a7e7e3078d052352655dc))
5
+ * refactor!: unify rdflib bridge into from_rdflib and to_rdflib ([d78bf2d](https://github.com/opencitations/triplelite/commit/d78bf2de98b8cead4937ccc8ca68c404c5c844cd))
6
+
7
+
8
+ ### Features
9
+
10
+ * add in-memory RDF triple store with configurable indexing ([be25f2a](https://github.com/opencitations/triplelite/commit/be25f2ab305aada3b94dd6477e563f2075f9a230))
11
+
12
+
13
+ ### Performance Improvements
14
+
15
+ * intern strings and terms as integer IDs in internal indices ([b631e9a](https://github.com/opencitations/triplelite/commit/b631e9abec4bb9c47605455a13da5f5dbb43b502))
16
+
17
+
18
+ ### BREAKING CHANGES
19
+
20
+ * package renamed from litegraph to triplelite and main
21
+ class from LiteGraph to TripleLite. Update all imports accordingly.
22
+ * removed public functions rdflib_to_rdfterm,
23
+ from_rdflib_graph, from_rdflib_dataset, to_rdflib_dataset, and
24
+ to_rdflib_quads. LiteGraph methods to_rdflib_dataset and
25
+ to_rdflib_quads replaced by to_rdflib. from_rdflib now returns
26
+ list[LiteGraph] even for a single Graph input.
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Arcangelo Massari <arcangelo.massari@unibo.it>
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
11
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1,8 @@
1
+ ISC License:
2
+
3
+ Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
4
+ Copyright (c) 1995-2003 by Internet Software Consortium
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.4
2
+ Name: triplelite
3
+ Version: 1.0.0
4
+ Summary: Lightweight RDF graph with configurable indices
5
+ Author-email: Arcangelo Massari <arcangelo.massari@unibo.it>
6
+ License-Expression: ISC
7
+ License-File: LICENSE
8
+ Classifier: License :: OSI Approved :: ISC License (ISCL)
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Software Development :: Libraries
12
+ Requires-Python: >=3.10
13
+ Provides-Extra: rdflib
14
+ Requires-Dist: rdflib>=6.0.0; extra == 'rdflib'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # TripleLite
18
+
19
+ Lightweight in-memory RDF triple store for Python with configurable indexing.
20
+
21
+ [![PyPI](https://img.shields.io/pypi/v/triplelite)](https://pypi.org/project/triplelite/)
22
+ [![Python](https://img.shields.io/pypi/pyversions/triplelite)](https://pypi.org/project/triplelite/)
23
+ [![Tests](https://img.shields.io/github/actions/workflow/status/opencitations/triplelite/test.yml?label=tests)](https://github.com/opencitations/triplelite/actions/workflows/test.yml)
24
+ [![Coverage](https://opencitations.github.io/triplelite/coverage-badge.svg)](https://opencitations.github.io/triplelite/coverage/)
25
+ [![REUSE](https://api.reuse.software/badge/github.com/opencitations/triplelite)](https://api.reuse.software/info/github.com/opencitations/triplelite)
26
+ [![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
27
+
28
+ ## Install
29
+
30
+ ```sh
31
+ pip install triplelite
32
+ ```
33
+
34
+ For [rdflib](https://rdflib.readthedocs.io/) interop:
35
+
36
+ ```sh
37
+ pip install triplelite[rdflib]
38
+ ```
39
+
40
+ ## Quick start
41
+
42
+ ```python
43
+ from triplelite import TripleLite, RDFTerm
44
+
45
+ g = TripleLite()
46
+ g.add(("http://example.org/s", "http://example.org/p", RDFTerm("uri", "http://example.org/o")))
47
+
48
+ for s, p, o in g.triples(("http://example.org/s", None, None)):
49
+ print(s, p, o.value)
50
+ ```
51
+
52
+ See the full documentation at [opencitations.github.io/triplelite](https://opencitations.github.io/triplelite).
53
+
54
+ ## License
55
+
56
+ [ISC](LICENSES/ISC.txt)
@@ -0,0 +1,40 @@
1
+ # TripleLite
2
+
3
+ Lightweight in-memory RDF triple store for Python with configurable indexing.
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/triplelite)](https://pypi.org/project/triplelite/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/triplelite)](https://pypi.org/project/triplelite/)
7
+ [![Tests](https://img.shields.io/github/actions/workflow/status/opencitations/triplelite/test.yml?label=tests)](https://github.com/opencitations/triplelite/actions/workflows/test.yml)
8
+ [![Coverage](https://opencitations.github.io/triplelite/coverage-badge.svg)](https://opencitations.github.io/triplelite/coverage/)
9
+ [![REUSE](https://api.reuse.software/badge/github.com/opencitations/triplelite)](https://api.reuse.software/info/github.com/opencitations/triplelite)
10
+ [![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ pip install triplelite
16
+ ```
17
+
18
+ For [rdflib](https://rdflib.readthedocs.io/) interop:
19
+
20
+ ```sh
21
+ pip install triplelite[rdflib]
22
+ ```
23
+
24
+ ## Quick start
25
+
26
+ ```python
27
+ from triplelite import TripleLite, RDFTerm
28
+
29
+ g = TripleLite()
30
+ g.add(("http://example.org/s", "http://example.org/p", RDFTerm("uri", "http://example.org/o")))
31
+
32
+ for s, p, o in g.triples(("http://example.org/s", None, None)):
33
+ print(s, p, o.value)
34
+ ```
35
+
36
+ See the full documentation at [opencitations.github.io/triplelite](https://opencitations.github.io/triplelite).
37
+
38
+ ## License
39
+
40
+ [ISC](LICENSES/ISC.txt)
@@ -0,0 +1,21 @@
1
+ version = 1
2
+
3
+ [[annotations]]
4
+ path = [
5
+ "pyproject.toml",
6
+ "uv.lock",
7
+ ".gitignore",
8
+ ".github/**",
9
+ ".releaserc.json",
10
+ "triplelite/py.typed",
11
+ ]
12
+ SPDX-FileCopyrightText = "2026 Arcangelo Massari <arcangelo.massari@unibo.it>"
13
+ SPDX-License-Identifier = "CC0-1.0"
14
+
15
+ [[annotations]]
16
+ path = [
17
+ "README.md",
18
+ "docs/**",
19
+ ]
20
+ SPDX-FileCopyrightText = "2026 Arcangelo Massari <arcangelo.massari@unibo.it>"
21
+ SPDX-License-Identifier = "ISC"
@@ -0,0 +1,21 @@
1
+ # build output
2
+ dist/
3
+ # generated types
4
+ .astro/
5
+
6
+ # dependencies
7
+ node_modules/
8
+
9
+ # logs
10
+ npm-debug.log*
11
+ yarn-debug.log*
12
+ yarn-error.log*
13
+ pnpm-debug.log*
14
+
15
+
16
+ # environment variables
17
+ .env
18
+ .env.production
19
+
20
+ # macOS-specific files
21
+ .DS_Store
@@ -0,0 +1,4 @@
1
+ {
2
+ "recommendations": ["astro-build.astro-vscode"],
3
+ "unwantedRecommendations": []
4
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "command": "./node_modules/.bin/astro dev",
6
+ "name": "Development server",
7
+ "request": "launch",
8
+ "type": "node-terminal"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,45 @@
1
+ // @ts-check
2
+ import { defineConfig } from "astro/config";
3
+ import starlight from "@astrojs/starlight";
4
+ import rehypeExternalLinks from "rehype-external-links";
5
+
6
+ export default defineConfig({
7
+ site: "https://opencitations.github.io",
8
+ base: "/triplelite",
9
+ integrations: [
10
+ starlight({
11
+ title: "TripleLite",
12
+ social: [
13
+ {
14
+ icon: "github",
15
+ label: "GitHub",
16
+ href: "https://github.com/opencitations/triplelite",
17
+ },
18
+ ],
19
+ sidebar: [
20
+ {
21
+ label: "Quick start",
22
+ slug: "",
23
+ },
24
+ {
25
+ label: "Guide",
26
+ items: [
27
+ { label: "Data model", slug: "guide/rdfterm" },
28
+ { label: "Reverse indexing", slug: "guide/indexing" },
29
+ { label: "Subgraph extraction", slug: "guide/subgraph" },
30
+ { label: "rdflib interop", slug: "guide/rdflib" },
31
+ ],
32
+ },
33
+ ],
34
+ editLink: {
35
+ baseUrl:
36
+ "https://github.com/opencitations/triplelite/edit/main/docs/",
37
+ },
38
+ }),
39
+ ],
40
+ markdown: {
41
+ rehypePlugins: [
42
+ [rehypeExternalLinks, { target: "_blank", rel: ["noopener"] }],
43
+ ],
44
+ },
45
+ });