W3C home > Mailing lists > Public > public-lod@w3.org > October 2017

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

From: Andreas Harth <andreas@harth.org>
Date: Fri, 13 Oct 2017 17:14:24 +0200
To: "Sean B. Palmer" <sean@miscoranda.com>, Martynas Jusevičius <martynas@atomgraph.com>
Cc: SW-forum Web <semantic-web@w3.org>, public-lod@w3.org, www-archive <www-archive@w3.org>
Message-ID: <adc01c5b-cd84-7ff5-f942-fde10412a5ed@harth.org>
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:55 UTC

This archive was generated by hypermail 2.3.1 : Friday, 13 October 2017 15:15:56 UTC