- -->
- </db>
-
- <!-- Experiments while waiting for the present queries to be implemented -->
- <db path="onework-l" schema="sparql-results">
- <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
- <prefix>bf: http://bibframe.org/vocab/</prefix>
- <form>SELECT ?work ?rel ?subj
- </form>
- <criteria>?work a bf:Work</criteria>
- <criteria>?work ?rel ?obj</criteria>
- <index type="any">?work ?rel ?obj FILTER( str(?work) = %s )</index>
- </db>
- <db path="onework-l-rdf" schema="rdf">
- <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
- <prefix>bf: http://bibframe.org/vocab/</prefix>
- <form>CONSTRUCT { ?work ?rel ?subj }
- </form>
- <criteria>?work a bf:Work</criteria>
- <criteria>?work ?rel ?subj</criteria>
- <index type="any">?work ?rel ?obj FILTER( str(?work) = %s )</index>
- </db>
-
- <!-- This is the old "work" db that will not scale. May be removed -->
- <db path="concatwork" schema="sparql-results">
- <prefix>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns</prefix>
- <prefix>bf: http://bibframe.org/vocab/</prefix>
- <form>SELECT
- ?work
- (sql:GROUP_DIGEST (?wtitle, ' ; ', 1000, 1)) AS ?title
- (sql:GROUP_DIGEST (?creatorlabel, ' ; ', 1000, 1))AS ?creator
- (sql:GROUP_DIGEST (?subjectlabel, ' ; ', 1000, 1))AS ?subject
- </form>
- <criteria>?work a bf:Work</criteria>
-
- <criteria> OPTIONAL {
- ?work bf:workTitle ?wt .
- ?wt bf:titleValue ?wtitle }
- </criteria>
- <criteria> OPTIONAL {
- ?work bf:creator ?creator .
- ?creator bf:label ?creatorlabel }
- </criteria>
- <criteria>OPTIONAL {
- ?work bf:subject ?subject .
- ?subject bf:label ?subjectlabel }
- </criteria>
- <index type="4">?wt bf:titleValue %v FILTER(contains(%v, %s))</index>
- <index type="1003">?creator bf:label %v FILTER(contains(%v, %s))</index>
- <index type="21">?subject bf:label %v FILTER(contains(%v, %s))</index>
- <index type="1016"> {
- ?work ?op1 ?child .
- ?child ?op2 %v FILTER(contains(STR(%v), %s))
+ <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 }
+ }
+ OPTIONAL {
+ ?obj1 ?rel2 ?obj2
+ MINUS { ?obj1 a bf:Work }
+ }
+ OPTIONAL {
+ ?obj2 ?rel3 ?obj3
+ MINUS { ?obj2 a bf:Work }
+ }
+ ?work ?rel ?obj FILTER( str(?work) = %s )
+ }
+ </present>
+ <present type="BF-FI"> <!-- full, with instances. Experimental! -->
+ 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!! -->
+ 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