Skip to content

Commit 85d2fd0

Browse files
committed
Merge branch 'main' into develop
2 parents 13ab5bc + 4f73eca commit 85d2fd0

File tree

3 files changed

+30
-35
lines changed

3 files changed

+30
-35
lines changed

INSTALL.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,18 @@ Build the package:
7676
python -m build
7777
```
7878

79-
This command builds the packages into `./dist` directory. Note that the custom `sdist` command is implemented in [setup.py](./setup.py).
79+
which build the packages into `./dist`
8080

81-
The custom `sdist` command adds the following steps:
81+
Remark:
82+
- do not run `python setup.py` which will not build the full package
83+
- the described install process will:
8284

83-
* compiling the `corese-python-x.y.z-jar-with-dependencies.jar` file using the Gradle build tool. This jar file is required to run Corese using the `Py4J` bridge.
84-
* downloading the `corese-core-x.y.z-jar-with-dependencies.jar` file from the Maven repository. This jar file is required to run Corese using the `JPype` bridge.
85-
* copying the jar files to the `./resources` directory.
85+
1/ compile the `corese-python-4.x.y-jar-with-dependencies.jar` file
86+
2/ download the `corese-core-4.x.y-jar-with-dependencies.jar` file from maven
8687

87-
> [!NOTE]
88-
> - do not run `python setup.py` that will not build the full package.
89-
> - the versions of `pycorese` and Java libraries are maintained separately.
90-
> - `corese-python` version should be the same as `corese-core` it depends on, for simplicity reasons.
91-
> - the commands for the first two steps are provided in the [Obtaining Java libraries manually](#obtain-java-libraries-manually) section.
88+
- these two files are necessary to run the wrappers and are part of the distribution
9289

93-
## Testing the package
90+
### test
9491

9592
From the top directory, or in the `./tests` sub-directory run the command:
9693

@@ -140,22 +137,24 @@ pycorese 0.1.1
140137
141138
$ python -c 'import pycorese'
142139
```
143-
> [!NOTE]
144-
> - change the version number accordingly.
145140

141+
## Appendix 1: run local python example
146142

147-
## Run a simple example
143+
### Conda environment
148144

149-
Without installing the package you can run the following command (the default Java bridge is `py4j`):
145+
If necessary, we provide a conda environment:
150146

151147
```bash
152-
./examples/simple_query.py -j $PWD/build/libs/corese-python-4.6.0-jar-with-dependencies.jar
148+
conda env update -f pkg/env/corese-python.yaml
149+
conda activate corese-python
153150
```
154151

155-
or change the bridge to `jpype`:
152+
This makes available the python libraries: `pandas`, `py4j`, `jpype1`
156153

157-
```bash
158-
./examples/simple_query.py -b jpype -j $PWD/build/libs/corese-core-4.6.0-jar-with-dependencies.jar
154+
### run a simple example using py4j bridge (without installing)
155+
156+
```
157+
./python_examples/simple_query.py -j $PWD/build/libs/corese-python-4.6.0-jar-with-dependencies.jar
159158
```
160159

161160
<!-- **_NOTE:_** -->

pyproject.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ authors = [
1919
{ name = "Erwan Demairy", email = "erwan.demairy@inria.fr"},
2020
]
2121
description = "pycorese: Python API for CORESE Semantic Web platform"
22+
description = "pycorese: Python API for CORESE Semantic Web platform"
2223
keywords = ["Query Engine", "SPARQL", "SHACL", "RDF",
2324
"RDFS", "OWL", "Reasoning", "Knowledge Graph"]
2425

@@ -31,16 +32,23 @@ dependencies = [
3132
]
3233

3334
classifiers = [
35+
"Development Status :: 4 - Beta",
3436
"Development Status :: 4 - Beta",
3537
"License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)",
3638
"Operating System :: OS Independent",
39+
"Operating System :: OS Independent",
3740
"Intended Audience :: Science/Research",
3841
"Topic :: Scientific/Engineering",
3942
"Topic :: Software Development :: Libraries",
4043
"Programming Language :: Python :: 3.10",
4144
"Programming Language :: Python :: 3.11",
4245
"Programming Language :: Python :: 3.12",
4346
"Programming Language :: Python :: 3.13",
47+
"Topic :: Software Development :: Libraries",
48+
"Programming Language :: Python :: 3.10",
49+
"Programming Language :: Python :: 3.11",
50+
"Programming Language :: Python :: 3.12",
51+
"Programming Language :: Python :: 3.13",
4452
]
4553

4654
[project.urls]
@@ -68,11 +76,8 @@ include-package-data = true
6876
where = ["src"]
6977

7078
# Adding the Java jars to the package.
71-
# The jar files are obtained by the custom `sdist` step in the setup.py.
72-
# (1) corese-python-{version}-with-dependencies.jar is built by the gradle build system,
73-
# (2) corese-core-{version}-with-dependencies.jar is downloaded from the maven repository
74-
# (https://mvnrepository.com/artifact/fr.inria.corese/corese-core).
75-
# Both files are copied to the `resources` directory
76-
# and installed to the `share/pycorese` directory of the venv.
79+
# The jar files are built by the custom build step in the setup.py.
80+
# The files are built/downloaded by the gradle build system
81+
# and copied to the `resources` directory.
7782
[tool.setuptools.data-files]
7883
"share/pycorese" = ["resources/*.jar"]

src/pycorese/py4J_bridge.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,7 @@ def coreseVersion(self):
6161
"""
6262
get corese version from the loaded corese engine
6363
"""
64-
version = None
65-
try:
66-
version = corese.java_gateway.jvm.fr.inria.corese.core.util.CoreseInfo.getVersion()
67-
except:
68-
pass
69-
70-
if version is None:
71-
logging.Warning(f"Py4j: the CORESE library is too old. coreseVersion() is available since 4.6.0 only.")
72-
73-
return version
64+
return corese_version
7465

7566
def unloadCorese(self):
7667
"""

0 commit comments

Comments
 (0)