pycorese
Python API for CORESE Semantic Web platform
Corese is a software platform implementing and extending the standards of the Semantic Web. It allows to create, manipulate, parse, serialize, query, reason, and validate RDF data. Corese is based on the W3C standards RDF, RDFS, OWL 2, SPARQL and SHACL. Corese is implemented as a set of open-source Java libraries.
pycorese is a Python package that provides a simple way to integrate the corese-core Java library into Python applications.
pycorese offers an intuitive API to interact with Corese's capabilities such as storage, SPARQL engine, RDFS and OWL reasoning, and SHACL validation.
pycorese unlocks the potential of Semantic Web stack for applications such as semantic data analysis, knowledge graph construction, and Machine Learning.
Installation
pycorese can be easily installed via pip:
pip install pycorese
This process installs both the Python wrappers and the Corese Java libraries. To run the Java libraries, ensure that Java is installed on your system. A Java Runtime Environment (JRE) version 11 or higher is required. If Java is not installed, visit the official website for installation instructions.
Development installation
To install pycorese from the current GitHub repository follow the instructions from INSTALL.md.
Usage
Here is a simple example of how to use pycorese to load and query RDF data:
from pycorese.api import CoreseAPI
corese = CoreseAPI()
corese.loadCorese()
# Load RDF data
data = """
@prefix ex: <http://example.org/> .
ex:John ex:hasFriend ex:Jane, ex:Jill.
ex:Jane ex:age 25 .
ex:Jill ex:age 40 .
"""
graph = corese.loadRDF(data)
# Query the data to find out who is John's younger friend
query = """
PREFIX ex: <http://example.org/>
SELECT ?friend ?age
WHERE {
?x ex:age ?ageX .
?x ex:hasFriend ?friend .
?friend ex:age ?age .
FILTER (?ageX > ?age)
}
"""
results = corese.sparqlSelect(graph, query=query, return_dataframe=True)
print(results)
Expected output:
friend age
0 http://example.org/Jane 25
See the GitHub repository for more examples.
Documentation
- pycorese GitHub pages: https://corese-stack.github.io/corese-python
- Corese GitHub pages: https://corese-stack.github.io/corese-core
Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on the GitHub repository.
Metadata
Release files for pycorese 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pycorese-0.2.0.tar.gz | 95.3 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycorese-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 190.7 MB
Release files / pycorese-0.2.0.tar.gz
| Download URL | pycorese-0.2.0.tar.gz |
|---|---|
| Size | 95.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c6567d0af57b29ce61c8e26380a9bb1b238c788ab621e5b4e2fe06cb458f3aa
|
|
BLAKE2b-256 checksum How to use checksums |
111a48a561ee7ead1add84fb0cc962aa7ff95319225c8d7bcd2c317fc28aac9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.15
|
Release files / pycorese-0.2.0-py3-none-any.whl
| Download URL | pycorese-0.2.0-py3-none-any.whl |
|---|---|
| Size | 95.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59ffafc3a3b4cfe39c3bed0b2b008279d2df5f029280101968a767d89ce4ba36
|
|
BLAKE2b-256 checksum How to use checksums |
6552b766f43f808dfdb067387aa8065d5dcddf12915a750027d37555bd670873
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.15
|
Security for pycorese 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.