W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > August 2008

Re: SPARQL question: get distinct list of datatypes used for literals

From: Lee Feigenbaum <lee@thefigtrees.net>
Date: Thu, 21 Aug 2008 13:25:47 -0400
Message-ID: <48ADA51B.5020402@thefigtrees.net>
To: al@jku.at
CC: Semantic Web <semantic-web@w3.org>, public-rdf-dawg-comments@w3.org

Andreas Langegger wrote:

> Hi there,
> 
> maybe sb can tell me if this is still possible: I'd like to fetch all 
> datatype URIs used for object literals in a dataset. There is the 
> dataset predicate which can be used in filter expressions to filter 
> literals to a known datatype like xsd:string: FILTER(datatype(?val) = 
> xsd:string).
> 
> But can I bind the value to a variable somehow? With a filter it can't 
> work (consider FILTER(datatype(?val) = ?dt) where ?val is bound to 
> literal values and ?dt should give me the type). I could use property 
> functions, but I'd like to stay with SPARQL specs. Maybe there is a way 
> to do it I just can't see...
> 
> thanks,
> AndyL

AndyL,

There's no way to do this (select functions of values from a 
graph/dataset) in the SPARQL specification.

As you said, various implementations provide extensions that will do 
this. Please see:

http://esw.w3.org/topic/SPARQL/Extensions/Selecting_Expressions

Lee

> 
> 
> Web of Data Practitioners Days / Oct 22-23 / Vienna
> http://www.webofdata.info
> ----------------------------------------------------------------------
> Dipl.-Ing.(FH) Andreas Langegger
> Institute for Applied Knowledge Processing
> Johannes Kepler University Linz
> A-4040 Linz, Altenberger Straße 69
> http://www.langegger.at
> 
> 
> 
> 
> 
> 
Received on Thursday, 21 August 2008 17:26:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 21 August 2008 17:26:37 GMT