Sleepycat examples need help

92 views
Skip to first unread message

Nicholas Car

unread,
May 7, 2021, 9:51:43 PM5/7/21
to rdfli...@googlegroups.com
Hi everyone,

I'm working on a large documentation update (https://github.com/RDFLib/rdflib/pull/1296) to get RDFlib ready for a major update to 6.0.0.

I'm fixing broken examples, updating code styles and so on.

I'm stuck with the SleepyCat store and examples:
I can't get any sensible results from running the example, my output:

> Triples in graph before add: 0
> Triples in graph after add: 0
> Triples still in graph: 0

SleepyCat has been changed in Python 3 (see old package https://pypi.org/project/bsddb3/ with note to use https://pypi.org/project/berkeleydb/ instead).

Does anyone on this list know anything about SleepyCat/BerkeleyDb and could they help update this example to run in RDFlib master?

Thanks,

Nick

--

______________________________________________________________________________________
kind regards
Dr Nicholas Car
Data Systems Architect
SURROUND Australia Pty Ltd and
SURROUND NZ Limited
Address  Level 9, Nishi Building,
                  2 Phillip Law Street
                  New Acton Canberra 2601
Mobile     +61 477 560 177 
Email       nichol...@surroundaustralia.comWebsite   https://www.surroundaustralia.com

Enhancing Intelligence Within Organisations

delivering evidence that connects decisions to outcomes


Australian-National-University-Logo-1 – ANU Centre for Water and Landscape  Dynamics

Dr Nicholas Car
Adj. Senior Lecturer

Research School of Computer Science

The Australian National University
Canberra ACT Australia

 

 https://orcid.org/0000-0002-8742-7730

https://cs.anu.edu.au/people/nicholas-car 

Copyrights:

SURROUND Australia Pty Ltd is the copyright owner of all original content and attachments.

All rights reserved. 

Confidentiality Notice:
The contents of this email are confidential to the ordinary user of the email address to which
it is addressed, and may also be 
privileged. If you are not the addressee of this email, you
may 
not copy, forward, disclose, or otherwise use it or any part of it or its attachments in any
form whatsoever. If you have received 
this email in error, please email the sender by replying
to this 
message.

Nicholas Car

unread,
May 7, 2021, 11:20:47 PM5/7/21
to rdfli...@googlegroups.com
If anyone does want to take a look, I've branched the renaming of Sleepycat to BerkeleyDB and the code updates to https://github.com/RDFLib/rdflib/tree/BerkeleyDB

Nick

Graham Higgins

unread,
May 8, 2021, 5:51:21 AM5/8/21
to rdflib-dev
Can't reproduce the issue here after a straight copy'n'pasta:

Triples in graph before add: 0
Triples in graph after add: 2
b'@prefix test: <http://rdflib.net/test/> .
test:pic:1 test:name "Jane & Bob" .
test:pic:2 test:name "Squirrel in Tree" .'
Triples still in graph: 2

Cheers,

Graham

Nicholas Car

unread,
May 8, 2021, 8:10:58 AM5/8/21
to rdfli...@googlegroups.com
Hi Graham,

Was that running the original sleepycat_example.py against RDFlib master? What version of Python did you run on?

I’m running against master on Python 3.9 and since the sleepycat library won’t be supported in Python 3.10 (according to the BerkeleyFB replacement module) I switched to that and got a run failure. The BerkeleyDB module claims to be comparable with sleepycat.

In my BerkeleyDB branch, see this line:


That’s using BerkeleyDB in a renamed store file (Sleepycat to BerkeleyDB) with very few other changes (“” goes to None, not many other).

Nick

— 
Dr Nicholas Car
Data Systems Architect
SURROUND Australia
0477 560 177

On 8 May 2021, at 7:51 pm, Graham Higgins <gjhi...@gmail.com> wrote:


--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/c0b94824-313b-4f80-a62e-ff190cb7decdn%40googlegroups.com.

Graham Higgins

unread,
May 8, 2021, 10:04:06 AM5/8/21
to rdflib-dev
> Was that running the original sleepycat_example.py against RDFlib master? What version of Python did you run on?
Originally, system Python (3.8.5) on RDFLib 5.0 release, rechecked with Python 3.5.8 on RDFLib master, still works okay.

So, still using RDFLib master, I pip-installed berkeleydb and tried a simple  change:

- import bsddb3
+ from berkeleydb import db as bsddb3

Still works.

> Triples in graph before add:  0
> Triples in graph after add:  2
> @prefix test: <http://rdflib.net/test/> .
>
> <http://rdflib.net/test/pic:1> test:name "Jane & Bob" .
>
> <http://rdflib.net/test/pic:2> test:name "Squirrel in Tree" .

>
>
> Triples still in graph:  2

Cheers,

Graham

Graham Higgins

unread,
May 8, 2021, 10:06:17 AM5/8/21
to rdflib-dev


> Originally, system Python (3.8.5) on RDFLib 5.0 release, rechecked with Python 3.5.8 on RDFLib master, still works okay.
Meh, I meant Python 3.8.5, not 3.5.8.

Graham Higgins

unread,
May 8, 2021, 10:13:00 AM5/8/21
to rdflib-dev
So, still using RDFLib master, I pip-installed berkeleydb and tried a simple  change:

- import bsddb3
+ from berkeleydb import db as bsddb3

On reflection , I doubt that changes anything significant.

Nicholas Car

unread,
May 8, 2021, 6:36:17 PM5/8/21
to rdfli...@googlegroups.com
Thanks again, that’s all good news since I’m really just interested in ensuring that all existing stores and examples keep working in the face of code base tidy-ups and not so concerned with updating the stores that much.

I’ll try and replicate everything working the same in the next day or two and, if it does, just move on to other 6.0.0 readiness things (more documentation updates in https://github.com/RDFLib/rdflib/pull/1296).

Cheers, Nick

On 9 May 2021, at 12:13 am, Graham Higgins <gjhi...@gmail.com> wrote:


--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.

Graham Higgins

unread,
May 9, 2021, 5:20:12 AM5/9/21
to rdflib-dev
>> Thanks again, that’s all good news since I’m really just interested in ensuring that all existing stores and examples keep working in the face of code base tidy-ups and not so concerned with updating the stores that much.

Sorry to be the bearer of bad news but as I suspected, my lazy test didn't actually test anything significant. I tried a fresh venv with berkeleydb/RDFLib-BerkeleyDB and got the same results as you.

Cheers

Graham

Nicholas Car

unread,
May 10, 2021, 8:16:59 AM5/10/21
to rdfli...@googlegroups.com
Blast! Ok, back to the open call to all for help!

I’ll try and chip away at understanding BerkeleyDB but the modern package isn’t so well documented (“just see the C documentation” in lots of places).

Am considering a Redis store. Has anyone implemented such a thing?

Nick

— 
Dr Nicholas Car
Data Systems Architect
SURROUND Australia
0477 560 177

On 9 May 2021, at 7:20 pm, Graham Higgins <gjhi...@gmail.com> wrote:


--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages