Virtuoso implements the HTTP-based Semantic Bank API that enables client applications to post to its RDF Triple Store. This method offers an alternative to using Virtuoso/PL functions or WebDAV uploads as the triples-insertion mechanism.
Semantic Bank was developed by MIT's SIMILE project as a back-end for its RDF content-scraper, PiggyBank.
PiggyBank? is a FireFox? plug-in which enables end-users to discover RDF content embedded within Web pages. Discovered content can then be deposited, through the Semantic Bank API, into local or remote RDF data servers known as "Semantic Banks".
Virtuoso's Semantic Bank Service is exposed via the endpoint bank .
For example, the server at http://demo.openlinksw.com/ exposes its Semantic Bank services at http://demo.openlinksw.com/bank/ .
To set up the plug-in, follow the steps below.
Using the plug-in is simple.
As stated above, a Semantic Bank is either an RDF data-store in its own right, or a gateway to such an RDF Data Store.
In the case of Virtuoso-based Semantic Banks, you access your
When querying your Semantic Bank's RDF Data via SPARQL, it is important to note that the RDF Data Set (Graph) Name for PiggyBank? generated data is : http://simile.org/piggybank/(user_name). This is especially important since a Virtuoso RDF data-store would typically host numerous RDF Graphs.
In the following examples, PiggyBank? is used to discover RDF data available from the Virtuoso Weblog.
1. Retrieve the titles of the posts based on the SIOC ontology
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix sioc: <http://rdfs.org/sioc/ns#> select ?title where { graph <http://simile.org/piggybank/[virtuoso-user-name|ods-member-name]> { ?s rdf:type sioc:Post . ?s sioc:title ?title } };
2. Retrieve posts ordered by date of publishing, newest first
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix sioc: <http://rdfs.org/sioc/ns#> select ?title, ?created where { graph <http://simile.org/piggybank/[virtuoso-user-name|ods-member-name]> { ?s rdf:type sioc:Post . ?s sioc:title ?title . ?s sioc:created_at ?created } } order by desc (?created);
3. Retrieve forum names (Weblog instance names) to which collected posts belong:
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix sioc: <http://rdfs.org/sioc/ns#> select distinct ?title where { graph <http://simile.org/piggybank/[virtuoso-user-name|ods-member-name]> { ?s rdf:type sioc:Post . ?s sioc:has_container ?container . ?container sioc:name ?title } };
4. Retrieve all Persons (name and e-mail address where specified) which are mentioned, using the FOAF ontology:
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?name ?mbox where { graph <http://simile.org/piggybank/[virtuoso-user-name|ods-member-name]> { ?s rdf:type foaf:Person . ?s foaf:name ?name optional { ?s foaf:mbox ?mbox } } };
1. From your machine go to FireFox?->Tools->PiggyBank?->My Semantic Bank Accounts
2. Add in the shown form:
3. Go to demo.openlinksw.com/ods
4. Log in as user demo, password: demo
5. Go to the Weblog tab from the main ODS Navigation
6. Click the "MyBlog?" instance name.
7. When the weblog home page is loaded, click Alt + P.
8. As result is shown the "My PiggyBank?" page with all the collected information presented in items.
9. For several of the items add Tags from the form "Tag" shown for each of them.
10. As result should be shown the message "Last updated: [here goes the date value].
11. You can also click "Save" and "Publish" for these items.
12. Go to http://demo.openlinksw.com/sparql
13. Enter for the "Default Graph URI" field: http://simile.org/piggybank/demo
14. Enter for the "Query text" text-area:
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix sioc: <http://rdfs.org/sioc/ns#> select * from <http://simile.org/piggybank/demo> where {?s ?p ?o}
15. Click "Run Query".
16. As results are shown the found results.
CategoryWebSite CategoryVirtuoso CategoryOpenSource