From 24426789587262eecf32286b0655b2314977b6eb Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Thu, 7 May 2015 15:37:52 +0200 Subject: [PATCH] More refactoring tidy up the BF-F format, esp for "work". And the "anytitle" search for "work", the same way as "instance" is. --- bibframe/triplestore.xml | 88 ++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 58 deletions(-) diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index 28f34c0..f59629e 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -116,8 +116,15 @@ { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION { ?wt bf:partTitle %v FILTER(contains(%v, %s)) } } UNION { - ?thing bf:titleVariation ?tv . - ?tv bf:titleValue %v FILTER(contains(%v, %s)) + ?thing ?titlerel ?ti . + ?ti a bf:Title + { + ?ti bf:titleValue %v FILTER(contains(%v, %s)) + } UNION { + ?ti bf:partTitle %v FILTER(contains(%v, %s)) + } UNION { + ?ti bf:subtitle %v FILTER(contains(%v, %s)) + } } UNION { ?inst bf:instanceOf ?thing . ?inst bf:instanceTitle ?it . @@ -159,42 +166,9 @@ - + CONSTRUCT { - ?thing ?rel ?obj . - ?obj ?rel1 ?obj1 . - ?obj1 ?rel2 ?obj2 . - ?obj2 ?rel3 ?obj3 - } - WHERE { - - ?thing a bf:Work . - ?thing ?rel ?obj . - OPTIONAL { - ?obj ?rel1 ?obj1 - MINUS { ?obj a bf:Work } - MINUS { ?obj a bf:Instance } - } - OPTIONAL { - ?obj1 ?rel2 ?obj2 - MINUS { ?obj1 a bf:Work } - MINUS { ?obj1 a bf:Instance } - } - OPTIONAL { - ?obj2 ?rel3 ?obj3 - MINUS { ?obj2 a bf:Work } - MINUS { ?obj2 a bf:Instance } - } - ?thing ?rel ?obj FILTER( str(?thing) = %s ) - - - } - - - - - CONSTRUCT { %u ?rel ?wobj1 . ?wobj1 ?wrel1 ?wobj2 . ?wobj2 ?wrel2 ?wobj3 . @@ -210,31 +184,29 @@ ?wobj ?wrel1 ?wobj1 MINUS { ?wobj a bf:Work } MINUS { ?wobj a bf:Instance } + OPTIONAL { + ?wobj1 ?wrel2 ?wobj2 + MINUS { ?wobj1 a bf:Work } + MINUS { ?wobj1 a bf:Instance } + OPTIONAL { + ?wobj2 ?wrel3 ?wobj3 + MINUS { ?wobj2 a bf:Work } + MINUS { ?wobj2 a bf:Instance } + } + } } - OPTIONAL { - ?wobj1 ?wrel2 ?wobj2 - MINUS { ?wobj1 a bf:Work } - MINUS { ?wobj1 a bf:Instance } - } - OPTIONAL { - ?wobj2 ?wrel3 ?wobj3 - MINUS { ?wobj2 a bf:Work } - MINUS { ?wobj2 a bf:Instance } - } - OPTIONAL { ?inst bf:instanceOf %u - } - - OPTIONAL { - ?inst ?irel1 ?iobj1 - } - OPTIONAL { - ?iobj1 ?irel2 ?iobj2 - } - OPTIONAL { - ?iobj2 ?irel3 ?iobj3 + OPTIONAL { + ?inst ?irel1 ?iobj1 + OPTIONAL { + ?iobj1 ?irel2 ?iobj2 + OPTIONAL { + ?iobj2 ?irel3 ?iobj3 + } + } + } } } @@ -242,7 +214,7 @@ - + ?thing a bf:Instance -- 1.7.10.4