[Mulgara-general] TQL: how to cast literal as URI

Life is hard, and then you die ronald at innovation.ch
Tue Jul 28 08:18:59 UTC 2009


On Mon, Jul 27, 2009 at 09:30:52AM -0700, Dragisa Krsmanovic wrote:
> <info:doi/10.1371/123> <dc:creator>  'info:doi/10.1371/abc'
> <info:doi/10.1371/abc> <foaf:name> 'John Doe'
> 
> If I have these two triplets how would I write the query to find creator
> of <info:doi/10.1371/123> ? I need a way to cast a string to url.

I would argue that you need to change your data model. Storing uri's
in literals and then expecting to be able to interpret them as actual
uri's is a bad idea, both from a modelling perspective as well as from
a query perspective (as Paul indicated in another email, even if
Mulgara adds some form of support for this in TQL, it'll be slow and
nasty).


  Cheers,

  Ronald


> On Sat, 2009-07-25 at 00:50 -0400, Paul Gearon wrote:
> > I don't know what you want here. If $lit is indeed binding to a  
> > string, then the second triple pattern can never match, as triples  
> > cannot start with literals. Your answer must always be empty. I'm  
> > guessing that's what you're seeing?
> > 
> > Regards,
> > Paul
> > 
> > On Jul 24, 2009, at 5:23 PM, Dragisa Krsmanovic <dkrsmanovic at plos.org>  
> > wrote:
> > 
> > > Here is an example:
> > >
> > > select $a $b
> > > from <graph>
> > > where $a <predicate> $lit and $lit <predicate2> $b;
> > >
> > > $lit is a string literal in first triplet. I tried <mulgara:is> but it
> > > doesn't let me use a variable. Any ideas ?
> > >
> > > Thanks,
> > > Dragisa
> > >



More information about the Mulgara-general mailing list