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-V present format -->
36 <!-- "smallindex" db that will be included in work and instance -->
37 <!-- It provides the small indexes like bf.person, bf.place, etc -->
38 <db path="smallindex">
39 <!-- Indexes for persons, organizations, etc -->
40 <!-- The person (etc) may be in any relation to the thing, -->
41 <!-- subject, creator, etc, as long as there is a direct link -->
42 <index type="bf.person">
45 ?person bf:label %v FILTER(contains(%v, %s))
47 <!-- TODO - make many more like the person above -->
50 <!-- work database -->
52 <db path="work" schema="sparql-results" include="thing smallindex">
54 <!-- The search clause just finds ?things, present is done below -->
55 <criteria>?thing a bf:Work</criteria>
57 <!-- Title indexes -->
58 <!-- These are messy, there are so many ways to get to a title -->
60 <!-- Main title. Looks logical, but in practice we have not seen -->
61 <!-- many of these -->
62 <index type="bf.title">
63 ?thing bf:title %v FILTER(contains(%v, %s))
66 <!-- worktitle.titleValue seems to be the most common way to -->
67 <!-- store the title of a work -->
68 <index type="bf.worktitle">
69 ?thing bf:workTitle ?wt .
70 ?wt bf:titleValue %v FILTER(contains(%v, %s))
73 <!-- Combining the two above, since users are not likely -->
74 <!-- to know how a given title has been indexed -->
75 <!-- TODO is "maintitle" a good name for this? I made it up myself -->
76 <index type="bf.maintitle">
78 ?thing bf:workTitle ?wt .
79 ?wt bf:titleValue %v FILTER(contains(%v, %s))
81 ?thing bf:title %v FILTER(contains(%v, %s))
85 <!-- the worktitle can also contain a subtitle and a parttitle -->
86 <index type="bf.subtitle">?thing bf:workTitle ?wt .
87 ?wt bf:subtitle %v FILTER(contains(%v, %s))
90 <index type="bf.parttitle">
91 ?thing bf:workTitle ?wt .
92 ?wt bf:partTitle %v FILTER(contains(%v, %s))
95 <!-- work.titlevariation - this could also have sub- and partTitles -->
96 <index type="bf.titlevariation">
97 ?thing bf:titleVariation ?tv .
98 ?tv bf:titleValue %v FILTER(contains(%v, %s))
101 <!-- Instance titles -->
102 <index type="bf.instancetitle">
103 ?inst bf:instanceOf ?thing .
104 ?inst bf:instanceTitle ?it .
105 ?it bf:titleValue %v FILTER(contains(%v, %s))
108 <!-- Combined title index. There are so many ways titles can be expresses
109 in Bibframe, this seems to cover most of what we have seen -->
110 <index type="bf.anytitle">
112 ?thing bf:title %v FILTER(contains(%v, %s))
113 } UNION { <!-- any kind of link -->
114 ?thing ?titlerel ?ti . <!-- mostly workTitle, but others too -->
115 ?ti a bf:Title <!-- to something that is a title -->
117 ?ti bf:titleValue %v FILTER(contains(%v, %s))
119 ?ti bf:partTitle %v FILTER(contains(%v, %s))
121 ?ti bf:subtitle %v FILTER(contains(%v, %s))
124 ?inst bf:instanceOf ?thing .
125 ?inst bf:instanceTitle ?it .
126 ?it bf:titleValue %v FILTER(contains(%v, %s))
131 <!-- Author indexes. Much simpler than titles. -->
132 <index type="bf.creator">
133 ?thing bf:creator ?c .
134 ?c bf:label %v FILTER(contains(%v, %s))
137 <index type="bf.contributor">
138 ?thing bf:contributor ?c .
139 ?c bf:label %v FILTER(contains(%v, %s))
142 <index type="bf.anyauthor"> <!-- TODO - Is this a good name? -->
144 ?thing bf:creator ?c .
145 ?c bf:label %v FILTER(contains(%v, %s))
147 ?thing bf:contributor ?c .
148 ?c bf:label %v FILTER(contains(%v, %s))
153 <!-- Note that these refer to anything with a bf:subject relation -->
154 <!-- The actual item is likely to be something like topic person etc -->
155 <index type="bf.subject">
156 ?thing bf:subject ?subject .
157 ?subject bf:label %v FILTER(contains(%v, %s))
161 <!-- Present formats -->
162 <!-- BF-L comes from the "thing" template -->
163 <!-- BF-V expands all links, even to instances but not other works -->
164 <present type="BF-V">
167 ?wobj1 ?wrel1 ?wobj2 .
168 ?wobj2 ?wrel2 ?wobj3 .
169 ?inst ?irel1 ?iobj1 .
170 ?iobj1 ?irel2 ?iobj2 .
179 MINUS { ?wobj1 a bf:Work }
180 MINUS { ?wobj1 a bf:Instance }
183 MINUS { ?wobj2 a bf:Work }
184 MINUS { ?wobj2 a bf:Instance }
187 <!-- Link to the instance(s) -->
189 ?inst bf:instanceOf %u .
193 MINUS { ?iobj1 a bf:Work }
194 MINUS { ?iobj1 a bf:Instance }
197 MINUS { ?iobj2 a bf:Work }
198 MINUS { ?iobj2 a bf:Instance }
206 <!-- Instance database -->
208 <db path="instance" schema="sparql-results" include="thing smallindex">
209 <criteria>?thing a bf:Instance</criteria>
211 <!-- Title indexes -->
212 <!-- These are messy, there are so many ways to get to a title -->
214 <!-- Main title. Looks logical. Many instances seem to have a title -->
215 <index type="bf.title">
216 ?thing bf:title %v FILTER(contains(%v, %s))
219 <!-- instancetitle is also pretty common -->
220 <index type="bf.instancetitle">
221 ?thing bf:instanceTitle ?it .
222 ?it bf:titleValue %v FILTER(contains(%v, %s))
225 <index type="bf.titlestatement">
226 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
229 <!-- Combining the two above, since users are not likely to know how
230 a given title has been indexed -->
231 <index type="bf.maintitle">
233 ?thing bf:instanceTitle ?it .
234 ?it bf:titleValue %v FILTER(contains(%v, %s))
236 ?thing bf:title %v FILTER(contains(%v, %s))
241 <!-- the instancetitle can also contain a subtitle and a parttitle -->
242 <index type="bf.subtitle">
243 ?thing bf:instanceTitle ?it .
244 ?it bf:subtitle %v FILTER(contains(%v, %s))
247 <index type="bf.parttitle">
248 ?thing bf:instanceTitle ?it .
249 ?it bf:partTitle %v FILTER(contains(%v, %s))
251 <!-- We could also go to the works, and get those titles... -->
253 <!-- Combining any kind of title into one index -->
254 <index type="bf.anytitle">
256 ?thing bf:title %v FILTER(contains(%v, %s))
258 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
260 ?thing ?titlerel ?it . <!-- any kind of link -->
261 ?it a bf:Title <!-- to something that is a title -->
263 ?it bf:titleValue %v FILTER(contains(%v, %s))
265 ?it bf:partTitle %v FILTER(contains(%v, %s))
267 ?it bf:subtitle %v FILTER(contains(%v, %s))
272 <!-- Author indexes. Many instances don't have any, works do -->
273 <index type="bf.creator">
274 ?thing bf:creator ?c .
275 ?c bf:label %v FILTER(contains(%v, %s))
278 <index type="bf.workcreator">
279 ?thing bf:instanceOf ?work .
280 ?work bf:creator ?c .
281 ?c bf:label %v FILTER(contains(%v, %s))
284 <index type="bf.workcontributor">
285 ?thing bf:instanceOf ?work .
286 ?work bf:contributor ?c .
287 ?c bf:label %v FILTER(contains(%v, %s))
290 <index type="bf.contributor">
291 ?thing bf:contributor ?c .
292 ?c bf:label %v FILTER(contains(%v, %s))
295 <index type="bf.anyauthor">
297 ?thing bf:creator ?c .
298 ?c bf:label %v FILTER(contains(%v, %s))
300 ?thing bf:contributor ?c .
301 ?c bf:label %v FILTER(contains(%v, %s))
303 ?thing bf:instanceOf ?work .
304 ?work bf:creator ?c .
305 ?c bf:label %v FILTER(contains(%v, %s))
307 ?thing bf:instanceOf ?work .
308 ?work bf:contributor ?c .
309 ?c bf:label %v FILTER(contains(%v, %s))
313 <!-- Present formats. BF-L comes from "thing" -->
314 <!-- Full instance, with the related work too -->
315 <present type="BF-V">
318 ?iobj1 ?irel2 ?iobj2 .
319 ?iobj2 ?irel3 ?iobj3 .
320 ?work ?wrel1 ?wobj1 .
321 ?wobj1 ?wrel2 ?wobj2 .
329 MINUS { ?iobj2 a bf:Work }
330 MINUS { ?iobj2 a bf:Instance } .
333 MINUS { ?iobj3 a bf:Work }
334 MINUS { ?iobj3 a bf:Instance }
337 OPTIONAL { <!-- Work -->
338 %u bf:instanceOf ?work .
339 ?work ?wrel1 ?wobj1 .
342 MINUS { ?wobj1 a bf:Work }
343 MINUS { ?wobj1 a bf:Instance } .
346 MINUS { ?wobj2 a bf:Work }
347 MINUS { ?wobj2 a bf:Instance }
356 <!-- Small databases -->
358 <!-- "small" contains all the things common to all small databases -->
359 <!-- It is only to be used as an include, it is not searchable, since -->
360 <!-- it has no schema atribute -->
361 <!-- It is divided into "smallbody", and a "small" that includes -->
362 <!-- the general indexes, so that title searches can include the body, -->
363 <!-- but have different "any" indexes -->
365 <db path="smallbody" include="thing">
366 <present type="BF-V">
367 <!-- I don't think we need more than one level -->
368 <!--for these simple databases -->
375 OPTIONAL { ?obj ?rel1 ?obj1 }
380 <!-- The combined "small" database defaults -->
381 <db path="small" include="smallbody">
383 ?thing bf:label %v FILTER(contains(%v, %s))
386 ?thing bf:label %v FILTER(contains(%v, %s))
390 <!-- Various "small" databases, leaning heavily on the defaults above -->
391 <db path="place" schema="sparql-results" include="small" >
392 <criteria>?thing a bf:Place</criteria>
393 <index type="bf.place">
394 ?thing bf:label %v FILTER(contains(%v, %s))
398 <db path="person" schema="sparql-results" include="small" >
399 <criteria>?thing a bf:Person</criteria>
400 <index type="bf.person">
401 ?thing bf:label %v FILTER(contains(%v, %s))
405 <db path="meeting" schema="sparql-results" include="small" >
406 <criteria>?thing a bf:Meeting</criteria>
407 <index type="bf.meeting">
408 ?thing bf:label %v FILTER(contains(%v, %s))
412 <db path="agent" schema="sparql-results" include="small" >
413 <criteria>?thing a bf:Agent</criteria>
414 <index type="bf.agent">
415 ?thing bf:label %v FILTER(contains(%v, %s))
419 <db path="event" schema="sparql-results" include="small" >
420 <criteria>?thing a bf:Event</criteria>
421 <index type="bf.event">
422 ?thing bf:label %v FILTER(contains(%v, %s))
426 <db path="organization" schema="sparql-results" include="small" >
427 <criteria>?thing a bf:Organization</criteria>
428 <index type="bf.organization">
429 ?thing bf:label %v FILTER(contains(%v, %s))
433 <db path="topic" schema="sparql-results" include="small" >
434 <criteria>?thing a bf:Topic</criteria>
435 <index type="bf.topic">
436 ?thing bf:label %v FILTER(contains(%v, %s))
440 <!-- Title search, for seatching Title objects. -->
441 <!-- Not sure if this is needed, but it is a nice example -->
442 <db path="title" schema="sparql-results" include="smallbody" >
443 <criteria>?thing a bf:Title</criteria>
447 ?thing bf:titleValue %v FILTER(contains(%v, %s))
449 ?thing bf:subtitle %v FILTER(contains(%v, %s))
451 ?thing bf:partTitle %v FILTER(contains(%v, %s))
457 ?thing bf:titleValue %v FILTER(contains(%v, %s))
459 ?thing bf:subtitle %v FILTER(contains(%v, %s))
461 ?thing bf:partTitle %v FILTER(contains(%v, %s))
465 <index type="bf.title">
466 ?thing bf:titleValue %v FILTER(contains(%v, %s))
469 <index type="bf.subtitle">
470 ?thing bf:subtitle %v FILTER(contains(%v, %s))
473 <index type="bf.parttitle">
474 ?thing bf:partTitle %v FILTER(contains(%v, %s))
478 <!-- A hack to be able to look at any triplet in the base -->
479 <!-- TODO - Switch to the new system, probably using "small" -->
480 <db path="node" schema="sparql-results">
481 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
482 <prefix>bf: http://bibframe.org/vocab/</prefix>
483 <form>SELECT ?node ?rel ?obj</form>
484 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
486 <!-- A way to see which triplets refers to a given uri. -->
487 <!-- TODO - Switch to the new system, probably using "small" -->
488 <db path="ref" schema="sparql-results">
489 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
490 <prefix>bf: http://bibframe.org/vocab/</prefix>
491 <form>SELECT ?node ?rel ?obj</form>
492 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
497 <message>http</message>
498 <category apdu="true"/>
501 <filter type="http_client">
502 <x-forwarded-for>true</x-forwarded-for>