From 95dd5aa1a827ff9f27d4f3eb8c7675940752abb9 Mon Sep 17 00:00:00 2001 From: Philipp Frischmuth Date: Fri, 29 Jul 2016 19:48:06 +0200 Subject: [PATCH 1/2] Fix support for JSON content types in Linked Data plugin JSON ist supported by serializers and the Linked Data plugin already contained mappings for JSON MIME types. They where never used however. --- extensions/linkeddataserver/LinkeddataPlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/linkeddataserver/LinkeddataPlugin.php b/extensions/linkeddataserver/LinkeddataPlugin.php index f21939bd0..75a1b4279 100644 --- a/extensions/linkeddataserver/LinkeddataPlugin.php +++ b/extensions/linkeddataserver/LinkeddataPlugin.php @@ -110,6 +110,7 @@ public function onIsDispatchable($event) case 'rdf': case 'n3': case 'ttl': + case 'json': // Check the config, whether provenance information should be included. $prov = false; if (isset($this->_privateConfig->provenance) From ef8f9f81d38a85d849e19cb26037cf29d3f0c0c3 Mon Sep 17 00:00:00 2001 From: Philipp Frischmuth Date: Fri, 29 Jul 2016 19:48:23 +0200 Subject: [PATCH 2/2] Fix indentation of mappings array --- .../linkeddataserver/LinkeddataPlugin.php | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/extensions/linkeddataserver/LinkeddataPlugin.php b/extensions/linkeddataserver/LinkeddataPlugin.php index 75a1b4279..862f843fb 100644 --- a/extensions/linkeddataserver/LinkeddataPlugin.php +++ b/extensions/linkeddataserver/LinkeddataPlugin.php @@ -28,18 +28,17 @@ class LinkeddataPlugin extends OntoWiki_Plugin * * @var array */ - private $_typeMapping - = array( - DEFAULT_TYPE => 'html', // default is xhtml - 'text/html' => 'html', // we only deliver XML-compatible html - 'application/xhtml+xml' => 'html', - 'application/rdf+xml' => 'rdf', - 'text/n3' => 'n3', - 'text/turtle' => 'ttl', - 'application/rdf+json' => 'json', - 'application/json' => 'json', - 'application/xml' => 'html' // TODO: should this be xhtml or rdf? - ); + private $_typeMapping = array( + DEFAULT_TYPE => 'html', // default is xhtml + 'text/html' => 'html', // we only deliver XML-compatible html + 'application/xhtml+xml' => 'html', + 'application/rdf+xml' => 'rdf', + 'text/n3' => 'n3', + 'text/turtle' => 'ttl', + 'application/rdf+json' => 'json', + 'application/json' => 'json', + 'application/xml' => 'html' // TODO: should this be xhtml or rdf? + ); /** * This method is called, when the onIsDispatchable event was triggered.