Skip to main content

3xmap-studio

License DOI Latest PyPI version Python Version PyPI status Documentation Status

pycottas is a library for working with compressed RDF files in the COTTAS format. COTTAS stores triples as a triple table in Apache Parquet. It is built on top of DuckDB and provides an HDT-like interface.

Features :sparkles:

Documentation :bookmark_tabs:

Read the documentation.

Getting Started :rocket:

PyPI is the fastest way to install pycottas:

pip install pycottas

We recommend to use virtual environments to install pycottas.

import pycottas
from rdflib import Graph, URIRef

pycottas.rdf2cottas('my_file.ttl', 'my_file.cottas', index='spo')
res = pycottas.search('my_file.cottas', '?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o')
print(res)
pycottas.cottas2rdf('my_file.cottas', 'my_file.nt')

# COTTASDocument class for querying with triple patterns
cottas_doc = pycottas.COTTASDocument('my_file.cottas')
# the triple pattern can be a string (below) or a tuple of RDFLib terms
res = cottas_doc.search('?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o')

# COTTASStore class for querying with SPARQL
graph = Graph(store=pycottas.COTTASStore('my_file.cottas'))
res = graph.query('''
  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  SELECT DISTINCT ?s ?o WHERE {
    ?s rdf:type ?o .
  } LIMIT 10''')
for row in res:
    print(row)

To execute via command line check the docs. It is also possible to serve COTTAS files as an SPARQL endpoint with pycottas-endpoint.

License :unlock:

pycottas is available under the Apache License 2.0.

Author & Contact :mailbox_with_mail:

Universidad Politécnica de Madrid.

Citing :speech_balloon:

If you used pycottas in your work, please cite the ISWC paper:

@inproceedings{arenas2026cottas,
  title     = {{COTTAS: Columnar Triple Table Storage for Efficient and Compressed RDF Management}},
  author    = {Arenas-Guerrero, Julián and Ferrada, Sebastián},
  booktitle = {Proceedings of the 24th International Semantic Web Conference},
  year      = {2026},
  publisher = {Springer Nature Switzerland},
  isbn      = {978-3-032-09530-5},
  pages     = {313--331},
  doi       = {10.1007/978-3-032-09530-5_18},
}

Metadata

Release files for pycottas 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycottas 1.1.0
File Size Uploaded
pycottas-1.1.0.tar.gz 557.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycottas 1.1.0
File Interpreter ABI Platform
pycottas-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 574.1 kB

Release files / pycottas-1.1.0.tar.gz

Download URL pycottas-1.1.0.tar.gz
Size 557.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6232aa0410bfff36afd07a745b834b46460dd4b6b766c9da53c1f26c73d8883d
BLAKE2b-256 checksum
How to use checksums
4fdef0d14c4c434c0577331277105aac154d368d98279bdcb14fc8bbd324dfcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2025.

Transparency log

Release files / pycottas-1.1.0-py3-none-any.whl

Download URL pycottas-1.1.0-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed63bf0a2ee7ebc5bd36db3b4954af6ee0dc652f35e2ab5e4eb974a48adfa98a
BLAKE2b-256 checksum
How to use checksums
61064f4b2de72eeccec08c4ac4381e506a154d3fd4f9916fdad890b128f91353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page