[Mulgara-general] Query from restricted graphs

Alexandre Passant alex at passant.org
Wed Aug 23 14:11:41 UTC 2006


Sorry, it's not yet what I need :)

On 8/23/06, Ben Hysell <BenH at viewpointusa.com> wrote:
> Alex,
>
> I'm with you...

Well, let's start from the begining.

1) I create a model <rmi://>

2) I load data from external RDF files. Should I create a new model
for this data if I want to get the RDF files URL as the origin of the
loaded statements ? - maybe that's where I'm wrong.
(I use the basic load <url> info <previously_defined_model>)

3) I add some property to the graph (date, title)

4) Then I want to retrieve triples contained in all graphs of the
model that got dc:title=X property.

When you mention

> Select $g $p $o from <rmi://...> where
> $g <dc:title> 'test graph' and $g $p $o;
>

It will retrieve information about the graph itself. And I'd like to
get statements contained in this graph.

I'd like something like
Select $s $p $o from $graph where $graph <dc:title> 'test graph' and $s $p $o;

thanks,

Alex.



> Or
>
> select $g
> subquery(select $p $o from <rmi://...> where g$ $p $o) from <rmi://...>
> where $g <dc:title> 'test graph';
>
> -ben
>
> -----Original Message-----
> From: apassant at gmail.com [mailto:apassant at gmail.com] On Behalf Of
> Alexandre Passant
> Sent: Wednesday, August 23, 2006 9:28 AM
> To: Ben Hysell
> Subject: Re: [Mulgara-general] Query from restricted graphs
>
> Hi,
>
> Actually I'm trying to retrieve all triples from any graph $g that
> have dc:title = "test graph"
>
> I consider only one model (rmi:///) that got different graphs
> (http://apassant...) (I hope I use the right definition for
> graph/models here :)
>
> thanks
>
> On 8/23/06, Ben Hysell <BenH at viewpointusa.com> wrote:
> > Alex,
> >
> > In your query you are trying to not only find $g, but also find out
> > which model (they are called models in Mulgara if we are talking about
> > <rmi://192.168...>) $g exists in?
> >
> > -ben
> >
> > -----Original Message-----
> > From: apassant at gmail.com [mailto:apassant at gmail.com] On Behalf Of
> > Alexandre Passant
> > Sent: Wednesday, August 23, 2006 9:19 AM
> > To: Ben Hysell
> > Cc: mulgara-general at mulgara.org
> > Subject: Re: [Mulgara-general] Query from restricted graphs
> >
> > Hi,
> >
> > On 8/23/06, Ben Hysell <BenH at viewpointusa.com> wrote:
> > > Alex,
> > >
> > > The try this:
> > >
> > > select $g from <rmi://192.168.0.1/server1#sampledata> where $g
> > > <dc:title> 'test graph';
> > >
> >
> > Actually, I already made this kind of query work.
> > What I'd like to do is something like
> >
> > SELECT ?s ?p ?o
> > WHERE {
> >    ?g dc:title 'test graph'
> >    GRAPH ?g { ?s ?p ?o }
> > }
> >
> > i.e. not retrieve the graph name, but the statements from some graphs
> > (in a single query).
> > Is there a way to do it (as what I've tried before) ?
> >
> > Thanks,
> >
> > Alex.
> >
> >
> > > If you navigate to http://192.168.0.1:8080 on your test machine the
> > help
> > > pages for Mulgara will be visible...try 'iTQL Commands' on the left
> > hand
> > > side of the page for structuring queries.
> > >
> > > -ben
> > >
> > > -----Original Message-----
> > > From: mulgara-general-bounces at mulgara.org
> > > [mailto:mulgara-general-bounces at mulgara.org] On Behalf Of Alexandre
> > > Passant
> > > Sent: Wednesday, August 23, 2006 5:46 AM
> > > To: mulgara-general at mulgara.org
> > > Subject: [Mulgara-general] Query from restricted graphs
> > >
> > > Hi all,
> > >
> > > I'm currently trying mulgura (never used kowari before), and got a
> > > question regarding 'from' queries.
> > >
> > > I'd like to retrieve information from a set of statements constraint
> > > with their properties.
> > >
> > > I first add all needed statements:
> > >
> > > create <rmi://192.168.0.1/server1#sampledata>;
> > > load <http://apassant.net/blog/sioc.php?type=post&id=104>
> > > into<rmi://192.168.0.1/server1#sampledata>;
> > > insert <http://apassant.net/blog/sioc.php?type=post&id=104>
> <dc:title>
> > > 'test graph' into <rmi://192.168.0.1/server1#sampledata>;
> > >
> > > I'm looking for something like
> > >
> > > select $s $p $o from $g where $s $p $o and $g <dc:title> 'test
> graph';
> > > (leads to Query Error: [1,22] expecting: '(', resource )
> > >
> > > Is there a way to do such queries ?
> > >
> > > Finally, is there any difference between from and in ?
> > >
> > > Thanks for your help,
> > >
> > > Alex.
> > > _______________________________________________
> > > Mulgara-general mailing list
> > > Mulgara-general at mulgara.org
> > > http://mulgara.org/mailman/listinfo/mulgara-general
> > >
> >
>



More information about the Mulgara-general mailing list