RDFLib / sparqlwrapper

A wrapper for a remote SPARQL endpoint
https://sparqlwrapper.readthedocs.io/
Other
513 stars 121 forks source link

Replace `graph.load()` with `graph.parse()` #187

Closed eggplants closed 2 years ago

eggplants commented 2 years ago

fix: #186 I'll convert this into ready to merge after #184 is merged.

eggplants commented 2 years ago

Ran 1512 tests in 894.352s FAILED (failures=3, errors=211, skipped=549, expected failures=80)

I have to need to research this change's effect more.

eggplants commented 2 years ago

https://rdflib.readthedocs.io/en/stable/_modules/rdflib/graph.html#Graph.load

class Graph(Node):
...
    def load(self, source, publicID=None, format="xml"):
        warn(
            DeprecationWarning(
                "graph.load() is deprecated, it will be removed in rdflib 6.0.0. "
                "Please use graph.parse() instead."
            )
        )
        return self.parse(source, publicID, format)
...
eggplants commented 2 years ago

https://rdflib.readthedocs.io/en/stable/_modules/rdflib/graph.html#Graph.parse

class Graph(Node):
...
    def parse(
        self,
        source=None,
        publicID=None,
        format: Optional[str] = None,
        location=None,
        file=None,
        data: Optional[Union[str, bytes, bytearray]] = None,
        **args,
    ):
...
eggplants commented 2 years ago

I overlooked the fact that the default format is different in load ("xml") and parse (None).

nicholascar commented 2 years ago

Yes, default format used to be XML but now it's Turtle.