Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 14fbe19

Browse files
authored
Merge pull request #366 from AKSW/feature/add-data-route
Add data shortcut route, update Linked Data plugin
2 parents 1003739 + 5ad83ec commit 14fbe19

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

application/config/default.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ routes.properties.defaults.action = "properties"
131131
routes.instances.route = "list/*"
132132
routes.instances.defaults.controller = "resource"
133133
routes.instances.defaults.action = "instances"
134+
routes.data.route = "data/*"
135+
routes.data.defaults.controller = "resource"
136+
routes.data.defaults.action = "export"
134137
routes.sparql.route = "sparql/*"
135138
routes.sparql.defaults.controller = "service"
136139
routes.sparql.defaults.action = "sparql"

extensions/linkeddataserver/LinkeddataPlugin.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,16 @@ public function onIsDispatchable($event)
121121

122122
// Special case: If the graph URI is identical to the requested URI, we export
123123
// the whole graph instead of only data regarding the resource.
124+
$urlSpec = array();
124125
if ($graph === $uri) {
125-
$controllerName = 'model';
126-
$actionName = 'export';
126+
$urlSpec = array('controller' => 'model', 'action' => 'export');
127127
} else {
128-
$controllerName = 'resource';
129-
$actionName = 'export';
128+
$urlSpec = array('route' => 'data');
130129
}
131130

132131
// Create a URL with the export action on the resource or model controller.
133132
// Set the required parameters for this action.
134-
$url = new OntoWiki_Url(
135-
array('controller' => $controllerName, 'action' => $actionName),
136-
array()
137-
);
133+
$url = new OntoWiki_Url($urlSpec, array());
138134
$url->setParam('r', $uri, true)
139135
->setParam('f', $type)
140136
->setParam('m', $graph)

0 commit comments

Comments
 (0)