3 <!-- Entity definitions for commonly used idioms -->
4 <!-- TODO - Now it accepts these, but will not expand them in place! -->
5 <!-- Seems we can not use many special characters in these: <> % etc -->
6 <!ENTITY workfull "FOOBAR" >
10 MINUS { ?wobj a bf:Work }
11 MINUS { ?wobj a bf:Instance }
15 MINUS { ?wobj1 a bf:Work }
16 MINUS { ?wobj1 a bf:Instance }
20 MINUS { ?wobj2 a bf:Work }
21 MINUS { ?wobj2 a bf:Instance }
37 <filters xmlns="http://indexdata.com/metaproxy">
38 <filter type="sparql">
39 <!-- Which sparql server to use, our demo, or your local installation -->
40 <!--defaults uri="http://bibframe.indexdata.com/sparql/"/-->
41 <defaults uri="http://localhost:8890/sparql/"/>
43 <!-- work database -->
44 <db path="work" schema="sparql-results">
45 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
46 <prefix>bf: http://bibframe.org/vocab/</prefix>
47 <!-- The search clause just finds ?works, present is done below -->
48 <form>SELECT DISTINCT ?work </form>
49 <criteria>?work a bf:Work</criteria>
51 <!-- bf.uri is a simple way to get to a work -->
52 <index type="bf.uri"> ?work a bf:Work FILTER( ?work = %u ) </index>
54 <!-- Title indexes -->
55 <!-- These are messy, there are so many ways to get to a title -->
57 <!-- Main title. Looks logical, but in practice we have seen only a very
58 small number of these -->
59 <index type="bf.title">
60 ?work bf:title %v FILTER(contains(%v, %s))
63 <!-- worktitle seems to be the most common way to store the title of a work -->
64 <index type="bf.worktitle">
65 ?work bf:workTitle ?wt .
66 ?wt bf:titleValue %v FILTER(contains(%v, %s))
69 <!-- Combining the two above, since users are not likely to know how
70 a given title has been indexed -->
71 <index type="bf.maintitle">
73 ?work bf:workTitle ?wt .
74 ?wt bf:titleValue %v FILTER(contains(%v, %s))
76 ?work bf:title %v FILTER(contains(%v, %s))
81 <!-- the worktitle can also contain a subtitle and a parttitle -->
82 <index type="bf.subtitle">?work bf:workTitle ?wt .
83 ?wt bf:subtitle %v FILTER(contains(%v, %s))
86 <index type="bf.parttitle">
87 ?work bf:workTitle ?wt .
88 ?wt bf:partTitle %v FILTER(contains(%v, %s))
91 <!-- work.titlevariation - this could also have sub- and partTitles -->
92 <index type="bf.titlevariation">
93 ?work bf:titleVariation ?tv .
94 ?tv bf:titleValue %v FILTER(contains(%v, %s))
97 <!-- Instance titles -->
98 <index type="bf.instancetitle">
99 ?inst bf:instanceOf ?work .
100 ?inst bf:instanceTitle ?it .
101 ?it bf:titleValue %v FILTER(contains(%v, %s))
104 <!-- Combined title index. There are so many ways titles can be expresses
105 in Bibframe, this seems to cover most of what we have seen -->
106 <index type="bf.anytitle">
107 { ?work bf:workTitle ?wt .
108 { ?wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION
109 { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION
110 { ?wt bf:partTitle %v FILTER(contains(%v, %s)) }
112 ?work bf:titleVariation ?tv .
113 ?tv bf:titleValue %v FILTER(contains(%v, %s))
115 ?inst bf:instanceOf ?work .
116 ?inst bf:instanceTitle ?it .
117 ?it bf:titleValue %v FILTER(contains(%v, %s))
119 ?work bf:title %v FILTER(contains(%v, %s))
123 <!-- Author indexes. Much simpler than titles. -->
124 <index type="bf.creator">
125 ?work bf:creator ?c .
126 ?c bf:label %v FILTER(contains(%v, %s))
129 <index type="bf.contributor">
130 ?work bf:contributor ?c .
131 ?c bf:label %v FILTER(contains(%v, %s))
135 <index type="bf.subject">
136 ?work bf:subject ?subject .
137 ?subject bf:label %v FILTER(contains(%v, %s))
140 <!-- Indexes for persons, organizations, etc -->
141 <!-- The person (etc) may be in any relation to the work, subject,
142 creator, etc, as long as there is a direct link -->
143 <index type="bf.person">
145 ?person a bf:Person .
146 ?person bf:label %v FILTER(contains(%v, %s))
148 <!-- TODO - make many more like the person above -->
150 <!-- Present formats -->
151 <!-- BF-L is just the links -->
152 <present type="BF-L">
153 CONSTRUCT { ?work ?rel ?subj }
157 ?work ?rel ?subj FILTER( str(?work) = %s )
161 <!-- BF-F expands all links, except to instances and other works -->
162 <present type="BF-F">
163 CONSTRUCT { ?work ?rel ?obj .
172 MINUS { ?obj a bf:Work }
173 MINUS { ?obj a bf:Instance }
177 MINUS { ?obj1 a bf:Work }
178 MINUS { ?obj1 a bf:Instance }
182 MINUS { ?obj2 a bf:Work }
183 MINUS { ?obj2 a bf:Instance }
185 ?work ?rel ?obj FILTER( str(?work) = %s )
189 <!-- full, with instances. Experimental! -->
190 <present type="BF-FI">
191 CONSTRUCT { %u ?rel ?wobj1 .
192 ?wobj1 ?wrel1 ?wobj2 .
193 ?wobj2 ?wrel2 ?wobj3 .
194 ?inst ?irel1 ?iobj1 .
195 ?iobj1 ?irel2 ?iobj2 .
196 ?iobj2 ?irel3 ?iobj3 }
200 OPTIONAL { <!-- note, this is not in the final construct
201 the linking triplet will get included like any others -->
202 ?inst bf:instanceOf %u
204 &workfull; <!-- This does not seem to get expanded!! TODO -->
207 MINUS { ?wobj a bf:Work }
208 MINUS { ?wobj a bf:Instance }
212 MINUS { ?wobj1 a bf:Work }
213 MINUS { ?wobj1 a bf:Instance }
217 MINUS { ?wobj2 a bf:Work }
218 MINUS { ?wobj2 a bf:Instance }
235 <!-- Instance database -->
237 <db path="instance" schema="sparql-results">
238 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
239 <prefix>bf: http://bibframe.org/vocab/</prefix>
240 <!-- The search clause just finds ?insts, present is done below -->
241 <form>SELECT DISTINCT ?inst </form>
242 <criteria>?inst a bf:Instance</criteria>
244 <!-- bf.uri is a simple way to get to a work -->
245 <index type="bf.uri"> ?inst a bf:Instance FILTER( ?inst = %u ) </index>
247 <!-- Title indexes -->
248 <!-- These are messy, there are so many ways to get to a title -->
250 <!-- Main title. Looks logical, but in practice we have seen only a very
251 small number of these -->
252 <index type="bf.title">
253 ?inst bf:title %v FILTER(contains(%v, %s))
256 <!-- worktitle seems to be the most common way to store the title of a work -->
257 <index type="bf.instancetitle">
258 ?inst bf:instanceTitle ?it .
259 ?it bf:titleValue %v FILTER(contains(%v, %s))
262 <!-- BF-L is just the links -->
263 <present type="BF-L">
264 CONSTRUCT { ?inst ?rel ?subj }
266 ?inst a bf:Instance .
268 ?inst ?rel ?subj FILTER( str(?inst) = %s )
272 <!-- Full instance, with the related work too -->
273 <present type="BF-F">
276 ?iobj1 ?irel2 ?iobj2 .
277 ?iobj2 ?irel3 ?iobj3 .
278 ?work ?wrel1 ?wobj1 .
279 ?wobj1 ?wrel2 ?wobj2 .
287 MINUS { ?iobj1 a bf:Work }
288 MINUS { ?iobj1 a bf:Instance }
291 MINUS { ?iobj2 a bf:Work }
292 MINUS { ?iobj2 a bf:Instance }
297 %u bf:instanceOf ?work
300 MINUS { ?wobj1 a bf:Work }
301 MINUS { ?wobj1 a bf:Instance }
304 MINUS { ?wobj2 a bf:Work }
305 MINUS { ?wobj2 a bf:Instance }
308 MINUS { ?wobj3 a bf:Work }
309 MINUS { ?wobj3 a bf:Instance }
319 <!-- Small databases -->
321 <!-- "small" contains all the things common to all small databases -->
322 <!-- It is only to be used as an include, it is not searchable, since -->
323 <!-- it has no schema atribute -->
324 <!-- It is divided into "smallindex", "smallbody", and a "small" that includes
325 both, so that title searches can include the body, but have different indexes -->
327 <db path="smallindex">
328 <index type="any">?thing bf:label %v FILTER(contains(%v, %s))</index>
329 <index type="1016">?thing bf:label %v FILTER(contains(%v, %s))</index>
332 <db path="smallbody">
333 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
334 <prefix>bf: http://bibframe.org/vocab/</prefix>
335 <form>SELECT DISTINCT ?thing </form>
336 <criteria>?thing ?rel ?obj</criteria>
337 <present type="BF-L">
338 CONSTRUCT { %u ?rel ?obj }
343 <!-- Experimental, to get just the URIs out, in proper rdf. Probably not useful
345 CONSTRUCT { %u bf:uri %u }
351 <present type="BF-F">
352 <!-- I don't think we need more than one level for these simple
354 CONSTRUCT { %u ?rel ?obj .
359 OPTIONAL { ?obj ?rel1 ?obj1 }
363 <db path="small" include="smallindex smallbody"/>
365 <db path="place" schema="sparql-results" include="small" >
366 <criteria>?thing a bf:Place</criteria>
367 <index type="bf.place">?thing bf:label %v FILTER(contains(%v, %s))</index>
369 <db path="person" schema="sparql-results" include="small" >
370 <criteria>?thing a bf:Person</criteria>
371 <index type="bf.person">?thing bf:label %v FILTER(contains(%v, %s))</index>
373 <db path="meeting" schema="sparql-results" include="small" >
374 <criteria>?thing a bf:Meeting</criteria>
375 <index type="bf.meeting">?thing bf:label %v FILTER(contains(%v, %s))</index>
377 <db path="agent" schema="sparql-results" include="small" >
378 <criteria>?thing a bf:Agent</criteria>
379 <index type="bf.agent">?thing bf:label %v FILTER(contains(%v, %s))</index>
381 <db path="event" schema="sparql-results" include="small" >
382 <criteria>?thing a bf:Event</criteria>
383 <index type="bf.event">?thing bf:label %v FILTER(contains(%v, %s))</index>
385 <db path="organization" schema="sparql-results" include="small" >
386 <criteria>?thing a bf:Organization</criteria>
387 <index type="bf.organization">?thing bf:label %v FILTER(contains(%v, %s))</index>
389 <db path="topic" schema="sparql-results" include="small" >
390 <criteria>?thing a bf:Topic</criteria>
391 <index type="bf.topic">?thing bf:label %v FILTER(contains(%v, %s))</index>
394 <!-- Title search, probably not needed. -->
395 <db path="title" schema="sparql-results" include="smallbody" >
396 <criteria>?thing a bf:Title</criteria>
398 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
399 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
400 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
403 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
404 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
405 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
407 <index type="bf.title">?thing bf:titleValue %v FILTER(contains(%v, %s))</index>
408 <index type="bf.subtitle">?thing bf:subtitle %v FILTER(contains(%v, %s))</index>
409 <index type="bf.parttitle">?thing bf:partTitle %v FILTER(contains(%v, %s))</index>
412 <!-- A hack to be able to look at any triplet in the base -->
413 <!-- TODO - Switch to the new system, probably using "small" -->
414 <db path="node" schema="sparql-results">
415 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
416 <prefix>bf: http://bibframe.org/vocab/</prefix>
417 <form>SELECT ?node ?rel ?obj</form>
418 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
420 <!-- A way to see which triplets refers to a given uri. -->
421 <!-- TODO - Switch to the new system, probably using "small" -->
422 <db path="ref" schema="sparql-results">
423 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
424 <prefix>bf: http://bibframe.org/vocab/</prefix>
425 <form>SELECT ?node ?rel ?obj</form>
426 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
430 <message>http</message>
431 <category apdu="true"/>
433 <filter type="http_client">
434 <x-forwarded-for>true</x-forwarded-for>