- 0.1.0 - Initial drop
- 0.2.0 - Functionality overhaul
- 0.2.1 - Fixes issue #1
An implementation of a rdflib
Graph
that reads well-formed RDF collections as lists.
- Python 3.6 -- this module uses the new typing annotations
rdflib
-- a Python library for working with RDF
See Jupyter notebook
This is a read-only interface. It does not convert list style representations into collections.
This module assumes that collections are "well formed", as determined by common convention. (Why the RDF WG did not put a stake in the gound on this remains a mystery). By "well formed" we mean:
- Empty list:
:s :p rdf:nil.
- Single element:
:s :p _:b1 . _:b1 rdf:first :o; rdf:rest rdf:nil
- Every list (
_:n
) in a list will have exactly two entries,_:n rdf:first .
and_:n rdf:rest [_:n2 or rdf:nil]
In addition, we impose the restriction:
- The subject of
rdf:first
orrdf:rest
is always a blank node.
The output for RDF Collections that do not conform to the above rules is not predictable.