This release includes several major changes:
* The new SPARQL 1.1 engine (rdflib-sparql) has been included in
the core distribution. SPARQL 1.1 queries and updates should
work out of the box.
* SPARQL paths are exposed as operators on URIRefs, these can
then be be used with graph.triples and friends:
python
from rdflib import Graph, URIRef
from rdflib.namespace import FOAF, RDFS
g = Graph()
bob = URIRef("...")
cls = URIRef("...")
List names of friends of Bob:
g.triples((bob, FOAF.knows/FOAF.name , None))
All super-classes:
g.triples((cls, RDFS.subClassOf * '+', None))
* a new graph.update method will apply SPARQL update statements
* Several RDF 1.1 features are available:
* A new DataSet class
* XMLLiteral and HTMLLiterals
* BNode (de)skolemization is supported through BNode.skolemize,
URIRef.de_skolemize, Graph.skolemize and Graph.de_skolemize
* Handled of Literal equality was split into lexical comparison
(for normal == operator) and value space (using new Node.eq
methods). This introduces some slight backwards incompatible
changes, but was necessary, as the old version had
inconsistent hash and equality methods that could lead the
literals not working correctly in dicts/sets.
The new way is more in line with how SPARQL 1.1 works.
For the full details, see:
https://github.com/RDFLib/rdflib/wiki/Literal-reworking
* Iterating over QueryResults will generate ResultRow objects,
these allow access to variable bindings as attributes or as a
dict. I.e.
py
for row in g.query('select ... ') :
print row.age, row["name"]
* "Slicing" of Graphs and Resources as syntactic sugar:
([271](https://github.com/RDFLib/rdflib/issues/271))
py
graph[bob : FOAF.knows/FOAF.name]
-> generator over the names of Bobs friends
* The SPARQLStore and SPARQLUpdateStore are now included
in the RDFLib core
* The documentation has been given a major overhaul, and examples
for most features have been added.
Minor Changes:
* String operations on URIRefs return new URIRefs: ([258](https://github.com/RDFLib/rdflib/issues/258))
py
>>> URIRef('http://example.org/')+'test
rdflib.term.URIRef('http://example.org/test')
* Parser/Serializer plugins are also found by mime-type, not just
by plugin name: ([277](https://github.com/RDFLib/rdflib/issues/277))
* Namespace is no longer a subclass of URIRef
* URIRefs and Literal language tags are validated on construction,
avoiding some "RDF-injection" issues ([266](https://github.com/RDFLib/rdflib/issues/266))
* A new memory store needs much less memory when loading large
graphs ([268](https://github.com/RDFLib/rdflib/issues/268))
* Turtle/N3 serializer now supports the base keyword correctly ([248](https://github.com/RDFLib/rdflib/issues/248))
* py2exe support was fixed ([257](https://github.com/RDFLib/rdflib/issues/257))
* Several bugs in the TriG serializer were fixed
* Several bugs in the NQuads parser were fixed