Functions in N3 (was: Re: What Happened to the Semantic Web?)

Hi Sean,

thanks for the post, you are making some good points.

On 10/12/17 21:27, Sean B. Palmer wrote:
> As another example, consider FILTER clauses in SPARQL queries. There
> are quite a few functions in the SPARQL 1.1 function library for
> filtering:
> 
> https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#SparqlOps
> 
> None of these are first class functions in the Semantic Web as they
> have neither a URI to identify them, nor any place in the actual graph
> structure of the query, because most of the query does not have a
> graph structure unlike in N3QL. And this is so even though FILTER is
> embedded in a WHERE clause, which is otherwise the only thing in a
> SPARQL query that is actually expressed as a graph! In N3QL, on the
> other hand, filters are predicates as an implied metasyntactic
> construct.

The lack of URIs for SPARQL functions has irked me for a while.

We have been using N3 as rule syntax in our Linked Data-Fu system,
and have found that the CWM builtins [1] are problematic.  Some really
useful functions are missing (such as isLiteral(), isURI, datatype()),
and some of the existing functions are underspecified concerning the
support for datatypes.

SPARQL has a much more complete set of functions and it would be nice to
be able to use those in N3.  Defining a prefix for the SPARQL builtin
functions (and operators) should be easy.  I wonder why nobody has done
that already.

The ugly thing with that approach is that certain XPath functions have
been imported into SPARQL, which leads to multiple URIs for the same
function (see also built-ins in SWRL [2] or RIF [3]).

Cheers,
Andreas.

P.S. Try to write BIND (?celsius * 9/5 + 32 AS ?fahrenheit) in N3.
Or FILTER (lang(?x) = "en" || lang(?x) = "de").
Maybe some syntactic shortcuts would be helpful.

[1] https://www.w3.org/2000/10/swap/doc/CwmBuiltins
[2] http://www.daml.org/swrl/proposal/builtins.html
[3] http://www.w3.org/TR/rif-dtb/

Received on Friday, 13 October 2017 15:15:44 UTC