Semantic TYPO3

  • 4,201 views
Uploaded on

Develop for TYPO3 with Semantic Web in mind.

Develop for TYPO3 with Semantic Web in mind.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
4,201
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
36
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Semantic TYPO3Develop Extensions with Semantic Web in MindJochen Rau @ T3CON11SFJune 11, 2011
  • 2. (c) by Benjamin Nowack, Attribution 3.0 Unported (CC BY 3.0)
  • 3. Concepts (c) by Benjamin Nowack, Attribution 3.0 Unported (CC BY 3.0)
  • 4. Implementations (c) by Benjamin Nowack, Attribution 3.0 Unported (CC BY 3.0)
  • 5. http://commons.wikimedia.org/wiki/File:Z%C3%BCrich_-_Seefeld_-_Heureka_IMG_1757.JPG
  • 6. No Rocket Science
  • 7. Lets make some assertions about meJochens is a Person.Jochens age is 40.Jochens name is Jochen Rau.Jochen likes TYPO3 and Wine.Jochen lives in Massachusetts.
  • 8. Lets make some assertions about meJochens is a Person.Jochens age is 40.Jochens name is Jochen Rau.Jochen likes TYPO3 and Wine.Jochen lives in Massachusetts. Subject Predicate Object
  • 9. Lets make some assertions about meJochens is a Person.Jochens age is 40.Jochens name is Jochen Rau.Jochen likes TYPO3 and Wine.Jochen lives in Massachusetts. Subject Predicate Object Triple
  • 10. Lets make some assertions about me Jochen 40 age name Jochen Rau is a likes TYPO3 likes lives inJochens is a Person. PersonJochens age is 40. Wine MassachusettsJochens name is Jochen Rau.Jochen likes TYPO3 and Wine.Jochen lives in Massachusetts.
  • 11. Lets make some assertions about me Jochen 40 age name Jochen Rau is a likes TYPO3 likes lives inJochens is a Person. PersonJochens age is 40. Wine MassachusettsJochens name is Jochen Rau.Jochen likes TYPO3 and Wine. TYPO3Jochen lives in Massachusetts. license GNU General Public License description platform TYPO3 is a free and open source content management system as well as a Model–view– controller (MVC) Web PHP Application Development framework written in PHP.
  • 12. Lets make some assertions about me Jochen 40 age name Jochen Rau is a likes TYPO3 likes GNU General license lives in Public LicenseJochens is a Person. Person descriptionJochens age is 40. Wine MassachusettsJochens name is Jochen Rau. platform TYPO3 is a free and open source contentJochen likes TYPO3 and Wine. management system asJochen lives in Massachusetts. well as a Model–view– controller (MVC) Web PHP Application Development framework written in PHP.
  • 13. Unique Names for Resources Jochen knows Sebastian likes Paris
  • 14. Unique Names for Resources <http://typoplanet.de/resource/Jochen> <http://xmlns.com/foaf/0.1/knows> <http://sebastian.kurfuerst.eu/> <http://xmlns.com/foaf/0.1/likes> <http://en.wikipedia.org/wiki/Paris_(2008_film)><http://typoplanet.de/resource/Jochen><http://typoplanet.de/resource/hg132k4jhjh1234t><urn:uuid:67ecc3bd-07e2-44f4-a788-597bf9949f0c><tel:+1-617-555-7332><mailto:jochen.rau@typoplanet.de>
  • 15. Unique Names for Resources <http://typoplanet.de/resource/Jochen> <http://xmlns.com/foaf/0.1/knows> <http://sebastian.kurfuerst.eu/> <http://sebastian.kurfuerst.eu/> <http://xmlns.com/foaf/0.1/likes> <http://en.wikipedia.org/wiki/Paris_(2008_film)>
  • 16. Turtle Serialization of an RDF Graph<http://example.com/JR> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .<http://example.com/JR> <http://xmlns.com/foaf/0.1/age> "40" .<http://example.com/JR> <http://xmlns.com/foaf/0.1/name> "Jochen Rau" .<http://example.com/JR> <http://xmlns.com/foaf/0.1/interest> <http://dbpedia.org/resource/TYPO3> .<http://example.com/JR> <http://xmlns.com/foaf/0.1/interest> <http://dbpedia.org/resource/Wine> .<http://example.com/JR> <http://example.com/livesIn> <http://data.nytimes.com/Massachusetts> .
  • 17. Turtle Serialization of an RDF Graph@prefix ex: <http://example.org/> .@prefix dbp: <http://dbpedia.org/resource/> .@prefix nyt: <http://data.nytimes.com/> .@prefix foaf: <http://xmlns.com/foaf/0.1/> .ex:JR a foaf:Person .ex:JR foaf:age "40" .ex:JR foaf:name "Jochen Rau" .ex:JR foaf:interest dbp:TYPO3 .ex:JR foaf:interest dbp:Wine .ex:JR ex:livesIn nyt:Massachusetts .
  • 18. Turtle Syntactic sugar@prefix ex: <http://example.org/> .@prefix dbp: <http://dbpedia.org/resource/> .@prefix nyt: <http://data.nytimes.com/> .@prefix foaf: <http://xmlns.com/foaf/0.1/> .ex:JR a foaf:Person ; ex:age "40" ; ex:name "Jochen Rau" ; ex:likes dbp:TYPO3 ; ex:likes dbp:Wine ; ex:livesIn nyt:Massachusetts .
  • 19. Turtle And even more syntactic sugar@prefix ex: <http://example.org/> .@prefix dbp: <http://dbpedia.org/resource/> .@prefix nyt: <http://data.nytimes.com/> .@prefix foaf: <http://xmlns.com/foaf/0.1/> .ex:JR a foaf:Person ; ex:age "40" ; ex:name "Jochen Rau" ; ex:likes dbp:TYPO3 , dbp:Wine ; ex:livesIn nyt:Massachusetts .
  • 20. RDF at a Glance Simple, ubiquitous way of modeling data Main concepts Triples of subject, predicate, and object Unique names for resources Objects can also be literal values (with data type or language) Performant data stores (e.g. Virtuoso, AllegroGraph, BigOWLIM) Existing frameworks with rich APIs (e.g. JENA, Sesame, Erfurt) Billions of triples as Open Data available (e.g. Wikipedia, MusicBrainz) Many di erent serialization formats (e.g. RDF/XML, Turtle, N3) Makes data migration much easier
  • 21. Description Logic and Rules OWL and RIF What? Why? Knowledge is spread all over the system: Domain model, database scheme, TS con gurartion, FlexForm, TCA, documentation, Templates ... In di erent Formats: SQL, TypoScript, XML, PHP, HTML ... Using inconsistent terminology: "Template" in TYPO3? So, what to do? data and metadata in the same data structure (RDF) use well de ned languages to describe (meta)data (OWL RIF)
  • 22. Description Logic and Rules OWL and RIF Knublauch, Holger. KBeans Specification: Semantic Transparency for Components and Domain Models. Technical Report FAW-TR-01001, FAW Ulm, 2001.
  • 23. RDF in HTMLThree di erent standards to markup your HTML code Microformats Microdata (part of HTML5 spec) RDFa ("RDF for attributes", W3C Recommendation)A subset of RDFMakes web pages machine readable by your favorite search engine
  • 24. RDF in HTML RDFa<div> <p> Alice Birpemswick </p> <p> Email: <a href="mailto:alice@example.com">alice@example.com</a> </p> <p> Phone: <a href="tel:+1-617-555-7332">+1 617.555.7332</a> </p></div>
  • 25. RDF in HTML RDFa<div prefix="foaf: http://xmlns.com/foaf/0.1/" about="http://example.com/resource/alice"typeof="Person"> <p property="foaf:name"> Alice Birpemswick </p> <p> Email: <a rel="foaf:mbox" href="mailto:alice@example.com">alice@example.com</a> </p> <p> Phone: <a rel="foaf:phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> </p></div>
  • 26. RDF in HTML RDFa<div prefix="foaf: http://xmlns.com/foaf/0.1/" about="http://example.com/resource/alice"typeof="Person"> <p property="foaf:name"> Alice Birpemswick </p> <p> Email: <a rel="foaf:mbox" href="mailto:alice@example.com">alice@example.com</a> </p> <p> Phone: <a rel="foaf:phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> </p></div> http://example.com/resource/alice
  • 27. RDF in HTML RDFa<div prefix="foaf: http://xmlns.com/foaf/0.1/" about="http://example.com/alice#me" rel="knows"> <ul> <li typeof="Person"> <a rel="foaf:homepage" href="http://example.com/bob" property="foaf:name">Bob</a> </li> <li typeof="Person" > <a rel="foaf:homepage" href="http://example.com/eve" property="foaf:name">Eve</a> </li> <li typeof="Person" > <a rel="foaf:homepage" href="http://example.com/manu" property="foaf:name">Manu</a> </li> </ul></div>
  • 28. RDF in HTML RDFa<div prefix="foaf: http://xmlns.com/foaf/0.1/" about="http://example.com/alice#me" rel="knows"> <ul> <li typeof="Person"> <a rel="foaf:homepage" href="http://example.com/bob" property="foaf:name">Bob</a> </li> <li typeof="Person" > <a rel="foaf:homepage" href="http://example.com/eve" property="foaf:name">Eve</a> </li> <li typeof="Person" > <a rel="foaf:homepage" href="http://example.com/manu" property="foaf:name">Manu</a> </li> </ul></div>
  • 29. RDF in HTML GoodRelations Vocabulary
  • 30. RDF in HTML Enable RDFa in TYPO3# Set the doctype and add common namespacesconfig.doctype = xhtml+rdfa_10config.namespaces { xml = http://www.w3.org/XML/1998/namespace xmlns = http://www.w3.org/2000/xmlns/ xsd = http://www.w3.org/2001/XMLSchema# xhv = http://www.w3.org/1999/xhtml/vocab# rdfa = http://www.w3.org/ns/rdfa# rdf = http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs = http://www.w3.org/2000/01/rdf-schema# owl = http://www.w3.org/2002/07/owl# rif = http://www.w3.org/2007/rif#[...] dbo = http://dbpedia.org/ontology/ foaf = http://xmlns.com/foaf/0.1/ geo = http://www.w3.org/2003/01/geo/wgs84_pos# gr = http://purl.org/goodrelations/v1# cal = http://www.w3.org/2002/12/cal/ical# og = http://ogp.me/ns# v = http://rdf.data-vocabulary.org/# bibo = http://purl.org/ontology/bibo/}
  • 31. Demo
  • 32. EXT:semantic SPARQL Client
  • 33. Linked Data Cloud
  • 34. Linked Data Cloud
  • 35. Querying a Graph SPARQLW3C RecommendationGraph pattern matchingSimilar to SQL and Turtle
  • 36. Querying a Graph Filter, Functions, Ordering ...
  • 37. Querying a Graph Custom Functions
  • 38. Querying a Graph Property Paths
  • 39. Querying a Graph Property Paths and Inference
  • 40. Querying a Graph Subqueries
  • 41. EXT:semantic SPARQL Query Administration Default namespaces (RDFa default pro le) Syntax highlighting Code indentation Content Manager
  • 42. EXT:semantic SPARQL Query Administration Default namespaces (RDFa default pro le) Syntax highlighting Code indentation Frontend and backend Content Manager
  • 43. EXT:semantic Custom Content Elements Default layouts and custom HTML template code Support for pagination (dynamic query re-writing)
  • 44. EXT:semantic Custom Content Elements Frontend Backend
  • 45. EXT:semantic Custom Content Elements Query results variables are bound to the template variables and are used as labels in a human readable form
  • 46. Demo
  • 47. Developer Query Object Modelclass Tx_BlogExample_Domain_Repository_PostRepository extends Tx_Extbase_Persistence_Repository { public function findByTagAndBlog($tag, Tx_BlogExample_Domain_Model_Blog $blog, $limit = 20) { $query = $this->createQuery(); return $query->matching( $query->logicalAnd( $query->equals(blog, $blog), $query->equals(tags.name, $tag) ) ) ->setOrderings(array(date => Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING)) ->setLimit((integer)$limit) ->execute(); } public function findNext(Tx_BlogExample_Domain_Model_Post $post) { $query = $this->createQuery(); $posts = $query->matching($query->greaterThan(date, $post->getDate())) ->setOrderings(array(date => Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING)) ->execute(); return $posts->getFirst(); }}
  • 48. Semantic TYPO3 Current Projects SPARQL Client (EXT:semantic, Jochen Rau) RDF/RDFa support (Sebastian Kurfürst, masters thesis) CMS ontology (Andreas Wolf, GSoC) Taxonomy and Categories (EXT:taxonomy, Fabien Udriot) Semantic persistence backend (EXT:semantic, Thomas Maroschik) Globally unique identi ers in v4 (EXT:identity, Thomas Maroschik) Tagging support for Editors (v4: RTE plugin, v5: Aloha)
  • 49. Semantic TYPO3 RoadmapImprove usability of SPARQL ClientTransform Domain Models into RDF(a)Transform OWL Ontologies into PHP Code and MetadataExtbase Query Object Model -> SPARQL Query
  • 50. Semantic TYPO3 Vision
  • 51. Semantic TYPO3 Vision
  • 52. Semantic TYPO3 Vision
  • 53. Demo
  • 54. Thanks! Twitter @jocrau Email jochen.rau@typoplanet.de Blog http://blog.typoplanet.de Talk Lunch