3 <filters xmlns="http://indexdata.com/metaproxy">
6 <!-- Which sparql server to use, our demo, or your local installation -->
7 <!--defaults uri="http://bibframe.indexdata.com/sparql/"/-->
8 <defaults uri="http://localhost:8890/sparql/"/>
10 <!-- "thing" database that will be included all real databases -->
11 <db path="thing"> <!-- no schema, so it is not directly searchable -->
12 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
13 <prefix>bf: http://bibframe.org/vocab/</prefix>
14 <form>SELECT DISTINCT ?thing </form>
16 <!-- Common indexes -->
18 <!-- bf.uri is a simple way to get to a thing -->
20 ?thing rdf:type ?any FILTER( ?thing = %u ) </index>
23 <!-- The BF-L present format is the same for everything -->
24 <!-- Each db is supposed to provide a dedicated BF-F present format -->
31 ?thing ?rel ?subj FILTER( str(?thing) = %s )
37 <!-- "smallindex" db that will be included in work and instance -->
38 <!-- It provides the small indexes like bf.person, bf.place, etc -->
39 <db path="smallindex">
40 <!-- Indexes for persons, organizations, etc -->
41 <!-- The person (etc) may be in any relation to the thing, -->
42 <!-- subject, creator, etc, as long as there is a direct link -->
43 <index type="bf.person">
46 ?person bf:label %v FILTER(contains(%v, %s))
48 <!-- TODO - make many more like the person above -->
51 <!-- work database -->
53 <db path="work" schema="sparql-results" include="thing smallindex">
55 <!-- The search clause just finds ?things, present is done below -->
56 <criteria>?thing a bf:Work</criteria>
58 <!-- Title indexes -->
59 <!-- These are messy, there are so many ways to get to a title -->
61 <!-- Main title. Looks logical, but in practice we have not seen -->
62 <!-- many of these -->
63 <index type="bf.title">
64 ?thing bf:title %v FILTER(contains(%v, %s))
67 <!-- worktitle.titleValue seems to be the most common way to -->
68 <!-- store the title of a work -->
69 <index type="bf.worktitle">
70 ?thing bf:workTitle ?wt .
71 ?wt bf:titleValue %v FILTER(contains(%v, %s))
74 <!-- Combining the two above, since users are not likely -->
75 <!-- to know how a given title has been indexed -->
76 <!-- TODO is "maintitle" a good name for this? I made it up myself -->
77 <index type="bf.maintitle">
79 ?thing bf:workTitle ?wt .
80 ?wt bf:titleValue %v FILTER(contains(%v, %s))
82 ?thing bf:title %v FILTER(contains(%v, %s))
86 <!-- the worktitle can also contain a subtitle and a parttitle -->
87 <index type="bf.subtitle">?thing bf:workTitle ?wt .
88 ?wt bf:subtitle %v FILTER(contains(%v, %s))
91 <index type="bf.parttitle">
92 ?thing bf:workTitle ?wt .
93 ?wt bf:partTitle %v FILTER(contains(%v, %s))
96 <!-- work.titlevariation - this could also have sub- and partTitles -->
97 <index type="bf.titlevariation">
98 ?thing bf:titleVariation ?tv .
99 ?tv bf:titleValue %v FILTER(contains(%v, %s))
102 <!-- Instance titles -->
103 <index type="bf.instancetitle">
104 ?inst bf:instanceOf ?thing .
105 ?inst bf:instanceTitle ?it .
106 ?it bf:titleValue %v FILTER(contains(%v, %s))
109 <!-- Combined title index. There are so many ways titles can be expresses
110 in Bibframe, this seems to cover most of what we have seen -->
111 <!-- TODO - See the anytitle in instance for a more flexible way -->
112 <index type="bf.anytitle">
114 ?thing bf:workTitle ?wt .
115 { ?wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION
116 { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION
117 { ?wt bf:partTitle %v FILTER(contains(%v, %s)) }
119 ?thing ?titlerel ?ti . <!-- any kind of link -->
120 ?ti a bf:Title <!-- to something that is a title -->
122 ?ti bf:titleValue %v FILTER(contains(%v, %s))
124 ?ti bf:partTitle %v FILTER(contains(%v, %s))
126 ?ti bf:subtitle %v FILTER(contains(%v, %s))
129 ?inst bf:instanceOf ?thing .
130 ?inst bf:instanceTitle ?it .
131 ?it bf:titleValue %v FILTER(contains(%v, %s))
133 ?thing bf:title %v FILTER(contains(%v, %s))
137 <!-- Author indexes. Much simpler than titles. -->
138 <index type="bf.creator">
139 ?thing bf:creator ?c .
140 ?c bf:label %v FILTER(contains(%v, %s))
143 <index type="bf.contributor">
144 ?thing bf:contributor ?c .
145 ?c bf:label %v FILTER(contains(%v, %s))
148 <index type="bf.anyauthor"> <!-- TODO - Is this a good name? -->
150 ?thing bf:creator ?c .
151 ?c bf:label %v FILTER(contains(%v, %s))
153 ?thing bf:contributor ?c .
154 ?c bf:label %v FILTER(contains(%v, %s))
159 <!-- Note that these refer to anything with a bf:subject relation -->
160 <!-- The actual item is likely to be something like topic person etc -->
161 <index type="bf.subject">
162 ?thing bf:subject ?subject .
163 ?subject bf:label %v FILTER(contains(%v, %s))
167 <!-- Present formats -->
168 <!-- BF-L comes from the "thing" template -->
169 <!-- BF-F expands all links, even to instances but not other works -->
170 <present type="BF-F">
173 ?wobj1 ?wrel1 ?wobj2 .
174 ?wobj2 ?wrel2 ?wobj3 .
175 ?inst ?irel1 ?iobj1 .
176 ?iobj1 ?irel2 ?iobj2 .
185 MINUS { ?wobj a bf:Work }
186 MINUS { ?wobj a bf:Instance }
189 MINUS { ?wobj1 a bf:Work }
190 MINUS { ?wobj1 a bf:Instance }
193 MINUS { ?wobj2 a bf:Work }
194 MINUS { ?wobj2 a bf:Instance }
198 <!-- Link to the instance(s) -->
200 ?inst bf:instanceOf %u
201 OPTIONAL { <!-- and expand the instance -->
215 <!-- Instance database -->
217 <db path="instance" schema="sparql-results" include="thing smallindex">
218 <criteria>?thing a bf:Instance</criteria>
220 <!-- Title indexes -->
221 <!-- These are messy, there are so many ways to get to a title -->
223 <!-- Main title. Looks logical. Many instances seem to have a title -->
224 <index type="bf.title">
225 ?thing bf:title %v FILTER(contains(%v, %s))
228 <!-- instancetitle is also pretty common -->
229 <index type="bf.instancetitle">
230 ?thing bf:instanceTitle ?it .
231 ?it bf:titleValue %v FILTER(contains(%v, %s))
234 <index type="bf.titlestatement">
235 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
238 <!-- Combining the two above, since users are not likely to know how
239 a given title has been indexed -->
240 <index type="bf.maintitle">
242 ?thing bf:instanceTitle ?it .
243 ?it bf:titleValue %v FILTER(contains(%v, %s))
245 ?thing bf:title %v FILTER(contains(%v, %s))
250 <!-- the instancetitle can also contain a subtitle and a parttitle -->
251 <index type="bf.subtitle">
252 ?thing bf:instanceTitle ?it .
253 ?it bf:subtitle %v FILTER(contains(%v, %s))
256 <index type="bf.parttitle">
257 ?thing bf:instanceTitle ?it .
258 ?it bf:partTitle %v FILTER(contains(%v, %s))
260 <!-- We could also go to the works, and get those titles... -->
262 <!-- Combining any kind of title into one index -->
263 <index type="bf.anytitle">
265 ?thing bf:title %v FILTER(contains(%v, %s))
267 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
269 ?thing ?titlerel ?it . <!-- any kind of link -->
270 ?it a bf:Title <!-- to something that is a title -->
272 ?it bf:titleValue %v FILTER(contains(%v, %s))
274 ?it bf:partTitle %v FILTER(contains(%v, %s))
276 ?it bf:subtitle %v FILTER(contains(%v, %s))
281 <!-- Author indexes. Many instances don't have any, works do -->
282 <index type="bf.creator">
283 ?thing bf:creator ?c .
284 ?c bf:label %v FILTER(contains(%v, %s))
287 <index type="bf.workcreator">
288 ?thing bf:instanceOf ?work .
289 ?work bf:creator ?c .
290 ?c bf:label %v FILTER(contains(%v, %s))
293 <index type="bf.workcontributor">
294 ?thing bf:instanceOf ?work .
295 ?work bf:contributor ?c .
296 ?c bf:label %v FILTER(contains(%v, %s))
299 <index type="bf.contributor">
300 ?thing bf:contributor ?c .
301 ?c bf:label %v FILTER(contains(%v, %s))
304 <index type="bf.anyauthor">
306 ?thing bf:creator ?c .
307 ?c bf:label %v FILTER(contains(%v, %s))
309 ?thing bf:contributor ?c .
310 ?c bf:label %v FILTER(contains(%v, %s))
312 ?thing bf:instanceOf ?work .
313 ?work bf:creator ?c .
314 ?c bf:label %v FILTER(contains(%v, %s))
316 ?thing bf:instanceOf ?work .
317 ?work bf:contributor ?c .
318 ?c bf:label %v FILTER(contains(%v, %s))
322 <!-- Presetn formats. BF-L comes from "thing" -->
323 <!-- Full instance, with the related work too -->
324 <present type="BF-F">
327 ?iobj1 ?irel2 ?iobj2 .
328 ?iobj2 ?irel3 ?iobj3 .
329 ?work ?wrel1 ?wobj1 .
330 ?wobj1 ?wrel2 ?wobj2 .
338 MINUS { ?iobj1 a bf:Work }
339 MINUS { ?iobj1 a bf:Instance }
342 MINUS { ?iobj2 a bf:Work }
343 MINUS { ?iobj2 a bf:Instance }
348 %u bf:instanceOf ?work
351 MINUS { ?wobj1 a bf:Work }
352 MINUS { ?wobj1 a bf:Instance }
355 MINUS { ?wobj2 a bf:Work }
356 MINUS { ?wobj2 a bf:Instance }
359 MINUS { ?wobj3 a bf:Work }
360 MINUS { ?wobj3 a bf:Instance }
370 <!-- Small databases -->
372 <!-- "small" contains all the things common to all small databases -->
373 <!-- It is only to be used as an include, it is not searchable, since -->
374 <!-- it has no schema atribute -->
375 <!-- It is divided into "smallbody", and a "small" that includes -->
376 <!-- the general indexes, so that title searches can include the body, -->
377 <!-- but have different "any" indexes -->
379 <db path="smallbody" include="thing">
380 <present type="BF-F">
381 <!-- I don't think we need more than one level -->
382 <!--for these simple databases -->
389 OPTIONAL { ?obj ?rel1 ?obj1 }
394 <!-- The combined "small" database defaults -->
395 <db path="small" include="smallbody">
397 ?thing bf:label %v FILTER(contains(%v, %s))
400 ?thing bf:label %v FILTER(contains(%v, %s))
404 <!-- Various "small" databases, leaning heavily on the defaults above -->
405 <db path="place" schema="sparql-results" include="small" >
406 <criteria>?thing a bf:Place</criteria>
407 <index type="bf.place">
408 ?thing bf:label %v FILTER(contains(%v, %s))
412 <db path="person" schema="sparql-results" include="small" >
413 <criteria>?thing a bf:Person</criteria>
414 <index type="bf.person">
415 ?thing bf:label %v FILTER(contains(%v, %s))
419 <db path="meeting" schema="sparql-results" include="small" >
420 <criteria>?thing a bf:Meeting</criteria>
421 <index type="bf.meeting">
422 ?thing bf:label %v FILTER(contains(%v, %s))
426 <db path="agent" schema="sparql-results" include="small" >
427 <criteria>?thing a bf:Agent</criteria>
428 <index type="bf.agent">
429 ?thing bf:label %v FILTER(contains(%v, %s))
433 <db path="event" schema="sparql-results" include="small" >
434 <criteria>?thing a bf:Event</criteria>
435 <index type="bf.event">
436 ?thing bf:label %v FILTER(contains(%v, %s))
440 <db path="organization" schema="sparql-results" include="small" >
441 <criteria>?thing a bf:Organization</criteria>
442 <index type="bf.organization">
443 ?thing bf:label %v FILTER(contains(%v, %s))
447 <db path="topic" schema="sparql-results" include="small" >
448 <criteria>?thing a bf:Topic</criteria>
449 <index type="bf.topic">
450 ?thing bf:label %v FILTER(contains(%v, %s))
454 <!-- Title search, for seatching Title objects. -->
455 <!-- Not sure if this is needed, but it is a nice example -->
456 <db path="title" schema="sparql-results" include="smallbody" >
457 <criteria>?thing a bf:Title</criteria>
461 ?thing bf:titleValue %v FILTER(contains(%v, %s))
463 ?thing bf:subtitle %v FILTER(contains(%v, %s))
465 ?thing bf:partTitle %v FILTER(contains(%v, %s))
471 ?thing bf:titleValue %v FILTER(contains(%v, %s))
473 ?thing bf:subtitle %v FILTER(contains(%v, %s))
475 ?thing bf:partTitle %v FILTER(contains(%v, %s))
479 <index type="bf.title">
480 ?thing bf:titleValue %v FILTER(contains(%v, %s))
483 <index type="bf.subtitle">
484 ?thing bf:subtitle %v FILTER(contains(%v, %s))
487 <index type="bf.parttitle">
488 ?thing bf:partTitle %v FILTER(contains(%v, %s))
492 <!-- A hack to be able to look at any triplet in the base -->
493 <!-- TODO - Switch to the new system, probably using "small" -->
494 <db path="node" schema="sparql-results">
495 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
496 <prefix>bf: http://bibframe.org/vocab/</prefix>
497 <form>SELECT ?node ?rel ?obj</form>
498 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
500 <!-- A way to see which triplets refers to a given uri. -->
501 <!-- TODO - Switch to the new system, probably using "small" -->
502 <db path="ref" schema="sparql-results">
503 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
504 <prefix>bf: http://bibframe.org/vocab/</prefix>
505 <form>SELECT ?node ?rel ?obj</form>
506 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
511 <message>http</message>
512 <category apdu="true"/>
515 <filter type="http_client">
516 <x-forwarded-for>true</x-forwarded-for>