Query the Linked Data Cloud using TYPO3
The Semantic Web is coming to a TYPO3 installation near you. During the TYPO3 Transition Days 2011 in Berlin a couple of Developers—including me—discussed about how to implement some aspects of the Semantic Web Stack for TYPO3. One of the first outcome is the new Extension “semantic” providing a SPARQL Client.
You can query the Linked Data Cloud—which includes the content of Wikipedia—by specifying a Query in the SPARQL Protocol and RDF Query Language. For example, the statement to query for People born in Boston before 1900 looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | PREFIX foaf: <http: //xmlns.com/foaf/0.1/> PREFIX dbr: <http: //dbpedia.org/resource/> PREFIX dbo: <http: //dbpedia.org/ontology/> PREFIX xsd: <http: //www.w3.org/2001/XMLSchema#> SELECT ?resource ?name ?birthDate ?deathDate WHERE { ?resource a foaf:Person . ?resource foaf:name ?name . ?resource dbo:birthPlace dbr:Boston . ?resource dbo:birthDate ?birthDate . ?resource dbo:deathDate ?deathDate . FILTER (?birthDate < "1900-01-01"^^xsd:date) } ORDER BY ?deathDate |
In the following video I will guide you through the installation of the Extension “semantic” and demo some of its features.
I have also recorded the first fifteen minutes in the life of the extension. In the following video you see how I kickstarted the extension. Keep in mind that the library ARC2 I used in this first step isn’t part of the extension anymore. All the code is now written from scratch, including the SPARQL Query Parser (see other posting).
If you have any specific questions about the extension or found an issue, please visit the projects page on Forge so we can keep track of it. You might also want to have a look at our roadmap or visit the Homepage of the TYPO3 community.
+1
Hope we get really some things “done done” ;)
Hi Jochen,
This looks really cool. Great job!
Cheers, Rik
Hey Jochen,
This looks really great! Thanks for sharing and thanks for the detailed explanations in the video.
How much of the code is actually an API that can be used in other extensions (I’m thinking mostly of the SPARQL parser and the code that actually executes the SPARQL query)?
The Query Result Parser is independent from Extbase (and even from TYPO3). The other components rely on Extbase. Regarding an API being usable for other extensions, it is more important to have a full blown Query Object Model. So one can build a Query programmatically like it is already possible in Extbase. I plan to implement a serializer to turn the existing Query Object of Extbase into a SPARQL statement.
Well, I was thinking of 2 things mostly. One is my external_import extension. If I can call some class from “semantic” with a reference to a SPARQL query (using its uid) and get results back, it would be possible to make a “SPARQL connector” (for my family of connector services) and thus use SPARQL queries to get and store data into TYPO3 tables.
Second is the “Tesseract” suite of extensions which I developed and which follow a pattern very similar to what you show in “semantic”: one component is used to defined the query, another is used for the display. On top of that, Tesseract has a “Data Filter” component which is used to get data from many source (in particular GET/POST) and assemble conditions based on them. These conditions are then injected into the query component and turned into appropriate conditions (SQL or other). So it might be interesting to have a semantic provider for Tesseract, and if you have a query builder this should not be such a complicated task.
Hi! Thanks for that great extension!
Unfortunately I made a big mistake and deselected “include Static Template”.
I got the warning: “Fatal error: Class ‘Tx_Extbase_Utility_Extension’ not found in /home/…/public_html/typo3conf/temp_CACHED_ps0bdd_ext_localconf.php on line x”,
than I cleared “semantic” in the localconf.php and deleted the temp_CACHED files.
If I try to install the extension again, I get the warning: “Import static data: tx_semantic_domain_model_rdf_namespace Rows: 31 Table exists!” and I get a Fatal error (as above) again…
What else needs to be deleted where, so that I am able to reinstall the extension?
I am a beginner so I would really be glad if you could help me with this first step.
Thank you very much!