OldMan is a Python Object Linked Data Mapper (OLDM).
An OLDM let you create, retrieve and update RDF representations of Web Resources by manipulating them as Python objects.
OldMan, in its core, is based on two W3C standards:
- RDF (the Resource Description Framework) as data model;
- JSON-LD context for mapping objects and RDF graphs.
It is designed to support multiple protocols for interacting with data stores hosting these resources. Currently, only SPARQL is officially supported.
OldMan relies on the RDFlib Python library.
Some similar projects employ the term Object RDF Mapper for denoting the mapping between objects and RDF graphs. This terminology uses the same initials than the well-known notion of Object Relational Mapper (ORM) that consider table rows instead of RDF graphs.
The Object Linked Data Mapper (OLDM) term avoids this confusion. It also emphasizes that the manipulated resources are supposed to be on the Web, not just in a local database. It should lead users to interact with data stores on which they not always have full control (e.g. a tiers Web API).
OldMan has one main objective: help you to declare your models using RDF triples and JSON-LD contexts instead of programming Python model classes yourself.
However, OldMan does not force you to express all your domain logic in a declarative style. OldMan makes easy for you to add dynamically plain-old Python methods to resource objects.
By adopting a declarative style:
- You can provide both RDF and JSON data to your clients.
- Your schema (including validation constraints) can be published and reused by hypermedia-driven Web clients.
- Your declared domain logic becomes independent of Python and its frameworks.
It also acknowledges that IRIs or compact URIs (CURIEs) -like strings are not always pleasant to use: arbitrary short names and objects are usually more user-friendly. However, you can still manipulate IRIs when it is relevant for you to do so. Everything remains mapped to IRIs.
http://oldman.readthedocs.org/en/latest/quickstart.html
http://oldman.readthedocs.org/en/latest/
Resource-centric validation based on RDF vocabularies:
- Hydra: hydra:required , hydra:readonly and hydra:writeonly;
- Literal validation for common XSD types;
- Literal validation for arbitrary property (e.g. foaf:mbox);
- JSON-LD collections (set, list and language maps);
IRI generation for new resources (objects);
Inheritance (attributes and Python methods);
An attribute can require its value to be a collection (a set, a list or a language map);
Arbitrary attribute names (e.g. plural names for collections);
Extensibility to various sorts of data stores (not just SPARQL endpoints);
Optional resource cache relying on the popular dogpile.cache library.
OldMan is a young project under active development started in April 2014. Feel free to contribute and to subscribe to our mailing list oldman AT librelist.com.
Only Python 2.7 is currently supported, but support for Python 3.x is of course something we would like to consider.
See our issue tracker.