1

I am searching something like sqlite but not-relational. In other words I would like to work with a triple-store (a set of object-predicate-subject triplets) instead of tables. It means that I want to use SPARQL queries instead of SQL.

The first idea that comes into mind is RDFLib. However, I see two problems with this option:

  1. RDFLib is not a data base and, as a consequence, it is not designed to work with parallel process (for example with parallel request induced by many web-users). It might lead to inconsistencies if two users at the same time try to add to or delete from the triple-store.
  2. RDFLib is designed to work with RDF, which is a particular implementation (syntax) of the triple-store. For example, each object, predicate and subject have to have URI and I do not have them. In my triple-store I would like to have triplets like that: ("Washington","is capital of", "USA") (so, no URI).
Roman
  • 124,451
  • 167
  • 349
  • 456
  • Is there not a MongoDB driver for Python? – DavidO Jun 25 '14 at 05:23
  • you mean like http://rdflib.github.io/sparqlwrapper/? or http://api.mongodb.org/python/current/ ? or http://redis-py.readthedocs.org/en/latest/? or ... – Joran Beasley Jun 25 '14 at 05:23
  • 1
    @DavidO: MongoDB isn't embedded, and it's a document store, not a ontology store. – David Ehrmann Jun 25 '14 at 06:19
  • This is off-topic. From the close reasons: "Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Joshua Taylor Jun 26 '14 at 11:58

2 Answers2

1

SPARQL is explicitly for RDF; if you want to use it you'll need to create your own ontology or utilise existing ones.

I recommend taking a look at ORDF with 4store as the back-end.

Matthew Trevor
  • 14,354
  • 6
  • 37
  • 50
1

As the commenters already said, there is a wrapper interface for SPARQL - the SPARQL Endpoint interface to Python (currently in version 1.6.0): http://rdflib.github.io/sparqlwrapper/

I also came across another thread discussing non-relational databases with Python, although it doesn't specifically mention SPARQL: portable non-relational database

While it doesn't have a whole lot to it, this guide for Python SPARQL developers has some pointers: http://www.openlinksw.com/blog/~kidehen/?id=1651

Community
  • 1
  • 1
Alium Britt
  • 1,246
  • 4
  • 13
  • 25