fise integration with python and plone

14
Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz Page 1 of 14 IKS Semantic Workshop Amsterdam 2010 FISE integration with Python and Plone Jens W. Klein <[email protected]> 2010-12-09

Upload: jens-klein

Post on 18-Dec-2014

711 views

Category:

Documents


4 download

DESCRIPTION

"Unleashing the Power of Semantic Data - Today"

TRANSCRIPT

Page 1: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 1 of 14

IKS Semantic WorkshopAmsterdam 2010

FISE integration withPython and Plone

Jens W. Klein <[email protected]>

2010-12-09

Page 2: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 2 of 14

Who we are

● Jens Klein– Managing Director an founder of KUP

– Software Architect and FOSS Enthusiaist

● KUP - Klein & Partner KG– web technology agency based in Innsbruck (AT)

– focused on Python, App-Engine, BFG, Zope, Plone

– founding member of BlueDynamics Alliance

● BlueDynamics Alliance– cluster of seven companies in region D-A-CH

Page 3: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 3 of 14

PYTHON

● programming language● used by Google, NASA and many more● increasing number of users● interpreted language (byte-code compiler)● untyped, lean, easy-to-read and understand● functional, object-oriented programming● powerful standard library● thousands of addon libraries

Page 4: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 4 of 14

ZOPE

● Python Technology for Web Applications● Zope 2 Web Application Server

– more than 10 years old, but continiously modernized

● Bluebream webapplication framework– application related parts of former Zope 3

● Zope Toolkit Library– used/created by devs of Zope2, BlueBream, BFG

● BFG/ Pylons Pyramid light weight web-app framework (related)

Page 5: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 5 of 14

PLONE

● Web Content Management System– built on top of Zope 2

– large community with >200 core contributors, in top 3% of FOSS-communities

– trademark and IP managed by non-profit Plone Foundation

– excellent security record

– common WebCMS with focus on users/usability, scalability

– addons and plugins for hundreds of use-cases

Page 6: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 6 of 14

bring FISE to the Plone Community:

Conference 2010● Talk at Plone Conference 2010/ Bristol

– recorded at http://ploneconference2010.blip.tv/file/4317791

● Open Space Session on Semantics in Plone● One Day Sprint (aka Hackathon) on FISE

Page 7: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 7 of 14

FISE Python APIGoals

● offer a pythonic API to all FISE features exposed by its RESTFul API

● hide as much as possible the HTTP aspect● use a widely used, well tested and scaleable

foss-library for RESTFul http connections● full test coverage with Python doctests● provide an zc.buildout based installation which

includes FISE itself and the tests

Page 8: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 8 of 14

FISE Python-APIfise.client

Wanna smell code? Doctest style: FISE „engines“

1 >>> from fise.client import FISE2 >>> fise = FISE('http://localhost:8080/')3 >>> somedoc = u"This is an example text." 4 >>> fise.engines(somedoc)5 '<rdf:RDF...</rdf:RDF>\n'

6 >>> fise.engines(somedoc, format='rdfjson')7 '{"...}'

8 >>> fise.engines(somedoc, parsed=True)9 <Graph identifier=... (<class 'rdflib.Graph.Graph'>)>

Page 9: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 9 of 14

FISE Python-APIfise.client

FISE „store“

1 >>> generated_id = fise.store.add(somedoc) 2 >>> fise.store[existing_id] = somedoc 3 >>> fise.store[generated_id] == somedoc 4 True

5 >>> fise.store.metadata(existing_id) 6 '<rdf:RDF...</rdf:RDF>\n'

7 >>> fise.store.metadata(existing_id, parsed=True) 8 <Graph identifie... (<class 'rdflib.Graph.Graph'>)>

9 >>> fise.store.page(generated_id)10 '<html>...</html>'

Page 10: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 10 of 14

FISE Python APIImplementation Details

● uses restkit as rest library ● uses rdflib to transform results to Python object

graphs,● uses SuRF library (on top of rdflib) for Sparql

queries.● code at http://github.com/collective/fise.client● integration buildout at

http://github.com/collective/fise-buildout

Page 11: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 11 of 14

fise.clientcode location

● Python-APIhttp://github.com/collective/fise.client

● Python Integration Buildouthttp://github.com/collective/fise-buildout

● Plone Integration Packagehttp://github.com/collective/fise.plone

Page 12: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 12 of 14

Plone Integration

Work done so far:● „indexing“ in FISE after creation and changes of

content-objects.

Whats missing?● query facility

– Zope plugin index to FISE sparql endpoint

– Integration with Collections

● passing the site-structure and DC to FISE.● asynchronous processing

Page 13: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 13 of 14

DEMO TIME

Plone Demo

Page 14: FISE Integration with Python and Plone

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 14 of 14

The End

Questions

Answers

Discussions