From: Heikki Levanto Date: Tue, 17 Feb 2015 13:48:32 +0000 (+0100) Subject: MPSPARQL-7: Deduplicate the $work X-Git-Tag: v0.4~8 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=55a5237e7ece9ae9a11c2b1ed72d202fdb7957ac;p=mp-sparql-moved-to-github.git MPSPARQL-7: Deduplicate the $work Will only list one line for each $work we find. So we only get one author, title, and subject. --- diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index db8aae6..ff4498a 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -3,7 +3,12 @@ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?work ?wtitle ?creatorlabel ?subjectlabel
+
SELECT + ?work + MAX(?wtitle) AS ?title + MAX(?creatorlabel) AS ?creator + MAX(?subjectlabel) AS ?subject +
?work a bf:Work OPTIONAL { @@ -27,6 +32,7 @@ UNION { ?subject bf:label %v FILTER(contains(%v, %s)) } } + GROUP BY $work
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns