Skip to main content

OortPub

OortPub is a toolkit for creating RDF-driven WSGI-compliant web applications.

The purpose of this is to make it easy to create web views of RDF Graphs by using some declarative python programming.

OortPub uses RDFLib, Paste and Genshi for the heaving lifting.

The RDF-to-objects facility comes from the Oort core package, released separately.

Overview

The main package is:

oort.sitebase

Contains classes used for declarative definitions of displays, used for matching resources and rendering a particular output (html, json etc.). By defining aspects, the type (or super-type) of a selected resource is mapped to a particular RdfQuery and an associated template.

One or more displays are put in the context of a resource viewer, which becomes a WSGI application ready to mount in your WSGI environment.

How?

Loads of RDF data like:

<site/main> a :SiteNode;
    dc:title "Main Page"@en, "Huvudsida"@sv;
    dc:altTitle "Main", "Hem"@sv;
    :relations (
        <site/faq>
        <site/about>
    );
    :nodeContent '''<h1 xml:lang="en">Welcome</h1>'''^^rdfs:XMLLiteral,
                 '''<h1 xml:lang="sv">V&#195;&#164;lkommen</h1>'''^^rdfs:XMLLiteral .

<persons/someone> a foaf:Person;
    foaf:name "Some One";
    foaf:knows <otherone> .

A couple of RdfQuerys:

from oort.rdfview import *
SITE = Namespace("http://example.org/ns/2007/website#")

class Titled(RdfQuery):
    title = localized(DC)
    altTitle = localized(DC.alternative)

class SiteNode(Titled):
    relations = collection(SITE) >> Titled
    nodeContent = localized_xml(SITE)

class Person(RdfQuery):
    name = one(FOAF)
    knows = each(FOAF) >> 'Person'

And a web application:

from oort.sitebase import *
from myapp import queries
from myapp.ns import SITE

class ExampleViewer(ResourceViewer):

    resourceBase = "http://example.org/oort/"
    langOrder = 'en', 'sv'

    class PlainWebDisplay(Display):
        name = "main"
        default = True
        outputMethod = 'xhtml'
        outputEncoding  = 'iso-8859-1'
        templateBase = "view/mainweb"
        globalQueries = {'languages': queries.sitelabels }
        aspects = [
                Aspect(SITE.SiteNode, "sitenode.xhtml",
                        {'node': queries.SiteNode}) ,
                Aspect(FOAF.Person, "person.xhtml",
                        {'person': queries.Person}) ,
                Aspect(RDFS.Resource, "not_found.xhtml")
            ]

    class JsonDisplay(Display):
        name = "json"
        contentType = 'application/x-javascript'
        aspects = [
                JsonAspect(SITE.SiteNode, {'node': queries.SiteNode})
            ]

But wait, there’s more..

Paste!

Makes WSGI go down smoothly. ResourceViewers take RDFLib Graph instances in their constructors and become callables adhering to the spec.

To get started quickly, run:

$ paster create -t oort_app
... fill in desired values in the dialogue
$ cd myapp/
$ vim # edit and test..
$ chmod u+x webapp.ini
$ ./webapp.ini

Why?

Because RDF is a formidable technology that could revolutionize the way information is treated and shared. Python and WSGI are exemplary technologies to use when building applications dealing with such data.

Metadata

Release files for OortPub 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for OortPub 0.1
File Size Uploaded Provenance
OortPub-0.1.tar.gz 13.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for OortPub 0.1
File Interpreter ABI Platform
OortPub-0.1-py2.5.egg Legacy Egg format - - Details

Total release size: 45.9 kB

Release files / OortPub-0.1.tar.gz

Download URL OortPub-0.1.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0da2b48b84c38542a071c1de1ac5c5db54490840b06935b93057d1a3652c78ec
BLAKE2b-256 checksum
How to use checksums
9a4f32edc953c94552e01bc71dce2d2edea24eeaacf9666886c4eea0951e4e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / OortPub-0.1-py2.5.egg

Download URL OortPub-0.1-py2.5.egg
Size 32.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
889fd017727b7c21149fdd4c496a07f1cf9b6a081616fae665766e55f1290d39
BLAKE2b-256 checksum
How to use checksums
b19b1d0b888c566fadb34bb3c92cb4e98ee155a849b43f94e3640da2ccaeacfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for OortPub 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page