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

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:40 UTC