Migration Guide¶
From 0.4 to 0.5¶
RDF-star support has been dropped in favor of RDF 1.2 <https://www.w3.org/TR/rdf12-concepts>_. Triple terms are not allowed in subject position anymore.
From 0.3 to 0.4¶
Python 3.7 and
musllinux_1_1support have been removed.The
mime_typeparameter have been renamed toformatin I/O functions. UsingRdfFormatis recommended to describe formats.Boolean SPARQL results are now encoded with the
QueryBooleanclass and not a simplebool.A path parameter has been added to all I/O method to read from a file. The existing
inputparameter now considerstrvalues to be a serialization to parse. For example,parse(path="foo.ttl")will parse the filefoo.ttlwhereasparse("foo", format=RdfFormat.N_TRIPLES)will parse a N-Triples file which content isfoo.
From 0.2 to 0.3¶
Python 3.6 and
manylinux2010(PEP 571) support have been removed. The new minimal versions are Python 3.7 andmanylinux2014(PEP 599).The on-disk storage system has been rebuilt on top of RocksDB. It is now implemented by the
Storeclass that keeps the same API as the lateSledStoreclass.To migrate you have to dump the store content using pyoxigraph 0.2 and the following code:
from pyoxigraph import SledStore store = SledStore('MY_STORAGE_PATH') with open('temp_file.nq', 'wb') as fp: store.dump(fp, "application/n-quads")
And then upgrade to pyoxigraph 0.3 and run:
from pyoxigraph import Store store = Store('MY_NEW_STORAGE_PATH') with open('temp_file.nq', 'rb') as fp: store.bulk_load(fp, "application/n-quads")
The in-memory storage class
MemoryStorehas been merged into theStoreclass that provides the exact same API as the lateMemoryStore. On platforms other than Linux, a temporary directory is created when opening theStoreand automatically removed when it is garbage collected. No data is written in this directory.Storeoperations are now transactional using the “repeatable read” isolation level: the store only exposes changes that have been “committed” (i.e. no partial writes) and the exposed state does not change for the complete duration of a read operation (e.g. a SPARQL query) or a read/write operation (e.g. a SPARQL update).RDF-star is now supported (including serialization formats and SPARQL-star).
Triplecan now be used inTriple.object,Triple.object,Quad.subjectandQuad.object.