On 09/04/14 17:12, Andy Seaborne wrote:

A standards compliance way to do it is to use:

replace(str(?x), "(/|#[^/#]*)$", "")

which chops the tail off the string of the URI.

either as
FILTER (replace(str(?s), "(/|#[^/#]*)$", "") =
         replace(str(?o), "(/|#[^/#]*)$", "")

or

# BIND to split the line up for readability
BIND(?X AS replace(str(?s), "(/|#[^/#]*)$", ""))
FILTER ( STRSTARTS(str(?o), ?X) )

The regex should be:

"([#/][^/#]*)$"

and may need further refining.

        Andy

Reply via email to