From 2ba1be81c6e39a049ea5ae80aa999dd8e0d2efae Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Tue, 17 Feb 2015 11:33:03 +0100 Subject: [PATCH] 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 --- bibframe/triplestore.xml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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)) -- 1.7.10.4