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 <!-- Any search in work returns just a list of records.
44 Present will make another request for each record to get the level
45 of details we want, depending on the schema. -->
46 <db path="work" schema="sparql-results">
47 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
48 <prefix>bf: http://bibframe.org/vocab/</prefix>
49 <form>SELECT DISTINCT ?work </form>
50 <criteria>?work a bf:Work</criteria>
52 <!-- bf.uri is a simple way to get to a work -->
53 <index type="bf.uri"> ?work a bf:Work FILTER( ?work = %u ) </index>
55 <!-- Title indexes, directly via work.workTitle -->
56 <index type="bf.title">
57 ?work bf:workTitle ?wt .
58 ?wt bf:titleValue %v FILTER(contains(%v, %s))
61 <index type="bf.subtitle">?work bf:workTitle ?wt .
62 ?wt bf:subtitle %v FILTER(contains(%v, %s))
65 <index type="bf.parttitle">
66 ?work bf:workTitle ?wt .
67 ?wt bf:partTitle %v FILTER(contains(%v, %s))
70 <!-- work.titlevariation - this could also have sub- and partTitles -->
71 <index type="bf.titlevariation">
72 ?work bf:titleVariation ?tv .
73 ?tv bf:titleValue %v FILTER(contains(%v, %s))
76 <!-- Instance titles -->
77 <index type="bf.instancetitle">
78 ?inst bf:instanceOf ?work .
79 ?inst bf:instanceTitle ?it .
80 ?it bf:titleValue %v FILTER(contains(%v, %s))
83 <!-- Combined title index. There are so many ways titles can be expresses
84 in Bibframe, this seems to cover most of what we have seen -->
85 <index type="bf.anytitle">
86 { ?work bf:workTitle ?wt .
87 { ?wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION
88 { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION
89 { ?wt bf:partTitle %v FILTER(contains(%v, %s)) }
91 ?work bf:titleVariation ?tv .
92 ?tv bf:titleValue %v FILTER(contains(%v, %s))
94 ?inst bf:instanceOf ?work .
95 ?inst bf:instanceTitle ?it .
96 ?it bf:titleValue %v FILTER(contains(%v, %s))
100 <!-- Author indexes -->
101 <index type="bf.creator">
102 ?work bf:creator ?c .
103 ?c bf:label %v FILTER(contains(%v, %s))
106 <index type="bf.contributor">
107 ?work bf:contributor ?c .
108 ?c bf:label %v FILTER(contains(%v, %s))
112 <index type="bf.subject">?work bf:subject ?subject .
113 ?subject bf:label %v FILTER(contains(%v, %s))
116 <!-- Present formats. BF-L is just the links -->
117 <present type="BF-L">
118 CONSTRUCT { ?work ?rel ?subj }
122 ?work ?rel ?obj FILTER( str(?work) = %s )
126 <!-- BF-F expands all links, except to instances -->
127 <present type="BF-F">
128 CONSTRUCT { ?work ?rel ?obj .
137 MINUS { ?obj a bf:Work }
141 MINUS { ?obj1 a bf:Work }
145 MINUS { ?obj2 a bf:Work }
147 ?work ?rel ?obj FILTER( str(?work) = %s )
151 <!-- full, with instances. Experimental! -->
152 <present type="BF-FI">
153 CONSTRUCT { %u ?rel ?wobj1 .
154 ?wobj1 ?wrel1 ?wobj2 .
155 ?wobj2 ?wrel2 ?wobj3 .
156 ?inst ?irel1 ?iobj1 .
157 ?iobj1 ?irel2 ?iobj2 .
158 ?iobj2 ?irel3 ?iobj3 }
162 OPTIONAL { <!-- note, this is not in the final construct
163 the linking triplet will get included like any others -->
164 ?inst bf:instanceOf %u
166 &workfull; <!-- This does not seem to get expanded!! TODO -->
169 MINUS { ?wobj a bf:Work }
170 MINUS { ?wobj a bf:Instance }
174 MINUS { ?wobj1 a bf:Work }
175 MINUS { ?wobj1 a bf:Instance }
179 MINUS { ?wobj2 a bf:Work }
180 MINUS { ?wobj2 a bf:Instance }
196 <!-- Instance searches, need to be refined later. TODO -->
197 <db path="instance" schema="sparql-results">
198 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
199 <prefix>bf: http://bibframe.org/vocab/</prefix>
200 <form>SELECT ?instance ?title ?format</form>
201 <criteria>?instance a bf:Instance</criteria>
202 <criteria>?instance bf:title ?title</criteria>
203 <index type="4">?instance bf:title %v FILTER(contains(%v, %s))</index>
204 <criteria>?instance bf:format ?format</criteria>
205 <index type="1013">?instance bf:format %s</index>
208 <!-- Small databases -->
210 <!-- "small" contains all the things common to all small databases -->
211 <!-- It is only to be used as an include, it is not searchable, since -->
212 <!-- it has no schema atribute -->
213 <!-- It is divided into "smallindex", "smallbody", and a "small" that includes
214 both, so that title searches can include the body, but have different indexes -->
216 <db path="smallindex">
217 <index type="any">?thing bf:label %v FILTER(contains(%v, %s))</index>
218 <index type="1016">?thing bf:label %v FILTER(contains(%v, %s))</index>
221 <db path="smallbody">
222 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
223 <prefix>bf: http://bibframe.org/vocab/</prefix>
224 <form>SELECT DISTINCT ?thing </form>
225 <criteria>?thing ?rel ?obj</criteria>
226 <present type="BF-L">
227 CONSTRUCT { %u ?rel ?obj }
232 <!-- Experimental, to get just the URIs out, in proper rdf. Probably not useful
234 CONSTRUCT { %u bf:uri %u }
240 <present type="BF-F">
241 <!-- I don't think we need more than one level for these simple
243 CONSTRUCT { %u ?rel ?obj .
248 OPTIONAL { ?obj ?rel1 ?obj1 }
252 <db path="small" include="smallindex smallbody"/>
254 <db path="place" schema="sparql-results" include="small" >
255 <criteria>?thing a bf:Place</criteria>
256 <index type="bf.place">?thing bf:label %v FILTER(contains(%v, %s))</index>
258 <db path="person" schema="sparql-results" include="small" >
259 <criteria>?thing a bf:Person</criteria>
260 <index type="bf.person">?thing bf:label %v FILTER(contains(%v, %s))</index>
262 <db path="meeting" schema="sparql-results" include="small" >
263 <criteria>?thing a bf:Meeting</criteria>
264 <index type="bf.meeting">?thing bf:label %v FILTER(contains(%v, %s))</index>
266 <db path="agent" schema="sparql-results" include="small" >
267 <criteria>?thing a bf:Agent</criteria>
268 <index type="bf.agent">?thing bf:label %v FILTER(contains(%v, %s))</index>
270 <db path="event" schema="sparql-results" include="small" >
271 <criteria>?thing a bf:Event</criteria>
272 <index type="bf.event">?thing bf:label %v FILTER(contains(%v, %s))</index>
274 <db path="organization" schema="sparql-results" include="small" >
275 <criteria>?thing a bf:Organization</criteria>
276 <index type="bf.organization">?thing bf:label %v FILTER(contains(%v, %s))</index>
278 <db path="topic" schema="sparql-results" include="small" >
279 <criteria>?thing a bf:Topic</criteria>
280 <index type="bf.topic">?thing bf:label %v FILTER(contains(%v, %s))</index>
283 <!-- Title search, probably not needed. -->
284 <db path="title" schema="sparql-results" include="smallbody" >
285 <criteria>?thing a bf:Title</criteria>
287 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
288 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
289 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
292 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
293 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
294 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
296 <index type="bf.title">?thing bf:titleValue %v FILTER(contains(%v, %s))</index>
297 <index type="bf.subtitle">?thing bf:subtitle %v FILTER(contains(%v, %s))</index>
298 <index type="bf.parttitle">?thing bf:partTitle %v FILTER(contains(%v, %s))</index>
301 <!-- A hack to be able to look at any triplet in the base -->
302 <!-- TODO - Switch to the new system, probably using "small" -->
303 <db path="node" schema="sparql-results">
304 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
305 <prefix>bf: http://bibframe.org/vocab/</prefix>
306 <form>SELECT ?node ?rel ?obj</form>
307 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
309 <!-- A way to see which triplets refers to a given uri. -->
310 <!-- TODO - Switch to the new system, probably using "small" -->
311 <db path="ref" schema="sparql-results">
312 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
313 <prefix>bf: http://bibframe.org/vocab/</prefix>
314 <form>SELECT ?node ?rel ?obj</form>
315 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
319 <message>http</message>
320 <category apdu="true"/>
322 <filter type="http_client">
323 <x-forwarded-for>true</x-forwarded-for>