From 42e7b2635e16009f29515ea81f9cc1e0e4cb94c2 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 8 May 2015 11:33:53 +0200 Subject: [PATCH] Fix (again!) the expansion of works and instances Exclude triplets that start from a derived work/inst, but keep those that lead to such --- bibframe/triplestore.xml | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index 95e5735..000f8ce 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -176,30 +176,27 @@ %u ?rel ?wobj1 . OPTIONAL { - ?wobj ?wrel1 ?wobj1 + ?wobj1 ?wrel2 ?wobj2 MINUS { ?wobj1 a bf:Work } MINUS { ?wobj1 a bf:Instance } OPTIONAL { - ?wobj1 ?wrel2 ?wobj2 + ?wobj2 ?wrel3 ?wobj3 MINUS { ?wobj2 a bf:Work } MINUS { ?wobj2 a bf:Instance } - OPTIONAL { - ?wobj2 ?wrel3 ?wobj3 - MINUS { ?wobj3 a bf:Work } - MINUS { ?wobj3 a bf:Instance } - } } } OPTIONAL { - ?inst bf:instanceOf %u - OPTIONAL { - ?inst ?irel1 ?iobj1 + ?inst bf:instanceOf %u . + ?inst ?irel1 ?iobj1 + OPTIONAL { + ?iobj1 ?irel2 ?iobj2 + MINUS { ?iobj1 a bf:Work } + MINUS { ?iobj1 a bf:Instance } OPTIONAL { - ?iobj1 ?irel2 ?iobj2 - OPTIONAL { - ?iobj2 ?irel3 ?iobj3 - } + ?iobj2 ?irel3 ?iobj3 + MINUS { ?iobj2 a bf:Work } + MINUS { ?iobj2 a bf:Instance } } } } @@ -341,19 +338,15 @@ OPTIONAL { %u bf:instanceOf ?work + ?work ?wrel1 ?wobj1 OPTIONAL { - ?work ?wrel1 ?wobj1 + ?wobj1 ?wrel2 ?wobj2 MINUS { ?wobj1 a bf:Work } MINUS { ?wobj1 a bf:Instance } OPTIONAL { - ?wobj1 ?wrel2 ?wobj2 + ?wobj2 ?wrel3 ?wobj3 MINUS { ?wobj2 a bf:Work } MINUS { ?wobj2 a bf:Instance } - OPTIONAL { - ?wobj2 ?wrel3 ?wobj3 - MINUS { ?wobj3 a bf:Work } - MINUS { ?wobj3 a bf:Instance } - } } } } -- 1.7.10.4