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 oort

How to install Oort

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install oort
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4 Available View build log
Windows (64-bit)
0.4 Available View build log
Mac OS X (10.5+)
0.4 Available View build log
Linux (32-bit)
0.4 Available View build log
Linux (64-bit)
0.4 Available View build log
 
License
BSD
Dependencies
Depended by
Lastest release
version 0.4 on Jan 5th, 2011

Oort is a a Python-based toolkit for accessing RDF graphs as plain objects.

It uses RDFLib for the heavy lifting.

Overview

oort.rdfview Contains classes and functions used for defining RDF queries and selectors, i.e. declarations used to pick properties and associated sub-queries from a chosen resource (similar to how many ORM-toolkits work).

oort.util.queries Some basic base RdfQuery subtypes for common use (e.g. getting at localized annotation properties such as rdfs:label and similar).

oort.util.graphs A collection of basic "filesystem-to-graph" utilities.

How?

By subclassing oort.rdfview.RdfQuery and adding attributes which are instances of one of the Selector subclasses from that package, you define a set of rdf properties which are to be retrieved about a given subject (from a given graph, in a given language). The selectors are given a URIRef which determines the property. Or a Namespace, in which case the name of the attribute will be used.

These are some of the predefined classes from oort.util.queries:

System Message: WARNING/2 (<string>, line 40)

Literal block expected; none found.

class Typed(RdfQuery): rdfType = one(RDF.type)

class Labelled(RdfQuery): label = localized(RDFS)

class Annotated(Labelled): comment = localized(RDFS)

class Resource(Annotated, Typed): pass

Selectors can also be given RdfQuery types (or names of types, to enable e.g. cyclic references) which are used to describe their selected resources recursively. Use like this:

System Message: WARNING/2 (<string>, line 56)

Literal block expected; none found.

SIOC = Namespace("http://rdfs.org/sioc/ns#")

class Item(Annotated): _rdfbase_ = SIOC # sets default namespace base for this RdfQuery name = localized() description = localized() seeAlso = each(RDFS) >> Annotated

The overloaded >> is just sugar for:

System Message: WARNING/2 (<string>, line 66)

Literal block expected; none found.

seeAlso = each(RDFS).viewed_as(Annotated)

Predefined selectors in oort.rdfview are: one, each, one_where_self_is, each_where_self_is, collection, localized, i18n_dict, each_localized and localized_xml.

RdfQueries are either directly instantiated with an RDFLib Graph instance, language (string) and URIRef instance, or used via QueryContext, which facilitates this and other things.

Se more examples (and test source code) at the Oort Website.

Subscribe to package updates

Last updated Jan 5th, 2011

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.