A Python functions library for working with GeoSPARQL data
Project description
geosparqllib
A Python functions library for working with GeoSPARQL data.
Project home: https://github.com/Kurrawong/geosparqllib/
This Python library contains a series of functions for creating, using and otherwise working with GeoSPARQL RDF data.
Common tasks handled by this library are:
- creating GeoSPARQL data from other spatial data
- ...
Installation
This library is available on PyPI so can be installed using PIP:
pip install geosparqllib
or Poetry:
poetry add geosparqllib
Use
Here's an example of using the make_geometry()
function:
from geosparqllib import make_geometry
j = """
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[0, 0],
[1, 0],
[1, 1],
[0, 1],
[0, 0]
]
]
}
}
"""
f = "http://example.com/f/1"
geom, bn = make_geometry(f, j)
print(geom.serialize(format="longturtle"))
returns:
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
<http://example.com/f/1>
geo:hasGeometry
[
a geo:Geometry ;
geo:asWKT "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))"^^geo:wktLiteral ;
] ;
.
See further examples of use in this module's tests in its source code:
License
BSD- 3-Clause (and in RDF).
Contact
Developer:
Nicholas Car
KurrawongAI
nick@kurrawong.ai
Admin
Useful build commands
~$ poetry run pytest
# update version in pyproject.toml
~$ git commit -am "new version x.x.x"
~$ git tag x.x.x
~$ git push --tags
~$ poetry build
~$ poetry publish
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
geosparqllib-0.1.4.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for geosparqllib-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 037766c4a21ff3638c517689cb03741d30cdc64f45c81049eb0da5489d8fd8d8 |
|
MD5 | c9dac4e7b3fbee3e5c81e911398594bd |
|
BLAKE2b-256 | 102ec1f0deb09a08f0b3b4f634bbffd8e0642a638a1d4ffae92fec01caecf357 |