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 MINUS { ?wobj3 a bf:Work }
189 MINUS { ?wobj3 a bf:Instance }
193 <!-- Link to the instance(s) -->
195 ?inst bf:instanceOf %u
196 OPTIONAL { <!-- and expand the instance -->
210 <!-- Instance database -->
212 <db path="instance" schema="sparql-results" include="thing smallindex">
213 <criteria>?thing a bf:Instance</criteria>
215 <!-- Title indexes -->
216 <!-- These are messy, there are so many ways to get to a title -->
218 <!-- Main title. Looks logical. Many instances seem to have a title -->
219 <index type="bf.title">
220 ?thing bf:title %v FILTER(contains(%v, %s))
223 <!-- instancetitle is also pretty common -->
224 <index type="bf.instancetitle">
225 ?thing bf:instanceTitle ?it .
226 ?it bf:titleValue %v FILTER(contains(%v, %s))
229 <index type="bf.titlestatement">
230 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
233 <!-- Combining the two above, since users are not likely to know how
234 a given title has been indexed -->
235 <index type="bf.maintitle">
237 ?thing bf:instanceTitle ?it .
238 ?it bf:titleValue %v FILTER(contains(%v, %s))
240 ?thing bf:title %v FILTER(contains(%v, %s))
245 <!-- the instancetitle can also contain a subtitle and a parttitle -->
246 <index type="bf.subtitle">
247 ?thing bf:instanceTitle ?it .
248 ?it bf:subtitle %v FILTER(contains(%v, %s))
251 <index type="bf.parttitle">
252 ?thing bf:instanceTitle ?it .
253 ?it bf:partTitle %v FILTER(contains(%v, %s))
255 <!-- We could also go to the works, and get those titles... -->
257 <!-- Combining any kind of title into one index -->
258 <index type="bf.anytitle">
260 ?thing bf:title %v FILTER(contains(%v, %s))
262 ?thing bf:titleStatement %v FILTER(contains(%v, %s))
264 ?thing ?titlerel ?it . <!-- any kind of link -->
265 ?it a bf:Title <!-- to something that is a title -->
267 ?it bf:titleValue %v FILTER(contains(%v, %s))
269 ?it bf:partTitle %v FILTER(contains(%v, %s))
271 ?it bf:subtitle %v FILTER(contains(%v, %s))
276 <!-- Author indexes. Many instances don't have any, works do -->
277 <index type="bf.creator">
278 ?thing bf:creator ?c .
279 ?c bf:label %v FILTER(contains(%v, %s))
282 <index type="bf.workcreator">
283 ?thing bf:instanceOf ?work .
284 ?work bf:creator ?c .
285 ?c bf:label %v FILTER(contains(%v, %s))
288 <index type="bf.workcontributor">
289 ?thing bf:instanceOf ?work .
290 ?work bf:contributor ?c .
291 ?c bf:label %v FILTER(contains(%v, %s))
294 <index type="bf.contributor">
295 ?thing bf:contributor ?c .
296 ?c bf:label %v FILTER(contains(%v, %s))
299 <index type="bf.anyauthor">
301 ?thing bf:creator ?c .
302 ?c bf:label %v FILTER(contains(%v, %s))
304 ?thing bf:contributor ?c .
305 ?c bf:label %v FILTER(contains(%v, %s))
307 ?thing bf:instanceOf ?work .
308 ?work bf:creator ?c .
309 ?c bf:label %v FILTER(contains(%v, %s))
311 ?thing bf:instanceOf ?work .
312 ?work bf:contributor ?c .
313 ?c bf:label %v FILTER(contains(%v, %s))
317 <!-- Present formats. BF-L comes from "thing" -->
318 <!-- Full instance, with the related work too -->
319 <present type="BF-F">
322 ?iobj1 ?irel2 ?iobj2 .
323 ?iobj2 ?irel3 ?iobj3 .
324 ?work ?wrel1 ?wobj1 .
325 ?wobj1 ?wrel2 ?wobj2 .
333 MINUS { ?iobj2 a bf:Work }
334 MINUS { ?iobj2 a bf:Instance }
337 MINUS { ?iobj3 a bf:Work }
338 MINUS { ?iobj3 a bf:Instance }
343 %u bf:instanceOf ?work
346 MINUS { ?wobj1 a bf:Work }
347 MINUS { ?wobj1 a bf:Instance }
350 MINUS { ?wobj2 a bf:Work }
351 MINUS { ?wobj2 a bf:Instance }
354 MINUS { ?wobj3 a bf:Work }
355 MINUS { ?wobj3 a bf:Instance }
365 <!-- Small databases -->
367 <!-- "small" contains all the things common to all small databases -->
368 <!-- It is only to be used as an include, it is not searchable, since -->
369 <!-- it has no schema atribute -->
370 <!-- It is divided into "smallbody", and a "small" that includes -->
371 <!-- the general indexes, so that title searches can include the body, -->
372 <!-- but have different "any" indexes -->
374 <db path="smallbody" include="thing">
375 <present type="BF-F">
376 <!-- I don't think we need more than one level -->
377 <!--for these simple databases -->
384 OPTIONAL { ?obj ?rel1 ?obj1 }
389 <!-- The combined "small" database defaults -->
390 <db path="small" include="smallbody">
392 ?thing bf:label %v FILTER(contains(%v, %s))
395 ?thing bf:label %v FILTER(contains(%v, %s))
399 <!-- Various "small" databases, leaning heavily on the defaults above -->
400 <db path="place" schema="sparql-results" include="small" >
401 <criteria>?thing a bf:Place</criteria>
402 <index type="bf.place">
403 ?thing bf:label %v FILTER(contains(%v, %s))
407 <db path="person" schema="sparql-results" include="small" >
408 <criteria>?thing a bf:Person</criteria>
409 <index type="bf.person">
410 ?thing bf:label %v FILTER(contains(%v, %s))
414 <db path="meeting" schema="sparql-results" include="small" >
415 <criteria>?thing a bf:Meeting</criteria>
416 <index type="bf.meeting">
417 ?thing bf:label %v FILTER(contains(%v, %s))
421 <db path="agent" schema="sparql-results" include="small" >
422 <criteria>?thing a bf:Agent</criteria>
423 <index type="bf.agent">
424 ?thing bf:label %v FILTER(contains(%v, %s))
428 <db path="event" schema="sparql-results" include="small" >
429 <criteria>?thing a bf:Event</criteria>
430 <index type="bf.event">
431 ?thing bf:label %v FILTER(contains(%v, %s))
435 <db path="organization" schema="sparql-results" include="small" >
436 <criteria>?thing a bf:Organization</criteria>
437 <index type="bf.organization">
438 ?thing bf:label %v FILTER(contains(%v, %s))
442 <db path="topic" schema="sparql-results" include="small" >
443 <criteria>?thing a bf:Topic</criteria>
444 <index type="bf.topic">
445 ?thing bf:label %v FILTER(contains(%v, %s))
449 <!-- Title search, for seatching Title objects. -->
450 <!-- Not sure if this is needed, but it is a nice example -->
451 <db path="title" schema="sparql-results" include="smallbody" >
452 <criteria>?thing a bf:Title</criteria>
456 ?thing bf:titleValue %v FILTER(contains(%v, %s))
458 ?thing bf:subtitle %v FILTER(contains(%v, %s))
460 ?thing bf:partTitle %v FILTER(contains(%v, %s))
466 ?thing bf:titleValue %v FILTER(contains(%v, %s))
468 ?thing bf:subtitle %v FILTER(contains(%v, %s))
470 ?thing bf:partTitle %v FILTER(contains(%v, %s))
474 <index type="bf.title">
475 ?thing bf:titleValue %v FILTER(contains(%v, %s))
478 <index type="bf.subtitle">
479 ?thing bf:subtitle %v FILTER(contains(%v, %s))
482 <index type="bf.parttitle">
483 ?thing bf:partTitle %v FILTER(contains(%v, %s))
487 <!-- A hack to be able to look at any triplet in the base -->
488 <!-- TODO - Switch to the new system, probably using "small" -->
489 <db path="node" 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(?node) = %s )</index>
495 <!-- A way to see which triplets refers to a given uri. -->
496 <!-- TODO - Switch to the new system, probably using "small" -->
497 <db path="ref" schema="sparql-results">
498 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
499 <prefix>bf: http://bibframe.org/vocab/</prefix>
500 <form>SELECT ?node ?rel ?obj</form>
501 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
506 <message>http</message>
507 <category apdu="true"/>
510 <filter type="http_client">
511 <x-forwarded-for>true</x-forwarded-for>