Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
The Apache settings to dispatch requests against
http://sweetontology.net are described below.
- Semantic serializations (https://github.com/ESIPFed/sweet/issues/51)
- HTML dispatch (https://github.com/ESIPFed/sweet/issues/70)
COR-enabled dispatch of requests against
The Apache settings for purposes of resolving requests against
sweetontology.net via COR are captured in
/etc/httpd/conf.d/sweetontology.conf on the same GMU/ECITE server where the COR is deployed:
<VirtualHost *:80> ServerName sweetontology.net DocumentRoot "/var/www/html/sweetontology.net" AliasMatch "/?" "/var/www/html/sweetontology.net/index.html" RewriteEngine On RewriteRule ^/ont ^/ont/.* [L,R=404] RewriteRule /(.+) http://cor.esipfed.org/ont/api/v0/ont?iri=http://sweetontology.net/$1 [P,QSA,NE,L] </VirtualHost>
As a placeholder, I created
/var/www/html/sweetontology.net/index.htmland set a corresponding alias for resolution of the domain name itself, http://sweetontology.net.
Such base name request could be used to provide general information about SWEET, etc. Or a simple redirect can also be indicated.
Because of the subsequent rule, to avoid confusion in case of requests to
/ontis where COR is deployed on
cor.esipfed.org), I set a rule to simply respond with 404. Without this rule, this
/ont/*request would be processed by the subsequent rule, resulting in some unintended partial dispatch by the COR, which should simply be avoided.
Then comes the key rule for the transparent resolution of
http://cor.esipfed.org/ont/api/v0/ont?iri=http://sweetontology.net/<NAME>. The flags here mean:
P: Proxy resolution.
QSA: Allows to append any query string to the
iri=...indicated for the resolution. This allows to resolve a particular desired format via the
formatparameter (eg., http://sweetontology.net/stateEnergyFlux?format=rdf, or, similarly, a particular version (eg., http://sweetontology.net/stateEnergyFlux?version=YYYYMMDDTHHMMSS`.
NE: No escape of characters like
L: Last rule to be applied.