From 36ef98cd8e62046c02aa1bff3a74ee14f6151d9a Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Thu, 30 Apr 2015 11:28:27 +0200 Subject: [PATCH] Towards LOC-7: experimental BF-FI, works with instances --- bibframe/triplestore.xml | 53 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index 27220ea..5e41731 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -4,9 +4,9 @@ - + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns bf: http://bibframe.org/vocab/ @@ -37,21 +37,62 @@ WHERE { ?work a bf:Work . ?work ?rel ?obj . - OPTIONAL { + OPTIONAL { ?obj ?rel1 ?obj1 MINUS { ?obj a bf:Work } } - OPTIONAL { + OPTIONAL { ?obj1 ?rel2 ?obj2 MINUS { ?obj1 a bf:Work } } - OPTIONAL { + OPTIONAL { ?obj2 ?rel3 ?obj3 MINUS { ?obj2 a bf:Work } } ?work ?rel ?obj FILTER( str(?work) = %s ) } + + CONSTRUCT { %u ?rel ?obj . + ?obj ?rel1 ?obj1 . + ?obj1 ?rel2 ?obj2 . + ?obj2 ?rel3 ?obj3 . + ?inst ?irel1 ?iobj1 . + ?iobj1 ?irel2 ?iobj2 . + ?iobj2 ?irel3 ?iobj3 } + WHERE { + %u a bf:Work . + %u ?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 } + } + OPTIONAL { + ?inst bf:instanceOf %u + } + OPTIONAL { + ?inst ?irel1 ?iobj1 + } + OPTIONAL { + ?iobj1 ?irel2 ?iobj2 + } + OPTIONAL { + ?iobj2 ?irel3 ?iobj3 + } + } + -- 1.7.10.4