| java.lang.Object arq.examples.propertyfunction.labelSearch
labelSearch | public class labelSearch implements PropertyFunction(Code) | | Example extension or property function to show rewriting part of a query.
A simpler, more driect way to implement property functions is to extends
one of the helper classes and have the custom code called on each solution from the
the previosu query stage.
See examples
localname for a general predicate that allows for any of
subject or object to be a variable of boudn value, or see
uppercase for a simple
implementation that transforms on graph node into a new node.
This is a more complicated example which uses the PropertyFunction interface directly.
It takes the QueryIterator from the previous stage and inserts a new processing step.
It then calls that processing step to do the real work.
The approach here could be used to access an external index (e.g. Lucene) although here
we just show looking for RDFS labels.
?x ext:labelSearch "something"
as
?x rdfs:label ?label . FILTER regex(?label, "something", "i")
by simply doing a regex but could be used to add access to some other form of
indexing or external structure.
author: Andy Seaborne |
Method Summary | |
public void | build(PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt) | public QueryIterator | exec(QueryIterator input, PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt) | public static void | main(String[] argv) |
hiddenVariableCount | static int hiddenVariableCount(Code) | | |
build | public void build(PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt)(Code) | | |
exec | public QueryIterator exec(QueryIterator input, PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt)(Code) | | |
|
|