From f3b97dd7bbcd61130b4a89dfa50d105a1160e344 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Thu, 30 Apr 2015 14:59:59 +0200 Subject: [PATCH] Towards LOC-7: Using the include system for all small bases Also some experiments with entities, that seem not to work (yet?) --- bibframe/triplestore.xml | 269 ++++++++++++++++++++++------------------------ 1 file changed, 127 insertions(+), 142 deletions(-) diff --git a/bibframe/triplestore.xml b/bibframe/triplestore.xml index 5e41731..5904c59 100644 --- a/bibframe/triplestore.xml +++ b/bibframe/triplestore.xml @@ -1,3 +1,39 @@ + + + + + + + +]> + @@ -21,15 +57,15 @@ ?work bf:subject ?subject . ?subject bf:label %v FILTER(contains(%v, %s)) - + CONSTRUCT { ?work ?rel ?subj } WHERE { ?work a bf:Work . ?work ?rel ?subj . ?work ?rel ?obj FILTER( str(?work) = %s ) } - - + + CONSTRUCT { ?work ?rel ?obj . ?obj ?rel1 ?obj1 . ?obj1 ?rel2 ?obj2 . @@ -51,37 +87,38 @@ } ?work ?rel ?obj FILTER( str(?work) = %s ) } - - - CONSTRUCT { %u ?rel ?obj . - ?obj ?rel1 ?obj1 . - ?obj1 ?rel2 ?obj2 . - ?obj2 ?rel3 ?obj3 . + + + CONSTRUCT { %u ?rel ?wobj1 . + ?wobj1 ?wrel1 ?wobj2 . + ?wobj2 ?wrel2 ?wobj3 . ?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 } - } + %u ?rel ?wobj1 . OPTIONAL { ?inst bf:instanceOf %u } + &workfull; + OPTIONAL { + ?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 { ?inst ?irel1 ?iobj1 } @@ -91,10 +128,11 @@ OPTIONAL { ?iobj2 ?irel3 ?iobj3 } + } - + - + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns bf: http://bibframe.org/vocab/ @@ -106,22 +144,30 @@ ?instance bf:format %s - - + + + + + + + + + ?thing bf:label %v FILTER(contains(%v, %s)) + ?thing bf:label %v FILTER(contains(%v, %s)) + + + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?place
- ?place a bf:Place - ?place ?rel ?obj - ?place bf:label %v FILTER(contains(%v, %s)) - ?place bf:label %v FILTER(contains(%v, %s)) - ?place bf:label %v FILTER(contains(%v, %s)) - +
SELECT DISTINCT ?thing
+ ?thing ?rel ?obj + CONSTRUCT { %u ?rel ?obj } WHERE { %u ?rel ?obj . } -
+ - + CONSTRUCT { %u ?rel ?obj . ?obj ?rel1 ?obj1 . - } WHERE { %u ?rel ?obj . OPTIONAL { ?obj ?rel1 ?obj1 } - } - +
- - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?place ?relatedTo ?authorizedAccessPoint
- ?place a bf:Place - ?place bf:label ?label - OPTIONAL { ?place bf:identifier ?id} - OPTIONAL { ?place bf:relatedTo ?relatedTo} - OPTIONAL { ?place bf:authorizedAccessPoint ?authorizedAccessPoint} - ?place bf:label %v FILTER(contains(%v, %s)) - ?place bf:label %v FILTER(contains(%v, %s)) + + + + ?thing a bf:Place + ?thing bf:label %v FILTER(contains(%v, %s)) - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?person ?relatedTo ?authorizedAccessPoint
- ?person a bf:Person - ?person bf:label ?label - OPTIONAL { ?person bf:identifier ?id} - OPTIONAL { ?person bf:relatedTo ?relatedTo} - OPTIONAL { ?person bf:authorizedAccessPoint ?authorizedAccessPoint} - ?person bf:label %v FILTER(contains(%v, %s)) - ?person bf:label %v FILTER(contains(%v, %s)) + + ?thing a bf:Person + ?thing bf:label %v FILTER(contains(%v, %s)) - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?meeting ?relatedTo ?authorizedAccessPoint
- ?meeting a bf:Meeting - ?meeting bf:label ?label - OPTIONAL { ?meeting bf:identifier ?id} - OPTIONAL { ?meeting bf:relatedTo ?relatedTo} - OPTIONAL { ?meeting bf:authorizedAccessPoint ?authorizedAccessPoint} - ?meeting bf:label %v FILTER(contains(%v, %s)) - ?meeting bf:label %v FILTER(contains(%v, %s)) + + ?thing a bf:Meeting + ?thing bf:label %v FILTER(contains(%v, %s)) - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?agent ?relatedTo ?authorizedAccessPoint
- ?agent a bf:Agent - ?agent bf:label ?label - OPTIONAL { ?agent bf:identifier ?id} - OPTIONAL { ?agent bf:relatedTo ?relatedTo} - OPTIONAL { ?agent bf:authorizedAccessPoint ?authorizedAccessPoint} - ?agent bf:label %v FILTER(contains(%v, %s)) - ?agent bf:label %v FILTER(contains(%v, %s)) + + ?thing a bf:Agent + ?thing bf:label %v FILTER(contains(%v, %s)) - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?event ?relatedTo ?authorizedAccessPoint
- ?event a bf:Event - ?event bf:label ?label - OPTIONAL { ?event bf:identifier ?id} - OPTIONAL { ?event bf:relatedTo ?relatedTo} - OPTIONAL { ?event bf:authorizedAccessPoint ?authorizedAccessPoint} - ?event bf:label %v FILTER(contains(%v, %s)) - ?event bf:label %v FILTER(contains(%v, %s)) + + ?thing a bf:Event + ?thing bf:label %v FILTER(contains(%v, %s)) - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?organization ?relatedTo ?authorizedAccessPoint
- ?organization a bf:Organization - ?organization bf:label ?label - OPTIONAL { ?organization bf:identifier ?id} - OPTIONAL { ?organization bf:relatedTo ?relatedTo} - OPTIONAL { ?organization bf:authorizedAccessPoint ?authorizedAccessPoint} - ?organization bf:label %v FILTER(contains(%v, %s)) - ?organization bf:label %v FILTER(contains(%v, %s)) + + ?thing a bf:Organization + ?thing bf:label %v FILTER(contains(%v, %s)) - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?label ?id ?topic ?relatedTo ?authorizedAccessPoint
- ?topic a bf:Topic - ?topic bf:label ?label - OPTIONAL { ?topic bf:identifier ?id} - OPTIONAL { ?topic bf:relatedTo ?relatedTo} - OPTIONAL { ?topic bf:authorizedAccessPoint ?authorizedAccessPoint} - ?topic bf:label %v FILTER(contains(%v, %s)) - ?topic bf:label %v FILTER(contains(%v, %s)) + + ?thing a bf:Topic + ?thing bf:label %v FILTER(contains(%v, %s)) - - - rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns - bf: http://bibframe.org/vocab/ -
SELECT DISTINCT ?title ?titleValue - ?formDesignation ?partNumber ?partTitle ?subtitle - ?titleAttribute ?titleQualifier ?titleSource - ?titleType ?titleVariationDate
- ?title a bf:Title - OPTIONAL { ?title bf:titleValue ?titleValue} - OPTIONAL { ?title bf:formDesignation ?formDesignation} - OPTIONAL { ?title bf:partNumber ?partNumber} - OPTIONAL { ?title bf:partTitle ?partTitle} - OPTIONAL { ?title bf:subtitle ?subtitle} - OPTIONAL { ?title bf:titleAttribute ?titleAttribute} - OPTIONAL { ?title bf:titleQualifier ?titleQualifier} - OPTIONAL { ?title bf:titleSource ?titleSource} - OPTIONAL { ?title bf:titleType ?titleType} - OPTIONAL { ?title bf:titleVariationDate ?titleVariationDate} - ?title bf:titleValue %v FILTER(contains(%v, %s)) - ?title bf:subtitle %v FILTER(contains(%v, %s)) - ?title bf:partTitle %v FILTER(contains(%v, %s)) - ?title ?rel %v FILTER(contains(str(%v), %s)) + + + ?thing a bf:Title + + { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION + { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION + { ?thing bf:partTitle %v FILTER(contains(%v, %s)) } + + + { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION + { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION + { ?thing bf:partTitle %v FILTER(contains(%v, %s)) } + + ?thing bf:titleValue %v FILTER(contains(%v, %s)) + ?thing bf:subtitle %v FILTER(contains(%v, %s)) + ?thing bf:partTitle %v FILTER(contains(%v, %s)) + + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns bf: http://bibframe.org/vocab/ @@ -262,6 +246,7 @@ ?node ?rel ?obj FILTER( str(?node) = %s ) + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns bf: http://bibframe.org/vocab/ -- 1.7.10.4