From: Heikki Levanto Date: Tue, 17 Feb 2015 10:33:03 +0000 (+0100) Subject: MPSPARQL-8: Use OPTIONAL for all fields in the "work" db X-Git-Tag: v0.4~12 X-Git-Url: http://git.indexdata.com/?p=mp-sparql-moved-to-github.git;a=commitdiff_plain;h=2ba1be81c6e39a049ea5ae80aa999dd8e0d2efae MPSPARQL-8: Use OPTIONAL for all fields in the "work" db Seems to work all right, although we don't have enough test data to see records without subjects or authors --- diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index 2e53a31..477eb24 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -6,14 +6,20 @@
SELECT DISTINCT ?work ?wtitle ?creatorlabel ?subjectlabel
?work a bf:Work - ?work bf:workTitle ?wt - ?wt bf:titleValue ?wtitle + OPTIONAL { + ?work bf:workTitle ?wt . + ?wt bf:titleValue ?wtitle } + + OPTIONAL { + ?work bf:creator ?creator . + ?creator bf:label ?creatorlabel } + + OPTIONAL { + ?work bf:subject ?subject . + ?subject bf:label ?subjectlabel } + ?wt bf:titleValue %v FILTER(contains(%v, %s)) - ?work bf:creator ?creator - ?creator bf:label ?creatorlabel ?creator bf:label %v FILTER(contains(%v, %s)) - ?work bf:subject ?subject - ?subject bf:label ?subjectlabel ?subject bf:label %v FILTER(contains(%v, %s))