- From: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
- Date: Thu, 12 Jan 2006 09:51:34 +0000
- To: Semantic Web <semantic-web@w3.org>
On Thu, Jan 12, 2006 at 05:35:13 +0800, Jeremy Wong ��?��?�?? wrote: > > Below is a SPARQL query to retrieve pairs of resource and resource's > property (when the resource acts as subject). It is to find out whether the > set of rdfs:domain of a rdf:Property is a subset of the set of rdfs:Class > of a resource. It looks so lengthy... Any way to improve the query? > > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > SELECT DISTINCT ?r0 ?property{ > ?r0 a ?c0. > ?property rdfs:domain ?c0. > OPTIONAL{ > ?property rdfs:domain ?c1. > FILTER(?c1=?c0) > OPTIONAL{ > ?property rdfs:domain ?c2a. > FILTER(?c2a!=?c1) > } > FILTER(BOUND(?c2a)) I think all this line does is negate the OPTIONAL keyword obove, if c2a must be bound then the OPTIONAL block had to match, which has the same semantics as { ?property rdfs:domain ?c2a. FILTER(?c2a!=?c1) } - Steve
Received on Thursday, 12 January 2006 09:51:45 UTC