forked from iRail/The-DataTank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
semanticsitemap.php
36 lines (32 loc) · 1.44 KB
/
semanticsitemap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Description of semanticsitemap
*
* @author Miel Vander Sande
*/
include_once 'model/ResourcesModel.class.php';
include_once 'aspects/caching/Cache.class.php';
include_once 'Config.class.php';
include_once 'includes/rb.php';
R::setup(Config::$DB, Config::$DB_USER, Config::$DB_PASSWORD);
$doc = ResourcesModel::getInstance()->getAllDoc();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
echo "<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:sc='http://sw.deri.org/2007/07/sitemapextension/scschema.xsd'>\n";
foreach ($doc as $package => $resources) {
echo "\t<sc:dataset>\n";
echo "\t\t<sc:datasetLabel>" . $package . "</sc:datasetLabel>\n";
echo "\t\t<sc:datasetURI>" . Config::$HOSTNAME . Config::$SUBDIR . $package . "</sc:datasetURI>\n";
//echo "\t\t<sc:linkedDataPrefix slicing=''>" . Config::$HOSTNAME . Config::$SUBDIR . $package . "</sc:linkedDataPrefix>\n";
foreach ($resources as $resource => $val) {
if (property_exists($val, 'requiredparameters')) {
if (count($val->requiredparameters) == 0)
echo "\t\t<sc:dataDumpLocation>" . Config::$HOSTNAME . Config::$SUBDIR . $package . $resource . ".rdf_ntriple" . "</sc:dataDumpLocation>\n";
}
}
echo "\t\t<lastmod></lastmod>\n";
echo "\t\t<sc:sparqlEndpointLocation></sc:sparqlEndpointLocation>\n";
echo "\t\t<changefreq>monthly</changefreq>\n";
echo "\t</sc:dataset>\n";
}
echo "</urlset>"
?>