sparqlwrapper icon indicating copy to clipboard operation
sparqlwrapper copied to clipboard

rdflib.RDF and SPARQLWrapper.RDF aren't to be confused

Open olberger opened this issue 11 years ago • 4 comments

I wonder whether there could be some way to unify SPARQLWrapper's RDF and rdflib's.

type(rdflib.RDF) rdflib.namespace._RDFNamespace

type (SPARQLWrapper.RDF) str

Maybe I'm the only one who would: from rdflib import * from SPARQLWrapper import *

Hope this helps.

Best regards,

olberger avatar May 19 '14 15:05 olberger

nope

SPARQLWrapper.RDF is a possible output format, while rdflib.RDF is the RDF namespace http://www.w3.org/1999/02/22-rdf-syntax-ns#.

It does not make sense to unify these, but maybe it makes sense to not export SPARQLWrapper.RDF and other output formats in __init__.py.

joernhees avatar May 21 '14 16:05 joernhees

@joernhees well… constants can be used as parameter-values for some calls. it MIGHT make sense to rename them and export only new ones by-default, while leaving old ones for manual import

indeyets avatar May 26 '14 17:05 indeyets

not sure if i get this right are you suggesting to remove SPARQLWrapper.RDF from __all__, refactor it to something like SPARQLWrapper.MIMETYPE.RDF and at the same time still have SPARQLWrapper.RDF?

joernhees avatar May 26 '14 17:05 joernhees

@joernhees yup. something like that. from SPARQLWrapper import RDF will still work (but might be marked as deprecated)

indeyets avatar May 26 '14 17:05 indeyets