Replication Example: Chain Topology
- Introduction
- Prerequisites
- Create Publication on db1
- Create subscription from db2 to db1's Publication
- Create Publication on db2
- Create subscription from db3 to db2's Publication
- Insert Data into a Named Graph on the db1 Virtuoso Instance
- Check data on the Destination instances db2 and db3
- Add new data on db1
- Check again data on the Destination instances db2 and db3
- Related
Introduction
The following How-To walks you through setting up Virtuoso RDF Graph Replication in a Chain Topology.
Prerequisites
Database INI Parameters
Suppose there are 3 Virtuoso instances respectively with the following ini parameters values:
- virtuoso1.ini:
... [Database] DatabaseFile = virtuoso1.db TransactionFile = virtuoso1.trx ErrorLogFile = virtuoso1.log ... [Parameters] ServerPort = 1111 SchedulerInterval = 1 ... [HTTPServer] ServerPort = 8891 ... [URIQA] DefaultHost = localhost:8891 ... [Replication] ServerName = db1 ...
- virtuoso2.ini:
... [Database] DatabaseFile = virtuoso2.db TransactionFile = virtuoso2.trx ErrorLogFile = virtuoso2.log ... [Parameters] ServerPort = 1112 SchedulerInterval = 1 ... [HTTPServer] ServerPort = 8892 ... [URIQA] DefaultHost = localhost:8892 ... [Replication] ServerName = db2 ...
- virtuoso3.ini:
... [Database] DatabaseFile = virtuoso3.db TransactionFile = virtuoso3.trx ErrorLogFile = virtuoso3.log ... [Parameters] ServerPort = 1113 SchedulerInterval = 1 ... [HTTPServer] ServerPort = 8893 ... [URIQA] DefaultHost = localhost:8893 ... [Replication] ServerName = db3 ...
Database DSNs
Use the ODBC Administrator on your Virtuoso host (e.g., on Windows, Start menu -> Control Panel -> Administrative Tools -> Data Sources (ODBC); on Mac OS X, /Applications/Utilities/OpenLink ODBC Administrator.app
) to create a System DSN for each of db1, db2, db3, with names db1, db2 and db3, respectively.
Install Conductor package
On each of the 3 Virtuoso instances install the conductor_dav.vad package.
Create Publication on db1
- Go to http://localhost:8891/conductor and log in as dba
- Go to Conductor -> Replication -> Transactional -> Publications
- Click Enable RDF Publishing
- As result publication with the name RDF Publication should be created
- Click the link which is the publication name.
- The publication items page will be shown:
- Enter for Graph IRI:
http://example.org
- Click Add New
- The item will be created and shown in the list of items for the currently viewed publication.
Create subscription from db2 to db1's Publication
- Log in at http://localhost:8892/conductor.
- Go to Replication -> Transactional -> Subscriptions:
- Click New Subscription:
- From the list of "Specify new data source" select Data Source db1:
- Enter for db1 dba user credentials:
- Click "Add Data Source":
- As result db1 will be shown in the "Connected Data Sources" list.
- Click "Publications list":
- As result will be shown the list of available publications for the selected data source.
Select the one with name "RDF Publication" and click "List Items".
- As result will be shown the "Confirm subscription" page.
- The sync interval by default is 10 minutes.
For the testing purposes, we will change it to 1 minute.
- Click "Subscribe".
- The subscription will be created.
Create Publication on db2
- Go to http://localhost:8892/conductor and log in as dba,
- Go to Conductor -> Replication -> Transactional -> Publications:
- Click Enable RDF Publishing:
- As result publication with the name RDF Publication should be created:
- Click the link which is the publication name.
- The publication items page will be shown:
- Enter for Graph IRI:
http://example.org
- Click Add New.
- The item will be created and shown in the list of items for the currently viewed publication.
Create subscription from db3 to db2's Publication
- Log in at http://localhost:8893/conductor.
- Go to Replication -> Transactional -> Subscriptions:
- Click New Subscription:
- From the list of "Specify new data source" select Data Source db2:
- Enter for db2 dba user credentials:
- Click "Add Data Source":
- As result db2 will be shown in the "Connected Data Sources" list.
Select it and click "Publications list":
- As result will be shown the list of available publications for the selected data source.
Select the one with name "RDF Publication" and click "List Items".
- As result will be shown the "Confirm subscription" page.
- The sync interval by default is 10 minutes.
For the testing purposes, we will change it to 1 minute.
- Click "Subscribe".
- The subscription will be created.
Insert Data into a Named Graph on the db1 Virtuoso Instance
- Log in at http://localhost:8891/conductor.
- Go to Linked Data-> Quad Store Upload:
- In the shown form:
- Tick the box for Resource URL and enter your resource URL, e.g.:
http://www.openlinksw.com/dataspace/person/kidehen@openlinksw.com#this
- Enter for Named Graph IRI:
http://example.org
- Tick the box for Resource URL and enter your resource URL, e.g.:
- Click Upload.
- Should be shown message for successful upload:
- Check the count of the inserted triples by executing a query like the following against the SPARQL endpoint, http://localhost:8891/sparql:
SELECT COUNT(*) FROM <http://example.org> WHERE { ?s ?p ?o }
- Should be shown 57 as total.
Check data on the Destination instances db2 and db3
- To check the starting count, on each of the Destination Virtuoso Instances db2 and db3 from SPARQL Endpoint execute:
SELECT COUNT(*) FROM <http://example.org> WHERE { ?s ?p ?o }
- Should return 57 as total.
Add new data on db1
- Disconnect db2 and db3.
- On the Host Virtuoso Instance db1 go to Conductor -> Database -> Interactive SQL enter the following statement:
SPARQL INSERT INTO GRAPH <http://example.org> { <http://www.openlinksw.com/dataspace/person/kidehen@openlinksw.com#this> <http://xmlns.com/foaf/0.1/interest> <http://dbpedia.org/resource/Web_Services> } ; SPARQL INSERT INTO GRAPH <http://example.org> { <http://www.openlinksw.com/dataspace/person/kidehen@openlinksw.com#this> <http://xmlns.com/foaf/0.1/interest> <http://dbpedia.org/resource/Web_Clients> } ; SPARQL INSERT INTO GRAPH <http://example.org> { <http://www.openlinksw.com/dataspace/person/kidehen@openlinksw.com#this> <http://xmlns.com/foaf/0.1/interest> <http://dbpedia.org/resource/SPARQL> } ;
- Click "Execute".
- As result the triples will be inserted:
- Check the count of the destination instance graph's triples by executing the following query like against the SPARQL endpoint, http://localhost:8891/sparql:
SELECT COUNT(*) FROM <http://example.org> WHERE { ?s ?p ?o }
- Should be shown 60 as total.
Check again data on the Destination instances db2 and db3
- Start instances db2 and db3.
- To confirm that the triple count has increased by the number of inserted triples, execute the following on the Destination Virtuoso Instance db2 and db3 SPARQL Endpoint:
SELECT COUNT(*) FROM <http://example.org> WHERE { ?s ?p ?o }
- Should be shown 60 as total:
Related
- Replication Example: Star Topology
- Replication Example: 2-node Bi-directional Topology
- Set up RDF Replication via procedure calls
- Example of Linked Data Usage of PubSubHubbub Implementation
- Exploit Virtuoso's Replication Functionality Web based Solutions