From 63fac78a5a009f8077953d94916017d0617f6f5e Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Mon, 11 May 2015 14:11:12 +0200 Subject: [PATCH] LOC-6: Use %v for temp variables Need to use something like %v_wt, instead of plain ?wt, so that we get the temp variable number included in the names, and will not be suing the same temp variable in multiple clauses. That would go wrong with searches like @and @atter 1=bf.author a @atter 1=bf.author b With this patch, this searches for works that have an author that has an 'a', and an author that has a 'b'. Without, it would be searching for a work that has an author with both 'a' and 'b'. Unfortunately this makes the config file even less readable. --- bibframe/triplestore.xml | 185 ++++++++++++++++++++++++---------------------- 1 file changed, 95 insertions(+), 90 deletions(-) diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index b69d5b4..a278f41 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -43,41 +43,45 @@ + + + + - - ?thing ?rel ?person . - ?person a bf:Person . - ?person bf:label %v FILTER(contains(%v, %s)) + + ?thing ?rel %vx . + %vx a bf:Person . + %vx bf:label %v FILTER(contains(%v, %s)) - ?thing ?rel ?topic . - ?topic a bf:Topic . - ?topic bf:label %v FILTER(contains(%v, %s)) + ?thing ?rel %vx . + %vx a bf:Topic . + %vx bf:label %v FILTER(contains(%v, %s)) - ?thing ?rel ?place . - ?place a bf:Place . - ?place bf:label %v FILTER(contains(%v, %s)) + ?thing ?rel %vx . + %vx a bf:Place . + %vx bf:label %v FILTER(contains(%v, %s)) - ?thing ?rel ?person . - ?person a bf:Agent . - ?person bf:label %v FILTER(contains(%v, %s)) + ?thing ?rel %vx . + %vx a bf:Agent . + %vx bf:label %v FILTER(contains(%v, %s)) - ?thing ?rel ?meeting . - ?meeting a bf:Meeting . - ?meeting bf:label %v FILTER(contains(%v, %s)) + ?thing ?rel %vx . + %vx a bf:Meeting . + %vx bf:label %v FILTER(contains(%v, %s)) - ?thing ?rel ?organization . - ?organization a bf:Organization . - ?organization bf:label %v FILTER(contains(%v, %s)) + ?thing ?rel %vx . + %vx a bf:Organization . + %vx bf:label %v FILTER(contains(%v, %s)) - ?thing ?rel ?event . - ?event a bf:Event . - ?event bf:label %v FILTER(contains(%v, %s)) + ?thing ?rel %vx . + %vx a bf:Event . + %vx bf:label %v FILTER(contains(%v, %s)) @@ -100,8 +104,8 @@ - ?thing bf:workTitle ?wt . - ?wt bf:titleValue %v FILTER(contains(%v, %s)) + ?thing bf:workTitle %v_wt . + %v_wt bf:titleValue %v FILTER(contains(%v, %s)) @@ -109,34 +113,35 @@ { - ?thing bf:workTitle ?wt . - ?wt bf:titleValue %v FILTER(contains(%v, %s)) + ?thing bf:workTitle %v_wt . + %v_wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION { ?thing bf:title %v FILTER(contains(%v, %s)) } - ?thing bf:workTitle ?wt . - ?wt bf:subtitle %v FILTER(contains(%v, %s)) + + ?thing bf:workTitle %v_wt . + %v_wt bf:subtitle %v FILTER(contains(%v, %s)) - ?thing bf:workTitle ?wt . - ?wt bf:partTitle %v FILTER(contains(%v, %s)) + ?thing bf:workTitle %v_wt . + %v_wt bf:partTitle %v FILTER(contains(%v, %s)) - ?thing bf:titleVariation ?tv . - ?tv bf:titleValue %v FILTER(contains(%v, %s)) + ?thing bf:titleVariation %v_tv . + %v_tv bf:titleValue %v FILTER(contains(%v, %s)) - ?inst bf:instanceOf ?thing . - ?inst bf:instanceTitle ?it . - ?it bf:titleValue %v FILTER(contains(%v, %s)) + %v_inst bf:instanceOf ?thing . + %v_inst bf:instanceTitle %v_tit . + %v_tit bf:titleValue %v FILTER(contains(%v, %s)) - ?thing ?titlerel ?ti . - ?ti a bf:Title + ?thing ?titlerel %v_ti . + %v_ti a bf:Title { - ?ti bf:titleValue %v FILTER(contains(%v, %s)) + %v_ti bf:titleValue %v FILTER(contains(%v, %s)) } UNION { - ?ti bf:partTitle %v FILTER(contains(%v, %s)) + %v_ti bf:partTitle %v FILTER(contains(%v, %s)) } UNION { - ?ti bf:subtitle %v FILTER(contains(%v, %s)) + %v_ti bf:subtitle %v FILTER(contains(%v, %s)) } } UNION { - ?inst bf:instanceOf ?thing . - ?inst bf:instanceTitle ?it . - ?it bf:titleValue %v FILTER(contains(%v, %s)) + %v_inst bf:instanceOf ?thing . + %v_inst bf:instanceTitle %v_ti . + %v_ti bf:titleValue %v FILTER(contains(%v, %s)) } UNION { } - ?thing bf:creator ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:creator %v_c . + %v_c bf:label %v FILTER(contains(%v, %s)) - ?thing bf:contributor ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:contributor %v_c . + %v_c bf:label %v FILTER(contains(%v, %s)) { - ?thing bf:creator ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:creator %v_c . + %v_c bf:label %v FILTER(contains(%v, %s)) } UNION { - ?thing bf:contributor ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:contributor %v_c . + %v_c bf:label %v FILTER(contains(%v, %s)) } @@ -187,8 +192,8 @@ - ?thing bf:subject ?subject . - ?subject bf:label %v FILTER(contains(%v, %s)) + ?thing bf:subject %v_su . + %v_su bf:label %v FILTER(contains(%v, %s)) @@ -257,8 +262,8 @@ - ?thing bf:instanceTitle ?it . - ?it bf:titleValue %v FILTER(contains(%v, %s)) + ?thing bf:instanceTitle %v_it . + %v_it bf:titleValue %v FILTER(contains(%v, %s)) @@ -269,8 +274,8 @@ a given title has been indexed --> { - ?thing bf:instanceTitle ?it . - ?it bf:titleValue %v FILTER(contains(%v, %s)) + ?thing bf:instanceTitle %v_it . + %v_it bf:titleValue %v FILTER(contains(%v, %s)) } UNION { ?thing bf:title %v FILTER(contains(%v, %s)) } @@ -279,13 +284,13 @@ - ?thing bf:instanceTitle ?it . - ?it bf:subtitle %v FILTER(contains(%v, %s)) + ?thing bf:instanceTitle %v_it . + %v_it bf:subtitle %v FILTER(contains(%v, %s)) - ?thing bf:instanceTitle ?it . - ?it bf:partTitle %v FILTER(contains(%v, %s)) + ?thing bf:instanceTitle %v_it . + %v_it bf:partTitle %v FILTER(contains(%v, %s)) @@ -296,56 +301,56 @@ } UNION { ?thing bf:titleStatement %v FILTER(contains(%v, %s)) } UNION { - ?thing ?titlerel ?it . - ?it a bf:Title + ?thing ?titlerel %v_it . + %v_it a bf:Title { - ?it bf:titleValue %v FILTER(contains(%v, %s)) + %v_it bf:titleValue %v FILTER(contains(%v, %s)) } UNION { - ?it bf:partTitle %v FILTER(contains(%v, %s)) + %v_it bf:partTitle %v FILTER(contains(%v, %s)) } UNION { - ?it bf:subtitle %v FILTER(contains(%v, %s)) + %v_it bf:subtitle %v FILTER(contains(%v, %s)) } } - ?thing bf:creator ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:creator %v_cr . + %v_cr bf:label %v FILTER(contains(%v, %s)) - ?thing bf:instanceOf ?work . - ?work bf:creator ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:instanceOf %v_work . + %v_work bf:creator %v_cr . + %v_cr bf:label %v FILTER(contains(%v, %s)) - ?thing bf:instanceOf ?work . - ?work bf:contributor ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:instanceOf %v_work . + %v_work bf:contributor %v_co . + %v_co bf:label %v FILTER(contains(%v, %s)) - ?thing bf:contributor ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:contributor %v_co . + %v_co bf:label %v FILTER(contains(%v, %s)) { - ?thing bf:creator ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:creator %v_cr . + %v_cr bf:label %v FILTER(contains(%v, %s)) } UNION { - ?thing bf:contributor ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:contributor %v_co . + %v_co bf:label %v FILTER(contains(%v, %s)) } UNION { - ?thing bf:instanceOf ?work . - ?work bf:creator ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:instanceOf %v_work . + %v_work bf:creator %v_wcr . + %v_wcr bf:label %v FILTER(contains(%v, %s)) } UNION { - ?thing bf:instanceOf ?work . - ?work bf:contributor ?c . - ?c bf:label %v FILTER(contains(%v, %s)) + ?thing bf:instanceOf %v_work . + %v_work bf:contributor %v_wco . + %v_wco bf:label %v FILTER(contains(%v, %s)) } @@ -364,12 +369,12 @@ FILTER(isUri(%v) && contains(str(%v), %s)) } UNION { { - ?thing bf:isbn10 ?isbn + ?thing bf:isbn10 %v_isbn } UNION { - ?thing bf:isbn13 ?isbn + ?thing bf:isbn13 %v_isbn } - ?isbn a bf:Identifier . - ?isbn bf:identifierValue %v FILTER( %v = %s ) + %v_isbn a bf:Identifier . + %v_isbn bf:identifierValue %v FILTER( %v = %s ) } -- 1.7.10.4