From: Heikki Levanto Date: Fri, 8 May 2015 09:33:53 +0000 (+0200) Subject: Fix (again!) the expansion of works and instances X-Git-Tag: v0.6~33 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=42e7b2635e16009f29515ea81f9cc1e0e4cb94c2;p=mp-sparql-moved-to-github.git Fix (again!) the expansion of works and instances Exclude triplets that start from a derived work/inst, but keep those that lead to such --- 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 } - } } } }