You don't say what SPARQL engine you're using, but at first glance
this looks like a bug.
Try writing it as:
WHERE { {
?subject ?property ?object .
?property a owl:ObjectProperty.
?object rdfs:label ?value
} UNION {
?subject1 ?property1 ?object1 .
?property1 a owl:DataProperty
} }
if that works then you have a bug. The behaviour of SPARQLs UNION is
not very natural from a relation algebra p.o.v., and this may have
confused developers familiar with that.
- Steve
On 4 Jun 2007, at 21:44, Paul Hermans wrote:
Given
PREFIX pcce: <http://www.pcce.be/egb/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?property ?object ?value
This works
WHERE
{?subject ?property ?object.
?property a owl:ObjectProperty.
?object rdfs:label ?value}
This works also
WHERE {
{?subject ?property ?object.
?property a owl:DataProperty}
But the union only returns object properties (everything before the
union) in this case
WHERE {
{?subject ?property ?object.
?property a owl:ObjectProperty.
?object rdfs:label ?value}
UNION
{?subject ?property ?object.
?property a owl:DataProperty} }
And only data properties (before the union) in this case
WHERE {
{?subject ?property ?object.
?property a owl:DataProperty}
UNION
{?subject ?property ?object.
?property a owl:ObjectProperty.
?object rdfs:label ?value} }
While I would like to have both.
What am I missing?