-
Notifications
You must be signed in to change notification settings - Fork 15
Mirroring multiple domains
NOTE: THIS IS AN EXPERIMENTAL FEATURE, SO EXPECT BUGS
There are many use cases where it is desirable to mirror more than one domain. Since version 20130612, LODSPeaKr supports multiple domain mirroring
##Example
Suppose we have data from two different namespaces, http://a.org
and http://b.org
. The data from one domain is linked to data from the other domain, so we may want to serve both.
@prefix a: <http://a.org/> .
@prefix b: <http://b.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
a:asd a foaf:Person;
rdfs:label "Persona A" ;
foaf:knows b:asd .
b:asd a foaf:Person;
rdfs:label "Persona B";
foaf:knows a:asd .
We want LODSPeaKr to mint URIs for each domain. To avoid possible conflicts in mirroring multiple domains (say, for http://a.org/asd
and http://b.org/asd
), we need to define different namespaces
In settings.inc.php
, we add the following lines:
$conf['ns']['base'] = 'http://a.org/'; // You already have this one
$conf['mirror_external_uris'][""] = "http://a.org/";
$conf['mirror_external_uris']["b"] = "http://b.org/";
The ""
and "b"
indicate the string in the URI that will differentiate both domains. This means that
-
http://a.org/asd
will be mirrored ashttp://local/asd
-
http://b.org/asd
will be mirrored ashttp://local/b/asd
Please note that for now, you need one namespace to be empty string ""
. This may not be needed in the future though
It is also a good idea to add all the domains to the list of namespaces, by including:
$conf['ns']['b'] = 'http://b.org/';