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
51 <criteria>?work a bf:Work</criteria>
52 <!-- TODO: Many more indexes like the ones below-->
53 <index type="bf.title">?work bf:workTitle ?wt .
54 ?wt bf:titleValue %v FILTER(contains(%v, %s))</index>
55 <index type="bf.creator">?work bf:creator ?c .
56 ?c bf:label %v FILTER(contains(%v, %s))</index>
57 <index type="bf.subject">?work bf:subject ?subject .
58 ?subject bf:label %v FILTER(contains(%v, %s))
61 CONSTRUCT { ?work ?rel ?subj }
65 ?work ?rel ?obj FILTER( str(?work) = %s )
69 CONSTRUCT { ?work ?rel ?obj .
78 MINUS { ?obj a bf:Work }
82 MINUS { ?obj1 a bf:Work }
86 MINUS { ?obj2 a bf:Work }
88 ?work ?rel ?obj FILTER( str(?work) = %s )
91 <present type="BF-FI"> <!-- full, with instances. Experimental! -->
92 CONSTRUCT { %u ?rel ?wobj1 .
93 ?wobj1 ?wrel1 ?wobj2 .
94 ?wobj2 ?wrel2 ?wobj3 .
96 ?iobj1 ?irel2 ?iobj2 .
97 ?iobj2 ?irel3 ?iobj3 }
101 OPTIONAL { <!-- note, this is not in the final construct
102 the linking triplet will get included like any others -->
103 ?inst bf:instanceOf %u
105 &workfull; <!-- This does not seem to get expanded!! -->
108 MINUS { ?wobj a bf:Work }
109 MINUS { ?wobj a bf:Instance }
113 MINUS { ?wobj1 a bf:Work }
114 MINUS { ?wobj1 a bf:Instance }
118 MINUS { ?wobj2 a bf:Work }
119 MINUS { ?wobj2 a bf:Instance }
135 <!-- Instance searches, need to be refined later. TODO -->
136 <db path="instance" schema="sparql-results">
137 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
138 <prefix>bf: http://bibframe.org/vocab/</prefix>
139 <form>SELECT ?instance ?title ?format</form>
140 <criteria>?instance a bf:Instance</criteria>
141 <criteria>?instance bf:title ?title</criteria>
142 <index type="4">?instance bf:title %v FILTER(contains(%v, %s))</index>
143 <criteria>?instance bf:format ?format</criteria>
144 <index type="1013">?instance bf:format %s</index>
147 <!-- Small databases -->
149 <!-- "small" contains all the things common to all small databases -->
150 <!-- It is only to be used as an include, it is not searchable, since -->
151 <!-- it has no schema atribute -->
152 <!-- It is divided into "smallindex", "smallbody", and a "small" that includes
153 both, so that title searches can include the body, but have different indexes -->
155 <db path="smallindex">
156 <index type="any">?thing bf:label %v FILTER(contains(%v, %s))</index>
157 <index type="1016">?thing bf:label %v FILTER(contains(%v, %s))</index>
160 <db path="smallbody">
161 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
162 <prefix>bf: http://bibframe.org/vocab/</prefix>
163 <form>SELECT DISTINCT ?thing </form>
164 <criteria>?thing ?rel ?obj</criteria>
165 <present type="BF-L">
166 CONSTRUCT { %u ?rel ?obj }
171 <!-- Experimental, to get just the URIs out, in proper rdf. Probably not useful
173 CONSTRUCT { %u bf:uri %u }
179 <present type="BF-F">
180 <!-- I don't think we need more than one level for these simple
182 CONSTRUCT { %u ?rel ?obj .
187 OPTIONAL { ?obj ?rel1 ?obj1 }
191 <db path="small" include="smallindex smallbody"/>
193 <db path="place" schema="sparql-results" include="small" >
194 <criteria>?thing a bf:Place</criteria>
195 <index type="bf.place">?thing bf:label %v FILTER(contains(%v, %s))</index>
197 <db path="person" schema="sparql-results" include="small" >
198 <criteria>?thing a bf:Person</criteria>
199 <index type="bf.person">?thing bf:label %v FILTER(contains(%v, %s))</index>
201 <db path="meeting" schema="sparql-results" include="small" >
202 <criteria>?thing a bf:Meeting</criteria>
203 <index type="bf.meeting">?thing bf:label %v FILTER(contains(%v, %s))</index>
205 <db path="agent" schema="sparql-results" include="small" >
206 <criteria>?thing a bf:Agent</criteria>
207 <index type="bf.agent">?thing bf:label %v FILTER(contains(%v, %s))</index>
209 <db path="event" schema="sparql-results" include="small" >
210 <criteria>?thing a bf:Event</criteria>
211 <index type="bf.event">?thing bf:label %v FILTER(contains(%v, %s))</index>
213 <db path="organization" schema="sparql-results" include="small" >
214 <criteria>?thing a bf:Organization</criteria>
215 <index type="bf.organization">?thing bf:label %v FILTER(contains(%v, %s))</index>
217 <db path="topic" schema="sparql-results" include="small" >
218 <criteria>?thing a bf:Topic</criteria>
219 <index type="bf.topic">?thing bf:label %v FILTER(contains(%v, %s))</index>
222 <!-- Title search, probably not needed. -->
223 <db path="title" schema="sparql-results" include="smallbody" >
224 <criteria>?thing a bf:Title</criteria>
226 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
227 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
228 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
231 { ?thing bf:titleValue %v FILTER(contains(%v, %s)) } UNION
232 { ?thing bf:subtitle %v FILTER(contains(%v, %s)) } UNION
233 { ?thing bf:partTitle %v FILTER(contains(%v, %s)) }
235 <index type="bf.title">?thing bf:titleValue %v FILTER(contains(%v, %s))</index>
236 <index type="bf.subtitle">?thing bf:subtitle %v FILTER(contains(%v, %s))</index>
237 <index type="bf.parttitle">?thing bf:partTitle %v FILTER(contains(%v, %s))</index>
240 <!-- A hack to be able to look at any triplet in the base -->
241 <!-- TODO - Switch to the new system, probably using "small" -->
242 <db path="node" schema="sparql-results">
243 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
244 <prefix>bf: http://bibframe.org/vocab/</prefix>
245 <form>SELECT ?node ?rel ?obj</form>
246 <index type="any">?node ?rel ?obj FILTER( str(?node) = %s )</index>
248 <!-- A way to see which triplets refers to a given uri. -->
249 <!-- TODO - Switch to the new system, probably using "small" -->
250 <db path="ref" schema="sparql-results">
251 <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
252 <prefix>bf: http://bibframe.org/vocab/</prefix>
253 <form>SELECT ?node ?rel ?obj</form>
254 <index type="any">?node ?rel ?obj FILTER( str(?obj) = %s )</index>
258 <message>http</message>
259 <category apdu="true"/>
261 <filter type="http_client">
262 <x-forwarded-for>true</x-forwarded-for>