This works perfectly Dave thank you I am still very much finding my feet here so apologies for the mundane thread discussion on my part ________________________________________ From: Dave Reynolds [[email protected]] Sent: 03 May 2011 17:15 To: [email protected] Subject: Re: Valid SPARQL query no results
On Tue, 2011-05-03 at 14:42 +0100, McGibbney, Lewis John wrote: > Hi list, > > Using Fuseki-0.2.0, I'm trying to run queries on some test data. I load in > the data with the following command > ./fuseki-server --update --file myfile.owl /dataset > Part of my test data is as below > > ### > http://www.semanticweb.org/ontologies/2010/11/section6energydomestic2010.owl#hasNoMaximumOrMinimumAreaGuidance > > section6energydomestic2010:hasNoMaximumOrMinimumAreaGuidance rdf:type > owl:FunctionalProperty , > > owl:ObjectProperty ; > > rdfs:comment > "Due to the target method set by carbon dioxide emissions standard 6.1, there > is no need for guidance on minimum or maximum area for windows, doors, > rooflights and roof windows in new dwellings."^^xsd:string ; > > rdfs:range > section6energydomestic2010:Door , > > section6energydomestic2010:Framing , > > section6energydomestic2010:Glazing , > > section6energydomestic2010:RoofWindow , > > section6energydomestic2010:Rooflight , > > section6energydomestic2010:Window ; > > rdfs:domain [ > rdf:type owl:Class ; > > owl:intersectionOf ( section6energydomestic2010:BuildingElement > > section6energydomestic2010:NewDwelling > > ) > ] . > > After confirming that the syntax in the following query is valid, from the > control panel I submit the query but I get a 404 error: not found... > > > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > PREFIX owl: <http://www.w3.org/2002/07/owl#> > PREFIX fn: <http://www.w3.org/2005/xpath-functions#> > PREFIX apf: <http://jena.hpl.hp.com/ARQ/property#> > PREFIX dc: <http://purl.org/dc/elements/1.1/> > PREFIX ns: > <http://www.semanticweb.org/ontologies/2010/11/section6energydomestic2010.owl#hasNoMaximumOrMinimumAreaGuidance> > > SELECT ?range ?b ?comment > WHERE > { ?range ns:hasNoMaximumOrMinimumAreaGuidance ?comment > FILTER regex (?comment, "^^xsd:string") } In your example ns:hasNoMaximumOrMinimumAreaGuidance is the subject, not the property and the property is rdfs:comment. Secondly, the ^^xsd:string in the source data is declaring a datatype, it is not part of the lexical form of the string and you can't regex on it that way. But then I don't see why you would need to. > > Can someone please help me with my query. I wish to retrieve something like > the following > > range ?b > ?comment > ----------------------------------------------------------------------------------------------------------------- > Door hasNoMaximumOrMinimumAreaGuidance Due to the target method set > by carbon dioxide emissions standard 6.1... blah blah blah > Framing hasNoMaximumOrMinimumAreaGuidance Due to the target method set by > carbon dioxide emissions standard 6.1... blah blah blah > Glazing hasNoMaximumOrMinimumAreaGuidance Due to the target method set > by carbon dioxide emissions standard 6.1... blah blah blah Maybe something simple like: SELECT ?range ?b ?comment WHERE { ?b rdfs:range ?range; rdfs:comment ?comment. } ? Dave 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
