3 <!-- Entity definitions for commonly used idioms -->
4 <!-- TODO - Now it accepts these, but will not expand them in place! -->
5 <!-- Seems we can not use many special characters in these: <> % etc -->
6 <!ENTITY workfull "FOOBAR" >
10 MINUS { ?wobj a bf:Work }
11 MINUS { ?wobj a bf:Instance }
15 MINUS { ?wobj1 a bf:Work }
16 MINUS { ?wobj1 a bf:Instance }
20 MINUS { ?wobj2 a bf:Work }
21 MINUS { ?wobj2 a bf:Instance }
37 <filters xmlns="http://indexdata.com/metaproxy">
38 <filter type="sparql">
39 <!-- Which sparql server to use, our demo, or your local installation -->
40 <defaults uri="http://bibframe.indexdata.com/sparql/"/>
41 <!--defaults uri="http://localhost:8890/sparql/"/-->
43 <!-- Any search in work returns just a list of records.
44 Present will make another request for each record to get the level
45 of details we want, depending on the schema. -->
46 <db path="work" schema="sparql-results">
47 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
48 <prefix>bf: http://bibframe.org/vocab/</prefix>
49 <form>SELECT DISTINCT ?work </form>
50 <criteria>?work a bf:Work</criteria>
52 <!-- bf.uri is a simple way to get to a work -->
53 <index type="bf.uri"> ?work a bf:Work FILTER( ?work = %u ) </index>
55 <!-- Title indexes, directly via work.workTitle -->
56 <index type="bf.title">
57 ?work bf:workTitle ?wt .
58 ?wt bf:titleValue %v FILTER(contains(%v, %s))
61 <index type="bf.subtitle">?work bf:workTitle ?wt .
62 ?wt bf:subtitle %v FILTER(contains(%v, %s))
65 <index type="bf.parttitle">
66 ?work bf:workTitle ?wt .
67 ?wt bf:partTitle %v FILTER(contains(%v, %s))
70 <!-- work.titlevariation - this could also have sub- and partTitles -->
71 <index type="bf.titlevariation">
72 ?work bf:titleVariation ?tv .
73 ?tv bf:titleValue %v FILTER(contains(%v, %s))
76 <!-- Instance titles -->
77 <index type="bf.instancetitle">
78 ?inst bf:instanceOf ?work .
79 ?inst bf:instanceTitle ?it .
80 ?it bf:titleValue %v FILTER(contains(%v, %s))
83 <!-- Combined title index. There are so many ways titles can be expresses
84 in Bibframe, this seems to cover most of what we have seen -->
85 <index type="bf.anytitle">
86 { ?work bf:workTitle ?wt .
87 { ?wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION
88 { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION
89 { ?wt bf:partTitle %v FILTER(contains(%v, %s)) }
91 ?work bf:titleVariation ?tv .
92 ?tv bf:titleValue %v FILTER(contains(%v, %s))
94 ?inst bf:instanceOf ?work .
95 ?inst bf:instanceTitle ?it .
96 ?it bf:titleValue %v FILTER(contains(%v, %s))
100 <index type="bf.creator">?work bf:creator ?c .
101 ?c bf:label %v FILTER(contains(%v, %s))</index>
102 <index type="bf.subject">?work bf:subject ?subject .
103 ?subject bf:label %v FILTER(contains(%v, %s))
106 <present type="BF-L">
107 CONSTRUCT { ?work ?rel ?subj }
111 ?work ?rel ?obj FILTER( str(?work) = %s )
114 <present type="BF-F">
115 CONSTRUCT { ?work ?rel ?obj .
124 MINUS { ?obj a bf:Work }
128 MINUS { ?obj1 a bf:Work }
132 MINUS { ?obj2 a bf:Work }
134 ?work ?rel ?obj FILTER( str(?work) = %s )
137 <present type="BF-FI"> <!-- full, with instances. Experimental! -->
138 CONSTRUCT { %u ?rel ?wobj1 .
139 ?wobj1 ?wrel1 ?wobj2 .
140 ?wobj2 ?wrel2 ?wobj3 .
141 ?inst ?irel1 ?iobj1 .
142 ?iobj1 ?irel2 ?iobj2 .
143 ?iobj2 ?irel3 ?iobj3 }
147 OPTIONAL { <!-- note, this is not in the final construct
148 the linking triplet will get included like any others -->
149 ?inst bf:instanceOf %u
151 &workfull; <!-- This does not seem to get expanded!! -->
154 MINUS { ?wobj a bf:Work }
155 MINUS { ?wobj a bf:Instance }
159 MINUS { ?wobj1 a bf:Work }
160 MINUS { ?wobj1 a bf:Instance }
164 MINUS { ?wobj2 a bf:Work }
165 MINUS { ?wobj2 a bf:Instance }
181 <!-- Instance searches, need to be refined later. TODO -->
182 <db path="instance" schema="sparql-results">
183 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
184 <prefix>bf: http://bibframe.org/vocab/</prefix>
185 <form>SELECT ?instance ?title ?format</form>
186 <criteria>?instance a bf:Instance</criteria>
187 <criteria>?instance bf:title ?title</criteria>
188 <index type="4">?instance bf:title %v FILTER(contains(%v, %s))</index>
189 <criteria>?instance bf:format ?format</criteria>
190 <index type="1013">?instance bf:format %s</index>
193 <!-- Small databases -->
195 <!-- "small" contains all the things common to all small databases -->
196 <!-- It is only to be used as an include, it is not searchable, since -->
197 <!-- it has no schema atribute -->
198 <!-- It is divided into "smallindex", "smallbody", and a "small" that includes
199 both, so that title searches can include the body, but have different indexes -->
201 <db path="smallindex">
202 <index type="any">?thing bf:label %v FILTER(contains(%v, %s))</index>
203 <index type="1016">?thing bf:label %v FILTER(contains(%v, %s))</index>
206 <db path="smallbody">
207 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
208 <prefix>bf: http://bibframe.org/vocab/</prefix>
209 <form>SELECT DISTINCT ?thing </form>
210 <criteria>?thing ?rel ?obj</criteria>
211 <present type="BF-L">
212 CONSTRUCT { %u ?rel ?obj }
217 <!-- Experimental, to get just the URIs out, in proper rdf. Probably not useful
219 CONSTRUCT { %u bf:uri %u }
225 <present type="BF-F">
226 <!-- I don't think we need more than one level for these simple
228 CONSTRUCT { %u ?rel ?obj .
233 OPTIONAL { ?obj ?rel1 ?obj1 }
237 <db path="small" include="smallindex smallbody"/>
239 <db path="place" schema="sparql-results" include="small" >
240 <criteria>?thing a bf:Place</criteria>
241 <index type="bf.place">?thing bf:label %v FILTER(contains(%v, %s))</index>
243 <db path="person" schema="sparql-results" include="small" >
244 <criteria>?thing a bf:Person</criteria>
245 <index type="bf.person">?thing bf:label %v FILTER(contains(%v, %s))</index>
247 <db path="meeting" schema="sparql-results" include="small" >
248 <criteria>?thing a bf:Meeting</criteria>
249 <index type="bf.meeting">?thing bf:label %v FILTER(contains(%v, %s))</index>
251 <db path="agent" schema="sparql-results" include="small" >
252 <criteria>?thing a bf:Agent</criteria>
253 <index type="bf.agent">?thing bf:label %v FILTER(contains(%v, %s))</index>
255 <db path="event" schema="sparql-results" include="small" >
256 <criteria>?thing a bf:Event</criteria>
257 <index type="bf.event">?thing bf:label %v FILTER(contains(%v, %s))</index>
259 <db path="organization" schema="sparql-results" include="small" >
260 <criteria>?thing a bf:Organization</criteria>
261 <index type="bf.organization">?thing bf:label %v FILTER(contains(%v, %s))</index>
263 <db path="topic" schema="sparql-results" include="small" >
264 <criteria>?thing a bf:Topic</criteria>
265 <index type="bf.topic">?thing bf:label %v FILTER(contains(%v, %s))</index>
268 <!-- Title search, probably not needed. -->
269 <db path="title" schema="sparql-results" include="smallbody" >
270 <criteria>?thing a bf:Title</criteria>
272 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
273 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
274 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
277 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
278 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
279 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
281 <index type="bf.title">?thing bf:titleValue %v FILTER(contains(%v, %s))</index>
282 <index type="bf.subtitle">?thing bf:subtitle %v FILTER(contains(%v, %s))</index>
283 <index type="bf.parttitle">?thing bf:partTitle %v FILTER(contains(%v, %s))</index>
286 <!-- A hack to be able to look at any triplet in the base -->
287 <!-- TODO - Switch to the new system, probably using "small" -->
288 <db path="node" schema="sparql-results">
289 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
290 <prefix>bf: http://bibframe.org/vocab/</prefix>
291 <form>SELECT ?node ?rel ?obj</form>
292 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
294 <!-- A way to see which triplets refers to a given uri. -->
295 <!-- TODO - Switch to the new system, probably using "small" -->
296 <db path="ref" schema="sparql-results">
297 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
298 <prefix>bf: http://bibframe.org/vocab/</prefix>
299 <form>SELECT ?node ?rel ?obj</form>
300 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
304 <message>http</message>
305 <category apdu="true"/>
307 <filter type="http_client">
308 <x-forwarded-for>true</x-forwarded-for>