Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install ldtools

How to install Ldtools

  1. Download and install ActivePython
  2. Buy and install the Business Edition license from account.activestate.com
  3. Open Command Prompt
  4. Type pypm install ldtools

Ldtools contains builds that are only available via PyPM when you have a current ActivePython Business Edition subscription.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.5.6
0.5.6 Available View build log
0.5.5 Available View build log
0.5.4 Available View build log
0.5.3 Available View build log
0.5.1 Available View build log
0.4.6 Available View build log
0.4.3 Available View build log
0.4.2.3 Failed View build log
0.4.1 Failed View build log
Windows (64-bit)
0.5.6
0.5.6 Available View build log
0.5.5 Available View build log
0.5.4 Available View build log
0.5.3 Available View build log
0.5.1 Available View build log
0.4.6 Available View build log
0.4.3 Available View build log
0.4.2.3 Failed View build log
0.4.1 Failed View build log
Mac OS X (10.5+)
0.5.6
0.5.6 Available View build log
0.5.5 Available View build log
0.5.4 Available View build log
0.5.3 Available View build log
0.5.1 Available View build log
0.4.6 Available View build log
0.4.3 Available View build log
0.4.2.3 Failed View build log
0.4.1 Failed View build log
Linux (32-bit)
0.5.6
0.5.6 Available View build log
0.5.5 Available View build log
0.5.4 Available View build log
0.5.3 Available View build log
0.5.1 Available View build log
0.4.6 Available View build log
0.4.3 Available View build log
0.4.2.3 Failed View build log
0.4.1 Failed View build log
Linux (64-bit)
0.5.6
0.5.6 Available View build log
0.5.5 Available View build log
0.5.4 Available View build log
0.5.3 Available View build log
0.5.1 Available View build log
0.4.6 Available View build log
0.4.3 Available View build log
0.4.2.3 Failed View build log
0.4.1 Failed View build log
Web
 
Author
License
BSD
Dependencies
Imports

Ldtools is a simple library to handle RDF data in a convenient way. It can be used as a simple ORM for Linked Data Resources and their Origins. A resource "http://dbpedia.org/resource/Karlsruhe" might be mentioned by different origins. Ldtools helps to keep track of verified statements (authoritative) about resources and provides an API to query more information about resources.

Different rdf triple storage backends are provided for the retrieved data: RestBackend, FileBackend or MemoryBackend

The CLI ldtools can be used to retrieve information about linked data resources.

Installation

Just use pip:

pip install Ldtools

This will install all dependencies (argparse, rdflib) needed and provide the command line utility "ldtools".

Alternatively, do a git clone and execute python setup.py install/develop.

How to use it?

Via the commandline, all information within a Linked Data resource can be retrieved by executing:

ldtools http://dbpedia.org/resource/Karlsruhe

Further options can be utilised to influence whether the URIs that are discovered within the origin should be followed and how deep. Try:

ldtools --help

for more usage information.

Alternatively, the python console can be used:

First, we create an Origin object:

import pprint, rdflib
from ldtools.resource import Resource
from ldtools.origin import Origin

uri = "http://dbpedia.org/resource/Karlsruhe"
origin, created = Origin.objects.get_or_create(uri)

Process it, hopefully discovering more Origins in there (rdfs:seeAlso, owl:sameAs...):

origin.GET(only_follow_uris=[rdflib.OWL.sameAs,rdflib.RDFS.seeAlso])

If everything went well, there now is a Resource object for our uri:

resource, created = Resource.objects.get_or_create(uri, origin=origin)
pprint.pprint(resource.__dict__)

Process all the other Origins we know about:

Origin.objects.GET_all()

Result: 5 URIs crawled and 500 Resources discovered and processed.

Why?

  • The Semantic Web is out there and there is really not enough tools yet to work with Linked Data
  • SPARQL is not needed to get the RAW data from resources, this library demonstrates that. Just the basic Linked Data Stack: URIs, Content Negotiation, RDF needed
  • ldtools intends to make it easy to handle the data you get from an URI and to follow links you discover
  • Based on that, you can modify your objects and PUT them back to their origin

Tests

To run the tests, install spec and/or nose and run nose:

pip install spec unittest2 coverage
nosetests --with-coverage --cover-package=ldtools
nosetests --with-specplugin

Build Status status_image

Contributions/Credits

Feel free to submit ideas and bugs to http://github.com/dmr/Ldtools/issues, I'll be happy to accept pull requests for new features.

Thank you Travis CI for running the tests :)

Thanks to Django, Flask, peewee and sentry for inspiration regarding model structure!

Subscribe to package updates

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.