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 bf:titleVariation ?tv .
120 ?tv bf:titleValue %v FILTER(contains(%v, %s))
122 ?inst bf:instanceOf ?thing .
123 ?inst bf:instanceTitle ?it .
124 ?it bf:titleValue %v FILTER(contains(%v, %s))
126 ?thing bf:title %v FILTER(contains(%v, %s))
130 <!-- Author indexes. Much simpler than titles. -->
131 <index type="bf.creator">
132 ?thing bf:creator ?c .
133 ?c bf:label %v FILTER(contains(%v, %s))
136 <index type="bf.contributor">
137 ?thing bf:contributor ?c .
138 ?c bf:label %v FILTER(contains(%v, %s))
141 <index type="bf.anyauthor"> <!-- TODO - Is this a good name? -->
143 ?thing bf:creator ?c .
144 ?c bf:label %v FILTER(contains(%v, %s))
146 ?thing bf:contributor ?c .
147 ?c bf:label %v FILTER(contains(%v, %s))
152 <!-- Note that these refer to anything with a bf:subject relation -->
153 <!-- The actual item is likely to be something like topic person etc -->
154 <index type="bf.subject">
155 ?thing bf:subject ?subject .
156 ?subject bf:label %v FILTER(contains(%v, %s))
160 <!-- Present formats -->
161 <!-- BF-L comes from the "thing" template -->
162 <!-- BF-F expands all links, except to instances and other works -->
163 <present type="BF-F">
176 MINUS { ?obj a bf:Work }
177 MINUS { ?obj a bf:Instance }
181 MINUS { ?obj1 a bf:Work }
182 MINUS { ?obj1 a bf:Instance }
186 MINUS { ?obj2 a bf:Work }
187 MINUS { ?obj2 a bf:Instance }
189 ?thing ?rel ?obj FILTER( str(?thing) = %s )
190 <!-- TODO Use the %u -->
191 <!-- TODO Use the BF-FI as the BF-F -->
195 <!-- full, with instances. Experimental! -->
196 <present type="BF-FI">
199 ?wobj1 ?wrel1 ?wobj2 .
200 ?wobj2 ?wrel2 ?wobj3 .
201 ?inst ?irel1 ?iobj1 .
202 ?iobj1 ?irel2 ?iobj2 .
211 MINUS { ?wobj a bf:Work }
212 MINUS { ?wobj a bf:Instance }
216 MINUS { ?wobj1 a bf:Work }
217 MINUS { ?wobj1 a bf:Instance }
221 MINUS { ?wobj2 a bf:Work }
222 MINUS { ?wobj2 a bf:Instance }
225 <!-- Link to the instance(s) -->
227 ?inst bf:instanceOf %u
229 <!-- and expand the instance -->
243 <!-- Instance database -->
245 <db path="instance" schema="sparql-results" include="thing">
246 <criteria>?thing a bf:Instance</criteria>
248 <!-- Title indexes -->
249 <!-- These are messy, there are so many ways to get to a title -->
251 <!-- Main title. Looks logical. Many instances seem to have a title -->
252 <index type="bf.title">
253 ?thing bf:title %v FILTER(contains(%v, %s))
256 <!-- instancetitle is also pretty common -->
257 <index type="bf.instancetitle">
258 ?thing bf:instanceTitle ?it .
259 ?it bf:titleValue %v FILTER(contains(%v, %s))
262 <index type="bf.titlestatement">
263 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
266 <!-- Combining the two above, since users are not likely to know how
267 a given title has been indexed -->
268 <index type="bf.maintitle">
270 ?thing bf:instanceTitle ?it .
271 ?it bf:titleValue %v FILTER(contains(%v, %s))
273 ?thing bf:title %v FILTER(contains(%v, %s))
278 <!-- the instancetitle can also contain a subtitle and a parttitle -->
279 <index type="bf.subtitle">
280 ?thing bf:instanceTitle ?it .
281 ?it bf:subtitle %v FILTER(contains(%v, %s))
284 <index type="bf.parttitle">
285 ?thing bf:instanceTitle ?it .
286 ?it bf:partTitle %v FILTER(contains(%v, %s))
288 <!-- We could also go to the works, and get those titles... -->
290 <!-- Combining any kind of title into one index -->
291 <index type="bf.anytitle">
293 ?thing bf:title %v FILTER(contains(%v, %s))
295 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
297 ?thing ?titlerel ?it . <!-- any kind of link -->
298 ?it a bf:Title <!-- to something that is a title -->
300 ?it bf:titleValue %v FILTER(contains(%v, %s))
302 ?it bf:partTitle %v FILTER(contains(%v, %s))
304 ?it bf:subtitle %v FILTER(contains(%v, %s))
309 <!-- Author indexes. Many instances don't have any, works do -->
310 <index type="bf.creator">
311 ?thing bf:creator ?c .
312 ?c bf:label %v FILTER(contains(%v, %s))
315 <index type="bf.workcreator">
316 ?thing bf:instanceOf ?work .
317 ?work bf:creator ?c .
318 ?c bf:label %v FILTER(contains(%v, %s))
321 <index type="bf.workcontributor">
322 ?thing bf:instanceOf ?work .
323 ?work bf:contributor ?c .
324 ?c bf:label %v FILTER(contains(%v, %s))
327 <index type="bf.contributor">
328 ?thing bf:contributor ?c .
329 ?c bf:label %v FILTER(contains(%v, %s))
332 <index type="bf.anyauthor">
334 ?thing bf:creator ?c .
335 ?c bf:label %v FILTER(contains(%v, %s))
337 ?thing bf:contributor ?c .
338 ?c bf:label %v FILTER(contains(%v, %s))
340 ?thing bf:instanceOf ?work .
341 ?work bf:creator ?c .
342 ?c bf:label %v FILTER(contains(%v, %s))
344 ?thing bf:instanceOf ?work .
345 ?work bf:contributor ?c .
346 ?c bf:label %v FILTER(contains(%v, %s))
350 <!-- Presetn formats. BF-L comes from "thing" -->
351 <!-- Full instance, with the related work too -->
352 <present type="BF-F">
355 ?iobj1 ?irel2 ?iobj2 .
356 ?iobj2 ?irel3 ?iobj3 .
357 ?work ?wrel1 ?wobj1 .
358 ?wobj1 ?wrel2 ?wobj2 .
366 MINUS { ?iobj1 a bf:Work }
367 MINUS { ?iobj1 a bf:Instance }
370 MINUS { ?iobj2 a bf:Work }
371 MINUS { ?iobj2 a bf:Instance }
376 %u bf:instanceOf ?work
379 MINUS { ?wobj1 a bf:Work }
380 MINUS { ?wobj1 a bf:Instance }
383 MINUS { ?wobj2 a bf:Work }
384 MINUS { ?wobj2 a bf:Instance }
387 MINUS { ?wobj3 a bf:Work }
388 MINUS { ?wobj3 a bf:Instance }
398 <!-- Small databases -->
400 <!-- "small" contains all the things common to all small databases -->
401 <!-- It is only to be used as an include, it is not searchable, since -->
402 <!-- it has no schema atribute -->
403 <!-- It is divided into "smallbody", and a "small" that includes -->
404 <!-- the general indexes, so that title searches can include the body, -->
405 <!-- but have different "any" indexes -->
407 <db path="smallbody" include="thing">
408 <present type="BF-F">
409 <!-- I don't think we need more than one level -->
410 <!--for these simple databases -->
417 OPTIONAL { ?obj ?rel1 ?obj1 }
422 <!-- The combined "small" database defaults -->
423 <db path="small" include="smallbody">
425 ?thing bf:label %v FILTER(contains(%v, %s))
428 ?thing bf:label %v FILTER(contains(%v, %s))
432 <!-- Various "small" databases, leaning heavily on the defaults above -->
433 <db path="place" schema="sparql-results" include="small" >
434 <criteria>?thing a bf:Place</criteria>
435 <index type="bf.place">
436 ?thing bf:label %v FILTER(contains(%v, %s))
440 <db path="person" schema="sparql-results" include="small" >
441 <criteria>?thing a bf:Person</criteria>
442 <index type="bf.person">
443 ?thing bf:label %v FILTER(contains(%v, %s))
447 <db path="meeting" schema="sparql-results" include="small" >
448 <criteria>?thing a bf:Meeting</criteria>
449 <index type="bf.meeting">
450 ?thing bf:label %v FILTER(contains(%v, %s))
454 <db path="agent" schema="sparql-results" include="small" >
455 <criteria>?thing a bf:Agent</criteria>
456 <index type="bf.agent">
457 ?thing bf:label %v FILTER(contains(%v, %s))
461 <db path="event" schema="sparql-results" include="small" >
462 <criteria>?thing a bf:Event</criteria>
463 <index type="bf.event">
464 ?thing bf:label %v FILTER(contains(%v, %s))
468 <db path="organization" schema="sparql-results" include="small" >
469 <criteria>?thing a bf:Organization</criteria>
470 <index type="bf.organization">
471 ?thing bf:label %v FILTER(contains(%v, %s))
475 <db path="topic" schema="sparql-results" include="small" >
476 <criteria>?thing a bf:Topic</criteria>
477 <index type="bf.topic">
478 ?thing bf:label %v FILTER(contains(%v, %s))
482 <!-- Title search, for seatching Title objects. -->
483 <!-- Not sure if this is needed, but it is a nice example -->
484 <db path="title" schema="sparql-results" include="smallbody" >
485 <criteria>?thing a bf:Title</criteria>
489 ?thing bf:titleValue %v FILTER(contains(%v, %s))
491 ?thing bf:subtitle %v FILTER(contains(%v, %s))
493 ?thing bf:partTitle %v FILTER(contains(%v, %s))
499 ?thing bf:titleValue %v FILTER(contains(%v, %s))
501 ?thing bf:subtitle %v FILTER(contains(%v, %s))
503 ?thing bf:partTitle %v FILTER(contains(%v, %s))
507 <index type="bf.title">
508 ?thing bf:titleValue %v FILTER(contains(%v, %s))
511 <index type="bf.subtitle">
512 ?thing bf:subtitle %v FILTER(contains(%v, %s))
515 <index type="bf.parttitle">
516 ?thing bf:partTitle %v FILTER(contains(%v, %s))
520 <!-- A hack to be able to look at any triplet in the base -->
521 <!-- TODO - Switch to the new system, probably using "small" -->
522 <db path="node" schema="sparql-results">
523 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
524 <prefix>bf: http://bibframe.org/vocab/</prefix>
525 <form>SELECT ?node ?rel ?obj</form>
526 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
528 <!-- A way to see which triplets refers to a given uri. -->
529 <!-- TODO - Switch to the new system, probably using "small" -->
530 <db path="ref" schema="sparql-results">
531 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
532 <prefix>bf: http://bibframe.org/vocab/</prefix>
533 <form>SELECT ?node ?rel ?obj</form>
534 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
539 <message>http</message>
540 <category apdu="true"/>
543 <filter type="http_client">
544 <x-forwarded-for>true</x-forwarded-for>