From 2695b304a060ea9b8d09a30be9e74c32287826ba Mon Sep 17 00:00:00 2001 From: Tesselation Date: Fri, 31 Jul 2015 14:30:29 +0200 Subject: [PATCH] Bugfix: Return error message if a resource contains no content --- changelog.html | 4 ++++ errors.xml | 5 +++++ extract.xql | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 errors.xml diff --git a/changelog.html b/changelog.html index 46a701f..68f4c4b 100755 --- a/changelog.html +++ b/changelog.html @@ -8,6 +8,10 @@

Generated page

Changelog

+

1.2.1

+
    +
  • BUGFIX: Return error message if a resource contains no content
  • +

1.2.0

  • INFO: Minor changes to documentation.
  • diff --git a/errors.xml b/errors.xml new file mode 100644 index 0000000..ffac983 --- /dev/null +++ b/errors.xml @@ -0,0 +1,5 @@ + + + Resource contains no content + + \ No newline at end of file diff --git a/extract.xql b/extract.xql index 12e9611..a3d1cbd 100755 --- a/extract.xql +++ b/extract.xql @@ -238,10 +238,12 @@ declare function xtriples:extractTriples($currentResource as node(), $resourceIn (: set the content of the current resource :) let $currentResource := (: it can be a resource tag with an URI :) - if (xs:anyURI($currentResource/@uri)) then + if (xs:anyURI($currentResource/@uri) and fn:doc-available($currentResource/@uri)) then fn:doc($currentResource/@uri) (: or a resource tag with children :) - else $currentResource/* + else if ($currentResource/*) then + $currentResource/* + else fn:doc("errors.xml")//error[@type='resource_no_content'] (: start statement pattern extraction :) for $statement in $configuration//triples/*