From 07416e8b5374c2af0157d24eb8d49ea508e68200 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 8 May 2015 11:09:07 +0200 Subject: [PATCH] Fix bug in the MINUS clauses and simplify the anytitle search in works --- bibframe/triplestore.xml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index f59629e..95e5735 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -108,15 +108,11 @@ - { - ?thing bf:workTitle ?wt . - { ?wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION - { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION - { ?wt bf:partTitle %v FILTER(contains(%v, %s)) } - } UNION { - ?thing ?titlerel ?ti . + ?thing bf:title %v FILTER(contains(%v, %s)) + } UNION { + ?thing ?titlerel ?ti . ?ti a bf:Title { ?ti bf:titleValue %v FILTER(contains(%v, %s)) @@ -130,7 +126,6 @@ ?inst bf:instanceTitle ?it . ?it bf:titleValue %v FILTER(contains(%v, %s)) } UNION { - ?thing bf:title %v FILTER(contains(%v, %s)) } @@ -182,16 +177,16 @@ OPTIONAL { ?wobj ?wrel1 ?wobj1 - MINUS { ?wobj a bf:Work } - MINUS { ?wobj a bf:Instance } + MINUS { ?wobj1 a bf:Work } + MINUS { ?wobj1 a bf:Instance } OPTIONAL { ?wobj1 ?wrel2 ?wobj2 - MINUS { ?wobj1 a bf:Work } - MINUS { ?wobj1 a bf:Instance } + MINUS { ?wobj2 a bf:Work } + MINUS { ?wobj2 a bf:Instance } OPTIONAL { ?wobj2 ?wrel3 ?wobj3 - MINUS { ?wobj2 a bf:Work } - MINUS { ?wobj2 a bf:Instance } + MINUS { ?wobj3 a bf:Work } + MINUS { ?wobj3 a bf:Instance } } } } @@ -319,7 +314,7 @@ } - + CONSTRUCT { @@ -335,12 +330,12 @@ %u ?irel1 ?iobj1 OPTIONAL { ?iobj1 ?irel2 ?iobj2 - MINUS { ?iobj1 a bf:Work } - MINUS { ?iobj1 a bf:Instance } + MINUS { ?iobj2 a bf:Work } + MINUS { ?iobj2 a bf:Instance } OPTIONAL { ?iobj2 ?irel3 ?iobj3 - MINUS { ?iobj2 a bf:Work } - MINUS { ?iobj2 a bf:Instance } + MINUS { ?iobj3 a bf:Work } + MINUS { ?iobj3 a bf:Instance } } } -- 1.7.10.4