surfrdf icon indicating copy to clipboard operation
surfrdf copied to clipboard

calling .save() or is_present() methods of Resource raise exception

Open mromanello opened this issue 6 years ago • 0 comments

Background: I'm developing a python library that depends on surf, called hucitlib. I use surf to read and modify resources from a SPARQL endpoint.

Problem: the tests for hucitlib work fine with surf==1.1.9, but many of them fail if I upgrade to 1.2.0.

For example I have a bit that looks like the following:

id = Identifier(id_uri)
id.rdfs_label = Literal(urn)
id.ecrm_P2_has_type = Type(BASE_URI_TYPES % "CTS_URN")
id.save()
return True

and it fails now with this exception

E           ValueError: Statement of type [list, tuple] does not
E                                            have all the (s,p,o) members (the length of the
E                                            supplied arguemnt must be at least 3)

The bug seems to be related to surf.plugin.sparql_protocol.writer and surf.plugin.sparql_protocol.writer. It is raised whenever (in my tests) the method save() or is_present() are called. From what I understand it seems related to some of the underlying SPARQL statements being invalid.

mromanello avatar Feb 13 '19 17:02 mromanello