Skip to main content

SPARQL semantic translator and ORM for Python.

Project description


SPARQL semantic translator and object-mapper for Python (wip).


We define a query object as an instance of sparqly.Item, with the predicates listed as attributes following the idiom of pretty_name = "actual name". For example, to query Pre-Raphaelite aritsts on WikiData, the schema we define could look like

from sparqly import Item

class Artist(Item):
  movement      = "wdt:P135"
  instance_of   = "wdt:P31"

We can then generate the query text for a selection with

from sparqly import query

q = query()
  movement = "wd:Q184814", # pre-raphaelite
  instance_of = "wd:Q5"    # human


Which will print to the console:

	?Artist wdt:P135 wd:Q184814 ;
	wdt:P31 wd:Q5 .


Version 0.1.0:

  • Object-Relational-Mapping (ORM)

Planned Features

  • Ability to attach service
  • Filters like ORDER, LIMIT, GROUP
  • More semantic support
  • Additional methods for constructing queries depending on circumstance and complexity

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

sparqly-0.1.1.tar.gz (3.9 kB view hashes)

Uploaded source

Built Distribution

sparqly-0.1.1-py3-none-any.whl (16.2 kB view hashes)

Uploaded py3

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