I decided to use CONSTRUCT to make a new predicate with the search terms,
that can be inserted with SPARUL.
In case anyone's interested,
example for albums that can be looked up by artist and/or album name. It
seems to work ok with
CONSTRUCT {
?s <http://localhost/literals> `bif:concat(?o, " ", ?an)`
}
WHERE {
?s rdf:type mo:Record .
?s foaf:maker ?a .
?a foaf:name ?an .
?s dc:title ?o .
}
Another example for looking up movies from DBpedia, where the query can
contains terms from the title, actors or director.
CONSTRUCT {
?s <http://localhost/literals> `bif:concat(?o, " ", ?an, " ", ?dn)`
}
WHERE {
?s rdf:type dbpedia-owl:Film .
?s dbpprop:name ?o .
OPTIONAL {?s dbpprop:starring ?starring .}
OPTIONAL {?s dbpprop:director ?director . }
OPTIONAL {?starring dbpprop:name ?an . }
OPTIONAL {?director dbpprop:name ?dn . }
}