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 )
23 <!-- bf.type is a simple way to search for types -->
24 <!-- for example, a bf.Work can also be bf:Text or bf:Audio -->
25 <index type="bf.type">
29 <!-- The BF-L present format is the same for everything -->
30 <!-- Each db is supposed to provide a dedicated BF-V present format -->
42 <!-- "smallindex" db that will be included in work and instance -->
43 <!-- It provides the small indexes like bf.person, bf.place, etc -->
44 <db path="smallindex">
45 <!-- Indexes for persons, organizations, etc -->
46 <!-- The person (etc) may be in any relation to the thing, -->
47 <!-- subject, creator, etc, as long as there is a direct link -->
48 <index type="bf.person">
51 ?person bf:label %v FILTER(contains(%v, %s))
53 <!-- TODO - make many more like the person above -->
56 <!-- work database -->
58 <db path="work" schema="sparql-results" include="thing smallindex">
60 <!-- The search clause just finds ?things, present is done below -->
61 <criteria>?thing a bf:Work</criteria>
63 <!-- Title indexes -->
64 <!-- These are messy, there are so many ways to get to a title -->
66 <!-- Main title. Looks logical, but in practice we have not seen -->
67 <!-- many of these -->
68 <index type="bf.title">
69 ?thing bf:title %v FILTER(contains(%v, %s))
72 <!-- worktitle.titleValue seems to be the most common way to -->
73 <!-- store the title of a work -->
74 <index type="bf.worktitle">
75 ?thing bf:workTitle ?wt .
76 ?wt bf:titleValue %v FILTER(contains(%v, %s))
79 <!-- Combining the two above, since users are not likely -->
80 <!-- to know how a given title has been indexed -->
81 <!-- TODO is "maintitle" a good name for this? I made it up myself -->
82 <index type="bf.maintitle">
84 ?thing bf:workTitle ?wt .
85 ?wt bf:titleValue %v FILTER(contains(%v, %s))
87 ?thing bf:title %v FILTER(contains(%v, %s))
91 <!-- the worktitle can also contain a subtitle and a parttitle -->
92 <index type="bf.subtitle">?thing bf:workTitle ?wt .
93 ?wt bf:subtitle %v FILTER(contains(%v, %s))
96 <index type="bf.parttitle">
97 ?thing bf:workTitle ?wt .
98 ?wt bf:partTitle %v FILTER(contains(%v, %s))
101 <!-- work.titlevariation - this could also have sub- and partTitles -->
102 <index type="bf.titlevariation">
103 ?thing bf:titleVariation ?tv .
104 ?tv bf:titleValue %v FILTER(contains(%v, %s))
107 <!-- Instance titles -->
108 <index type="bf.instancetitle">
109 ?inst bf:instanceOf ?thing .
110 ?inst bf:instanceTitle ?it .
111 ?it bf:titleValue %v FILTER(contains(%v, %s))
114 <!-- Combined title index. There are so many ways titles can be expresses
115 in Bibframe, this seems to cover most of what we have seen -->
116 <index type="bf.anytitle">
118 ?thing bf:title %v FILTER(contains(%v, %s))
119 } UNION { <!-- any kind of link -->
120 ?thing ?titlerel ?ti . <!-- mostly workTitle, but others too -->
121 ?ti a bf:Title <!-- to something that is a title -->
123 ?ti bf:titleValue %v FILTER(contains(%v, %s))
125 ?ti bf:partTitle %v FILTER(contains(%v, %s))
127 ?ti bf:subtitle %v FILTER(contains(%v, %s))
130 ?inst bf:instanceOf ?thing .
131 ?inst bf:instanceTitle ?it .
132 ?it bf:titleValue %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))
166 <!-- contentCategory can be searched with complete URIs like -->
167 <!-- http://id.loc.gov/vocabulary/contentTypes/txt -->
168 <index type="bf.contentcategory">
169 ?thing bf:contentCategory %u
172 <!-- Present formats -->
173 <!-- BF-L comes from the "thing" template -->
174 <!-- BF-V expands all links, even to instances but not other works -->
175 <present type="BF-V">
178 ?wobj1 ?wrel2 ?wobj2 .
179 ?wobj2 ?wrel3 ?wobj3 .
180 ?inst ?irel1 ?iobj1 .
181 ?iobj1 ?irel2 ?iobj2 .
190 MINUS { ?wobj1 a bf:Work }
191 MINUS { ?wobj1 a bf:Instance }
194 MINUS { ?wobj2 a bf:Work }
195 MINUS { ?wobj2 a bf:Instance }
198 <!-- Link to the instance(s) -->
200 ?inst bf:instanceOf %u .
204 MINUS { ?iobj1 a bf:Work }
205 MINUS { ?iobj1 a bf:Instance }
208 MINUS { ?iobj2 a bf:Work }
209 MINUS { ?iobj2 a bf:Instance }
217 <!-- Instance database -->
219 <db path="instance" schema="sparql-results" include="thing smallindex">
220 <criteria>?thing a bf:Instance</criteria>
222 <!-- Title indexes -->
223 <!-- These are messy, there are so many ways to get to a title -->
225 <!-- Main title. Looks logical. Many instances seem to have a title -->
226 <index type="bf.title">
227 ?thing bf:title %v FILTER(contains(%v, %s))
230 <!-- instancetitle is also pretty common -->
231 <index type="bf.instancetitle">
232 ?thing bf:instanceTitle ?it .
233 ?it bf:titleValue %v FILTER(contains(%v, %s))
236 <index type="bf.titlestatement">
237 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
240 <!-- Combining the two above, since users are not likely to know how
241 a given title has been indexed -->
242 <index type="bf.maintitle">
244 ?thing bf:instanceTitle ?it .
245 ?it bf:titleValue %v FILTER(contains(%v, %s))
247 ?thing bf:title %v FILTER(contains(%v, %s))
252 <!-- the instancetitle can also contain a subtitle and a parttitle -->
253 <index type="bf.subtitle">
254 ?thing bf:instanceTitle ?it .
255 ?it bf:subtitle %v FILTER(contains(%v, %s))
258 <index type="bf.parttitle">
259 ?thing bf:instanceTitle ?it .
260 ?it bf:partTitle %v FILTER(contains(%v, %s))
262 <!-- We could also go to the works, and get those titles... -->
264 <!-- Combining any kind of title into one index -->
265 <index type="bf.anytitle">
267 ?thing bf:title %v FILTER(contains(%v, %s))
269 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
271 ?thing ?titlerel ?it . <!-- any kind of link -->
272 ?it a bf:Title <!-- to something that is a title -->
274 ?it bf:titleValue %v FILTER(contains(%v, %s))
276 ?it bf:partTitle %v FILTER(contains(%v, %s))
278 ?it bf:subtitle %v FILTER(contains(%v, %s))
283 <!-- Author indexes. Many instances don't have any, works do -->
284 <index type="bf.creator">
285 ?thing bf:creator ?c .
286 ?c bf:label %v FILTER(contains(%v, %s))
289 <index type="bf.workcreator">
290 ?thing bf:instanceOf ?work .
291 ?work bf:creator ?c .
292 ?c bf:label %v FILTER(contains(%v, %s))
295 <index type="bf.workcontributor">
296 ?thing bf:instanceOf ?work .
297 ?work bf:contributor ?c .
298 ?c bf:label %v FILTER(contains(%v, %s))
301 <index type="bf.contributor">
302 ?thing bf:contributor ?c .
303 ?c bf:label %v FILTER(contains(%v, %s))
306 <index type="bf.anyauthor">
308 ?thing bf:creator ?c .
309 ?c bf:label %v FILTER(contains(%v, %s))
311 ?thing bf:contributor ?c .
312 ?c bf:label %v FILTER(contains(%v, %s))
314 ?thing bf:instanceOf ?work .
315 ?work bf:creator ?c .
316 ?c bf:label %v FILTER(contains(%v, %s))
318 ?thing bf:instanceOf ?work .
319 ?work bf:contributor ?c .
320 ?c bf:label %v FILTER(contains(%v, %s))
324 <!-- Present formats. BF-L comes from "thing" -->
325 <!-- Full instance, with the related work too -->
326 <present type="BF-V">
329 ?iobj1 ?irel2 ?iobj2 .
330 ?iobj2 ?irel3 ?iobj3 .
331 ?work ?wrel1 ?wobj1 .
332 ?wobj1 ?wrel2 ?wobj2 .
340 MINUS { ?iobj2 a bf:Work }
341 MINUS { ?iobj2 a bf:Instance } .
344 MINUS { ?iobj3 a bf:Work }
345 MINUS { ?iobj3 a bf:Instance }
348 OPTIONAL { <!-- Work -->
349 %u bf:instanceOf ?work .
350 ?work ?wrel1 ?wobj1 .
353 MINUS { ?wobj1 a bf:Work }
354 MINUS { ?wobj1 a bf:Instance } .
357 MINUS { ?wobj2 a bf:Work }
358 MINUS { ?wobj2 a bf:Instance }
367 <!-- Small databases -->
369 <!-- "small" contains all the things common to all small databases -->
370 <!-- It is only to be used as an include, it is not searchable, since -->
371 <!-- it has no schema atribute -->
372 <!-- It is divided into "smallbody", and a "small" that includes -->
373 <!-- the general indexes, so that title searches can include the body, -->
374 <!-- but have different "any" indexes -->
376 <db path="smallbody" include="thing">
377 <present type="BF-V">
378 <!-- I don't think we need more than one level -->
379 <!--for these simple databases -->
386 OPTIONAL { ?obj ?rel1 ?obj1 }
391 <!-- The combined "small" database defaults -->
392 <db path="small" include="smallbody">
394 ?thing bf:label %v FILTER(contains(%v, %s))
397 ?thing bf:label %v FILTER(contains(%v, %s))
401 <!-- Various "small" databases, leaning heavily on the defaults above -->
402 <db path="place" schema="sparql-results" include="small" >
403 <criteria>?thing a bf:Place</criteria>
404 <index type="bf.place">
405 ?thing bf:label %v FILTER(contains(%v, %s))
409 <db path="person" schema="sparql-results" include="small" >
410 <criteria>?thing a bf:Person</criteria>
411 <index type="bf.person">
412 ?thing bf:label %v FILTER(contains(%v, %s))
416 <db path="meeting" schema="sparql-results" include="small" >
417 <criteria>?thing a bf:Meeting</criteria>
418 <index type="bf.meeting">
419 ?thing bf:label %v FILTER(contains(%v, %s))
423 <db path="agent" schema="sparql-results" include="small" >
424 <criteria>?thing a bf:Agent</criteria>
425 <index type="bf.agent">
426 ?thing bf:label %v FILTER(contains(%v, %s))
430 <db path="event" schema="sparql-results" include="small" >
431 <criteria>?thing a bf:Event</criteria>
432 <index type="bf.event">
433 ?thing bf:label %v FILTER(contains(%v, %s))
437 <db path="organization" schema="sparql-results" include="small" >
438 <criteria>?thing a bf:Organization</criteria>
439 <index type="bf.organization">
440 ?thing bf:label %v FILTER(contains(%v, %s))
444 <db path="topic" schema="sparql-results" include="small" >
445 <criteria>?thing a bf:Topic</criteria>
446 <index type="bf.topic">
447 ?thing bf:label %v FILTER(contains(%v, %s))
451 <!-- Title search, for seatching Title objects. -->
452 <!-- Not sure if this is needed, but it is a nice example -->
453 <db path="title" schema="sparql-results" include="smallbody" >
454 <criteria>?thing a bf:Title</criteria>
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))
468 ?thing bf:titleValue %v FILTER(contains(%v, %s))
470 ?thing bf:subtitle %v FILTER(contains(%v, %s))
472 ?thing bf:partTitle %v FILTER(contains(%v, %s))
476 <index type="bf.title">
477 ?thing bf:titleValue %v FILTER(contains(%v, %s))
480 <index type="bf.subtitle">
481 ?thing bf:subtitle %v FILTER(contains(%v, %s))
484 <index type="bf.parttitle">
485 ?thing bf:partTitle %v FILTER(contains(%v, %s))
489 <!-- A hack to be able to look at any triplet in the base -->
490 <!-- TODO - Switch to the new system, probably using "small" -->
491 <db path="node" schema="sparql-results">
492 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
493 <prefix>bf: http://bibframe.org/vocab/</prefix>
494 <form>SELECT ?node ?rel ?obj</form>
495 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
497 <!-- A way to see which triplets refers to a given uri. -->
498 <!-- TODO - Switch to the new system, probably using "small" -->
499 <db path="ref" schema="sparql-results">
500 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
501 <prefix>bf: http://bibframe.org/vocab/</prefix>
502 <form>SELECT ?node ?rel ?obj</form>
503 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
508 <message>http</message>
509 <category apdu="true"/>
512 <filter type="http_client">
513 <x-forwarded-for>true</x-forwarded-for>