On 06/05/11 17:15, McGibbney, Lewis John wrote:
Hi Andy,

I tried your suggested syntax but can't seem to form a valid SPARQL query.

It's the ':p' that is causing confusion... I am expecting something different. 
By 'The property that...' do you mean the predicate?
Thanks

I meant something from your data - I don't know which property you want to use there.

The syntax error is is because prefix ":" is not defined but it was only an illustration.

        Andy

________________________________________
From: Andy Seaborne [[email protected]]
Sent: 06 May 2011 14:24
To: [email protected]
Subject: Re: Executing SPARQL queries on owl:NamedIndividual

Did yo mean something like

SELECT ?type ?name ?b ?double

WHERE { ?b rdf:type ?type ;
          # Get the display name for ?b - your property may vary.
             rdfs:label ?name ;
         # The property that connect ?b to the double value.
             :p   ?double .
          FILTER (?double<  2.5)}



On 04/05/11 14:59, McGibbney, Lewis John wrote:
Hi Chris,

(typo in second name)

fixed now thanks for pointing this out.

WHERE { ?b rdf:type ?type;
           owl:NamedIndividual ?NamedIndividual;
           xsd:double ?double .
          FILTER (?double<   2.5)}

There's something wrong with how you're thinking of this, but I'm not
sure how best to explain it. There is no statement with property xsd:double
in your data, so the query cannot succeed. Similarly there are no statements
with property owl:NamedIndividual; ditto.

What you've written for the triples  is shorthand for

     ?b rdf:type ?type.
     ?b owl:NamedIndividual ?NamedIndividual.
     ?b xsd:double ?double .


OK I understand your point. When I think more about it, I am trying to think 
logically about how to construct SPARQL query's but have failed to understand 
how the triples are structured. I will focus on getting my head around this 
problem, hopefully this will have the knock-on effect of producing cleaner more 
logical SPARQL queries.

Your properties -- the middle terms of the triples, eg

   
section6energydomestic2010:hasMaximumAreaWeightedAverageUvalueForAllElementsOfTheSameTypeWperm²K

(which is a horribly long name to be using) -- don't match any of those.

Yes I know this, I think this is something which I will be dealing with in the 
future. Currently the RDF resource was produced from domain specific building 
regulations, hence the obscure property names.

Thank you for your solution, this is what I was looking for.

PS ?x ?p ?y queries can be very expensive.
I had a feeling that this would be the case, however from viewing various 
threads is it a fair comment to say that this will only be the case when 
querying over large datasets or many datasets within a triple store? In 
comparison my testdata (ath this stage) consists of 329 triples which are being 
read into Fuseki manually without the requirement for a triple store.

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 
2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career 
Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html

Email has been scanned for viruses by Altman Technologies' email management 
service - www.altman.co.uk/emailsystems

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 
2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career 
Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html

Reply via email to