+ <!-- the worktitle can also contain a subtitle and a parttitle -->
+ <index type="bf.subtitle">?work bf:workTitle ?wt .
+ ?wt bf:subtitle %v FILTER(contains(%v, %s))
+ </index>
+
+ <index type="bf.parttitle">
+ ?work bf:workTitle ?wt .
+ ?wt bf:partTitle %v FILTER(contains(%v, %s))
+ </index>
+
+ <!-- work.titlevariation - this could also have sub- and partTitles -->
+ <index type="bf.titlevariation">
+ ?work bf:titleVariation ?tv .
+ ?tv bf:titleValue %v FILTER(contains(%v, %s))
+ </index>
+
+ <!-- Instance titles -->
+ <index type="bf.instancetitle">
+ ?inst bf:instanceOf ?work .
+ ?inst bf:instanceTitle ?it .
+ ?it bf:titleValue %v FILTER(contains(%v, %s))
+ </index>
+
+ <!-- Combined title index. There are so many ways titles can be expresses
+ in Bibframe, this seems to cover most of what we have seen -->
+ <index type="bf.anytitle">
+ { ?work bf:workTitle ?wt .
+ { ?wt bf:titleValue %v FILTER(contains(%v, %s)) } UNION
+ { ?wt bf:subtitle %v FILTER(contains(%v, %s)) } UNION
+ { ?wt bf:partTitle %v FILTER(contains(%v, %s)) }
+ } UNION {
+ ?work bf:titleVariation ?tv .
+ ?tv bf:titleValue %v FILTER(contains(%v, %s))
+ } UNION {
+ ?inst bf:instanceOf ?work .
+ ?inst bf:instanceTitle ?it .
+ ?it bf:titleValue %v FILTER(contains(%v, %s))
+ } UNION {
+ ?work bf:title %v FILTER(contains(%v, %s))
+ }
+ </index>
+
+ <!-- Author indexes. Much simpler than titles. -->
+ <index type="bf.creator">
+ ?work bf:creator ?c .
+ ?c bf:label %v FILTER(contains(%v, %s))
+ </index>
+
+ <index type="bf.contributor">
+ ?work bf:contributor ?c .
+ ?c bf:label %v FILTER(contains(%v, %s))
+ </index>
+
+ <!-- Subjects -->
+ <index type="bf.subject">
+ ?work bf:subject ?subject .
+ ?subject bf:label %v FILTER(contains(%v, %s))
+ </index>
+
+ <!-- Indexes for persons, organizations, etc -->
+ <!-- The person (etc) may be in any relation to the work, subject,
+ creator, etc, as long as there is a direct link -->
+ <index type="bf.person">
+ ?work ?rel ?person .
+ ?person a bf:Person .
+ ?person bf:label %v FILTER(contains(%v, %s))
+ </index>
+ <!-- TODO - make many more like the person above -->
+
+ <!-- Present formats -->
+ <!-- BF-L is just the links -->
+ <present type="BF-L">
+ CONSTRUCT { ?work ?rel ?subj }
+ WHERE {
+ ?work a bf:Work .
+ ?work ?rel ?subj .
+ ?work ?rel ?subj FILTER( str(?work) = %s )
+ }
+ </present>
+
+ <!-- BF-F expands all links, except to instances and other works -->
+ <present type="BF-F">
+ CONSTRUCT { ?work ?rel ?obj .
+ ?obj ?rel1 ?obj1 .
+ ?obj1 ?rel2 ?obj2 .
+ ?obj2 ?rel3 ?obj3 }
+ WHERE {
+ ?work a bf:Work .
+ ?work ?rel ?obj .
+ OPTIONAL {
+ ?obj ?rel1 ?obj1
+ MINUS { ?obj a bf:Work }
+ MINUS { ?obj a bf:Instance }
+ }
+ OPTIONAL {
+ ?obj1 ?rel2 ?obj2
+ MINUS { ?obj1 a bf:Work }
+ MINUS { ?obj1 a bf:Instance }
+ }
+ OPTIONAL {
+ ?obj2 ?rel3 ?obj3
+ MINUS { ?obj2 a bf:Work }
+ MINUS { ?obj2 a bf:Instance }
+ }
+ ?work ?rel ?obj FILTER( str(?work) = %s )
+ }
+ </present>
+
+ <!-- full, with instances. Experimental! -->
+ <present type="BF-FI">
+ CONSTRUCT { %u ?rel ?wobj1 .
+ ?wobj1 ?wrel1 ?wobj2 .
+ ?wobj2 ?wrel2 ?wobj3 .
+ ?inst ?irel1 ?iobj1 .
+ ?iobj1 ?irel2 ?iobj2 .
+ ?iobj2 ?irel3 ?iobj3 }
+ WHERE {
+ %u a bf:Work .
+ %u ?rel ?wobj1 .
+ OPTIONAL { <!-- note, this is not in the final construct
+ the linking triplet will get included like any others -->
+ ?inst bf:instanceOf %u
+ }
+ &workfull; <!-- This does not seem to get expanded!! TODO -->
+ OPTIONAL {
+ ?wobj ?wrel1 ?wobj1
+ MINUS { ?wobj a bf:Work }
+ MINUS { ?wobj a bf:Instance }
+ }
+ OPTIONAL {
+ ?wobj1 ?wrel2 ?wobj2
+ MINUS { ?wobj1 a bf:Work }
+ MINUS { ?wobj1 a bf:Instance }
+ }
+ OPTIONAL {
+ ?wobj2 ?wrel3 ?wobj3
+ MINUS { ?wobj2 a bf:Work }
+ MINUS { ?wobj2 a bf:Instance }
+ }
+ <!--&instfull; -->
+ OPTIONAL {
+ ?inst ?irel1 ?iobj1
+ }
+ OPTIONAL {
+ ?iobj1 ?irel2 ?iobj2
+ }
+ OPTIONAL {
+ ?iobj2 ?irel3 ?iobj3
+ }
+
+ }
+ </present>