W3C home > Mailing lists > Public > public-sparql-dev@w3.org > April to June 2010

Union in Construct

From: Buikstra, A.P.F. <a.p.f.buikstra@student.vu.nl>
Date: Thu, 17 Jun 2010 09:33:27 +0000
To: "public-sparql-dev@w3.org" <public-sparql-dev@w3.org>
Message-ID: <7C54890852CB2544BF5917E9D8518D2741AF4CC4@PEXMB002B.vu.local>
Hi guys,

I'm using a construct query to extract a specific portion of RDF from LDSR. I'm creating these queries automatically, by the following transformation:

Select ?a
Where { ?a ?b ?c }
->
Construct {?a ?b ?c}
Where {?a ?b ?c}

There are a few trivialities, such as Filters which have to be removed, but this turned out not to be an issue. The problem is when Union comes into the were, the idea no longer works:

Construct { {?a ?b ?c} UNION {?a ?d ?c}}
Where { {?a ?b ?c} UNION {?a ?d ?c}}

Would give an error.
My question is, can I just do:

Construct {          ?a ?b ?c .
?a ?d ?c}
Where { {?a ?b ?c} UNION {?a ?d ?c}}

It seems to work okay, but it doesn't feel completely right. It comes down to whether the engine would try to construct both -?a ?b ?c- and -?a ?d ?c- given the data, or either. Is there a better way to tackle my problem?

All help appreciated!

Arjon Buikstra
(Working with Larkc at the VU and MPIB)
Received on Thursday, 17 June 2010 12:10:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 17 June 2010 12:10:42 GMT