Skip to main content

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)

Uploaded Source

Built Distribution

geosparqllib-0.1.4-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page