Property Functions in ARQ

SPARQL allows custom property functions to add functionality to the triple matching process. Property functions can be registered or dynamically loaded.

See also the free text search page.

See also the FILTER functions FILTER functions library.

Property Function Library

Prefix apf: which is <http://jena.hpl.hp.com/ARQ/property#>.

Direct loading using a URI prefix of <java:com.hp.hpl.jena.sparql.pfunction.library.> (note the final dot) also works.

The prefix list: is http://jena.hpl.hp.com/ARQ/list#.

Property nameDescription
list list:member member Membership of an RDF List (RDF Collection). If list is not bound or a constant, find and iterate all lists in the graph (can be slow) else evaluate for one particular list. If member a variable, generate solutions with member bound to each element in the list. If member is bound or a constant expression, test to see if a member of the list.
list list:index (index member) Index of an RDF List (RDF Collection). If list is not bound or a constant, find and iterate all lists in the graph (can be slow) else evaluate for one particular list. The object is a list pair, either element can be bound, unbound or a fixed node. Unbound variables in the object list are bound by the property function.
list list:length length Length of an RDF List (RDF Collection). If list is not bound or a constant, find and iterate all lists in the graph (can be slow) else evaluate for one particular list. The object is tested against or bound to the length of the list.
container rdfs:member member Membership of an RDF Container (rdf:Bag, rdf:Seq, rdf:Alt). Pre-registered URI. If this infers with queries running over a Jena inference model which also provides rdfs:member, then remove this from the global registry.
  PropertyFunctionRegistry.get().
      remove(RDFS.member.getURI()) ;
apf:textMatch
Free text match.  See the [free text search](lucene-arq.html) page for details.
bag apf:bag member The argument bag must be bound by this point in the query or a constant expression. If bag is bound or a URI, and member a variable, generate solutions with member bound to each element in the bag. If member is bound or a constant expression, test to see if a member of the list.
seq apf:seq member The argument seq must be bound by this point in the query or a constant expression. If seq is bound or a URI, and member a variable, generate solutions with member bound to each element in the sequence. If member is bound or a constant expression, test to see if a member of the list.
seq apf:alt member The argument alt must be bound by this point in the query or a constant expression. If alt is bound or a URI, and member a variable, generate solutions with member bound to each element in the alt . If member is bound or a constant expression, test to see if a member of the list.
varOrTermapf:assignvarOrTerm Assign an RDF term from one side to the other.  If both are fixed RDF terms or bound variables, it becomes a boolean test that the subject is the same RDF term as the object.
iriapf:splitIRI (namespace  localname)
iriapf:splitURI (namespace  localname)
Split the IRI or URI into namespace (an IRI) and local name (a string). Compare if given values or bound variables, otherwise set the variable. The object is a list with 2 elements. splitURI is an synonym.
subject apf:str object The subject is the string form of the object, like the function str(). Object must be bound or a constant. Object can not be a blank node (see apf:blankNode)
subject apf:blankNode label
subject apf:bnode label
Subject must be bound to a blank node or a constant. Label is either a string, in which case test for whether this is the blank node label of subject, or it is a variable, which is assigned the blank node label as a plain string. Argument mismatch causes no match. Use with care.
subject apf:versionARQ version

 
Set the subject to the IRI for ARQ and set the object to the version string (format "N.N.N" where N is a number). If any of the variables are already set, test for the correct value.
var apf:concat (arg arg ...) Concatenate the arguments in the object list as strings, and assign to var.

ARQ documentation index