[redland-dev] custom operators in librdf

mycircuit mycircuit at sunrise.ch
Sat Feb 2 07:46:04 EST 2013


Hi
Does librdf supports custom operators ( Sparql) , custom properties ( Jena
) or other means to trigger custom code execution from a query. For example

Sesame:

(
http://rivuli-development.com/further-reading/sesame-cookbook/creating-custom-sparql-functions
)

"We would like to be able to formulate a SPARQL query that allows us to
retrieve all resources that have a palindrome as their label:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
PREFIX cfn: <http://example.org/customfunction/>
SELECT ?x ?label
WHERE {
      ?x rdfs:label ?label .
      FILTER(cfn:palindrome(str(?label)))
}
"

or from Jena/ARQ:

(http://jena.sourceforge.net/ARQ/extension.html#propertyFunctions)

"Property functions, sometimes called "magic properties", are properties
that cause triple matching to happen by executing some piece of code,
determined by the property URI, and not by the usual graph matching. They
can be used to give certain kinds of inference and rule processing. ....

... One common case is for access to collections (RDF lists) or containers
(rdf:Bag, rdf:Seq, rdf:Alt).

PREFIX list: <http://jena.hpl.hp.com/ARQ/list#>

SELECT ?member
{ ?x :p ?list .		# Some way to find the list
 ?list list:member ?member .
}


Thanks for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.librdf.org/pipermail/redland-dev/attachments/20130202/a5d9d98a/attachment.html>


More information about the redland-dev mailing list