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 <index type="bf.anytitle">
113 ?thing bf:title %v FILTER(contains(%v, %s))
114 } UNION { <!-- any kind of link -->
115 ?thing ?titlerel ?ti . <!-- mostly workTitle, but others too -->
116 ?ti a bf:Title <!-- to something that is a title -->
118 ?ti bf:titleValue %v FILTER(contains(%v, %s))
120 ?ti bf:partTitle %v FILTER(contains(%v, %s))
122 ?ti bf:subtitle %v FILTER(contains(%v, %s))
125 ?inst bf:instanceOf ?thing .
126 ?inst bf:instanceTitle ?it .
127 ?it bf:titleValue %v FILTER(contains(%v, %s))
132 <!-- Author indexes. Much simpler than titles. -->
133 <index type="bf.creator">
134 ?thing bf:creator ?c .
135 ?c bf:label %v FILTER(contains(%v, %s))
138 <index type="bf.contributor">
139 ?thing bf:contributor ?c .
140 ?c bf:label %v FILTER(contains(%v, %s))
143 <index type="bf.anyauthor"> <!-- TODO - Is this a good name? -->
145 ?thing bf:creator ?c .
146 ?c bf:label %v FILTER(contains(%v, %s))
148 ?thing bf:contributor ?c .
149 ?c bf:label %v FILTER(contains(%v, %s))
154 <!-- Note that these refer to anything with a bf:subject relation -->
155 <!-- The actual item is likely to be something like topic person etc -->
156 <index type="bf.subject">
157 ?thing bf:subject ?subject .
158 ?subject bf:label %v FILTER(contains(%v, %s))
162 <!-- Present formats -->
163 <!-- BF-L comes from the "thing" template -->
164 <!-- BF-F expands all links, even to instances but not other works -->
165 <present type="BF-F">
168 ?wobj1 ?wrel1 ?wobj2 .
169 ?wobj2 ?wrel2 ?wobj3 .
170 ?inst ?irel1 ?iobj1 .
171 ?iobj1 ?irel2 ?iobj2 .
180 MINUS { ?wobj1 a bf:Work }
181 MINUS { ?wobj1 a bf:Instance }
184 MINUS { ?wobj2 a bf:Work }
185 MINUS { ?wobj2 a bf:Instance }
188 <!-- Link to the instance(s) -->
190 ?inst bf:instanceOf %u .
194 MINUS { ?iobj1 a bf:Work }
195 MINUS { ?iobj1 a bf:Instance }
198 MINUS { ?iobj2 a bf:Work }
199 MINUS { ?iobj2 a bf:Instance }
207 <!-- Instance database -->
209 <db path="instance" schema="sparql-results" include="thing smallindex">
210 <criteria>?thing a bf:Instance</criteria>
212 <!-- Title indexes -->
213 <!-- These are messy, there are so many ways to get to a title -->
215 <!-- Main title. Looks logical. Many instances seem to have a title -->
216 <index type="bf.title">
217 ?thing bf:title %v FILTER(contains(%v, %s))
220 <!-- instancetitle is also pretty common -->
221 <index type="bf.instancetitle">
222 ?thing bf:instanceTitle ?it .
223 ?it bf:titleValue %v FILTER(contains(%v, %s))
226 <index type="bf.titlestatement">
227 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
230 <!-- Combining the two above, since users are not likely to know how
231 a given title has been indexed -->
232 <index type="bf.maintitle">
234 ?thing bf:instanceTitle ?it .
235 ?it bf:titleValue %v FILTER(contains(%v, %s))
237 ?thing bf:title %v FILTER(contains(%v, %s))
242 <!-- the instancetitle can also contain a subtitle and a parttitle -->
243 <index type="bf.subtitle">
244 ?thing bf:instanceTitle ?it .
245 ?it bf:subtitle %v FILTER(contains(%v, %s))
248 <index type="bf.parttitle">
249 ?thing bf:instanceTitle ?it .
250 ?it bf:partTitle %v FILTER(contains(%v, %s))
252 <!-- We could also go to the works, and get those titles... -->
254 <!-- Combining any kind of title into one index -->
255 <index type="bf.anytitle">
257 ?thing bf:title %v FILTER(contains(%v, %s))
259 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
261 ?thing ?titlerel ?it . <!-- any kind of link -->
262 ?it a bf:Title <!-- to something that is a title -->
264 ?it bf:titleValue %v FILTER(contains(%v, %s))
266 ?it bf:partTitle %v FILTER(contains(%v, %s))
268 ?it bf:subtitle %v FILTER(contains(%v, %s))
273 <!-- Author indexes. Many instances don't have any, works do -->
274 <index type="bf.creator">
275 ?thing bf:creator ?c .
276 ?c bf:label %v FILTER(contains(%v, %s))
279 <index type="bf.workcreator">
280 ?thing bf:instanceOf ?work .
281 ?work bf:creator ?c .
282 ?c bf:label %v FILTER(contains(%v, %s))
285 <index type="bf.workcontributor">
286 ?thing bf:instanceOf ?work .
287 ?work bf:contributor ?c .
288 ?c bf:label %v FILTER(contains(%v, %s))
291 <index type="bf.contributor">
292 ?thing bf:contributor ?c .
293 ?c bf:label %v FILTER(contains(%v, %s))
296 <index type="bf.anyauthor">
298 ?thing bf:creator ?c .
299 ?c bf:label %v FILTER(contains(%v, %s))
301 ?thing bf:contributor ?c .
302 ?c bf:label %v FILTER(contains(%v, %s))
304 ?thing bf:instanceOf ?work .
305 ?work bf:creator ?c .
306 ?c bf:label %v FILTER(contains(%v, %s))
308 ?thing bf:instanceOf ?work .
309 ?work bf:contributor ?c .
310 ?c bf:label %v FILTER(contains(%v, %s))
314 <!-- Present formats. BF-L comes from "thing" -->
315 <!-- Full instance, with the related work too -->
316 <present type="BF-F">
319 ?iobj1 ?irel2 ?iobj2 .
320 ?iobj2 ?irel3 ?iobj3 .
321 ?work ?wrel1 ?wobj1 .
322 ?wobj1 ?wrel2 ?wobj2 .
330 MINUS { ?iobj2 a bf:Work }
331 MINUS { ?iobj2 a bf:Instance }
334 MINUS { ?iobj3 a bf:Work }
335 MINUS { ?iobj3 a bf:Instance }
338 OPTIONAL { <!-- Work -->
339 %u bf:instanceOf ?work
343 MINUS { ?wobj1 a bf:Work }
344 MINUS { ?wobj1 a bf:Instance }
347 MINUS { ?wobj2 a bf:Work }
348 MINUS { ?wobj2 a bf:Instance }
357 <!-- Small databases -->
359 <!-- "small" contains all the things common to all small databases -->
360 <!-- It is only to be used as an include, it is not searchable, since -->
361 <!-- it has no schema atribute -->
362 <!-- It is divided into "smallbody", and a "small" that includes -->
363 <!-- the general indexes, so that title searches can include the body, -->
364 <!-- but have different "any" indexes -->
366 <db path="smallbody" include="thing">
367 <present type="BF-F">
368 <!-- I don't think we need more than one level -->
369 <!--for these simple databases -->
376 OPTIONAL { ?obj ?rel1 ?obj1 }
381 <!-- The combined "small" database defaults -->
382 <db path="small" include="smallbody">
384 ?thing bf:label %v FILTER(contains(%v, %s))
387 ?thing bf:label %v FILTER(contains(%v, %s))
391 <!-- Various "small" databases, leaning heavily on the defaults above -->
392 <db path="place" schema="sparql-results" include="small" >
393 <criteria>?thing a bf:Place</criteria>
394 <index type="bf.place">
395 ?thing bf:label %v FILTER(contains(%v, %s))
399 <db path="person" schema="sparql-results" include="small" >
400 <criteria>?thing a bf:Person</criteria>
401 <index type="bf.person">
402 ?thing bf:label %v FILTER(contains(%v, %s))
406 <db path="meeting" schema="sparql-results" include="small" >
407 <criteria>?thing a bf:Meeting</criteria>
408 <index type="bf.meeting">
409 ?thing bf:label %v FILTER(contains(%v, %s))
413 <db path="agent" schema="sparql-results" include="small" >
414 <criteria>?thing a bf:Agent</criteria>
415 <index type="bf.agent">
416 ?thing bf:label %v FILTER(contains(%v, %s))
420 <db path="event" schema="sparql-results" include="small" >
421 <criteria>?thing a bf:Event</criteria>
422 <index type="bf.event">
423 ?thing bf:label %v FILTER(contains(%v, %s))
427 <db path="organization" schema="sparql-results" include="small" >
428 <criteria>?thing a bf:Organization</criteria>
429 <index type="bf.organization">
430 ?thing bf:label %v FILTER(contains(%v, %s))
434 <db path="topic" schema="sparql-results" include="small" >
435 <criteria>?thing a bf:Topic</criteria>
436 <index type="bf.topic">
437 ?thing bf:label %v FILTER(contains(%v, %s))
441 <!-- Title search, for seatching Title objects. -->
442 <!-- Not sure if this is needed, but it is a nice example -->
443 <db path="title" schema="sparql-results" include="smallbody" >
444 <criteria>?thing a bf:Title</criteria>
448 ?thing bf:titleValue %v FILTER(contains(%v, %s))
450 ?thing bf:subtitle %v FILTER(contains(%v, %s))
452 ?thing bf:partTitle %v FILTER(contains(%v, %s))
458 ?thing bf:titleValue %v FILTER(contains(%v, %s))
460 ?thing bf:subtitle %v FILTER(contains(%v, %s))
462 ?thing bf:partTitle %v FILTER(contains(%v, %s))
466 <index type="bf.title">
467 ?thing bf:titleValue %v FILTER(contains(%v, %s))
470 <index type="bf.subtitle">
471 ?thing bf:subtitle %v FILTER(contains(%v, %s))
474 <index type="bf.parttitle">
475 ?thing bf:partTitle %v FILTER(contains(%v, %s))
479 <!-- A hack to be able to look at any triplet in the base -->
480 <!-- TODO - Switch to the new system, probably using "small" -->
481 <db path="node" schema="sparql-results">
482 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
483 <prefix>bf: http://bibframe.org/vocab/</prefix>
484 <form>SELECT ?node ?rel ?obj</form>
485 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
487 <!-- A way to see which triplets refers to a given uri. -->
488 <!-- TODO - Switch to the new system, probably using "small" -->
489 <db path="ref" schema="sparql-results">
490 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
491 <prefix>bf: http://bibframe.org/vocab/</prefix>
492 <form>SELECT ?node ?rel ?obj</form>
493 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
498 <message>http</message>
499 <category apdu="true"/>
502 <filter type="http_client">
503 <x-forwarded-for>true</x-forwarded-for>