Hi Richard



I'm from Swirrl - we work with DCLG to manage the Open Data Communities service.




Queries like your one can be potentially quite slow in general.  You could 
probably make it a fair bit faster by adding in a bit of prior knowledge about 
the time dimension, rather than looking for possible subproperties of the sdmx 
refPeriod. This dataset (like all the data cube datasets on ODC) use this URI 
for the time dimension property:




http://opendatacommunities.org/def/ontology/time/refPeriod




Also, there is an open (but not fully documented) JSON API that does pretty 
much what you are trying to do.  We use it to find the values of cube 
dimensions in the preparation of the tabular view that appears on the dataset 
page.





http://opendatacommunities.org/data/homelessness/homelessness-acceptances/ethnicity/cube/dimension_values.json?dimension=http%3A%2F%2Fopendatacommunities.org%2Fdef%2Fontology%2Ftime%2FrefPeriod




i.e. add "/cube/dimension_values.json" to the dataset URI, then provide a URI 
for the dimension you are interested in as the value of the 'dimension' URL 
parameter.




Behind the scenes, this runs a SPARQL query fairly similar to the one you have 
presented. I could dig out exactly what that query is, if that's useful for you.




ODC uses Fuseki with TDB behind the scenes, so should hopefully give the same 
result as your local instance.  I'm afraid I can't help on why it's not working 
on your local system, based on the info you are able to provide.




Hope that helps a bit




Cheers




Bill






















Bill Roberts, CEO, Swirrl IT Limited
Mobile: +44 (0) 7717 160378 | Skype: billroberts1966 | @billroberts 
http://swirrl.com

On Tue, Feb 10, 2015 at 3:21 PM, Richard Davenport
<[email protected]> wrote:

> Greetings,
> I'm developing a project using ODC data (http://opendatacommunities.org/).
> The endpoint (http://opendatacommunities.org/sparql) has limited capacity
> such that it cannot be used for production environments (queries regularly
> fail, timeout), so therefore I created a Fuseki service using a TBD
> dataset. I then downloaded .nt dumps of each graph I wanted to use (like
> http://opendatacommunities.org/data/homelessness/homelessness-acceptances/ethnicity)
> and uploaded them without issue.
> While I am able to successfully get results for simple queries (like just
> returning ?s ?p ?o), more specific queries return zero results without
> error.
> PREFIX  dc:   <http://purl.org/dc/elements/1.1/>
> PREFIX  dim:  <http://purl.org/linked-data/sdmx/2009/dimension#>
> PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX  apf:  <http://jena.hpl.hp.com/ARQ/property#>
> PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>
> PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
> PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX  tgt:  <
> http://opendatacommunities.org/graph/homelessness/homelessness-acceptances/ethnicity
>>
> PREFIX  fn:   <http://www.w3.org/2005/xpath-functions#>
> SELECT DISTINCT  ?rp ?label
> WHERE
>   { ?property (rdfs:subPropertyOf)* dim:refPeriod .
>     ?rp rdfs:label ?label
>     GRAPH tgt:
>       { ?subject ?property ?rp}
>   }
> ORDER BY ?rp
> LIMIT   1
> The above query works (sometimes!) on the original endpoint against the
> original graph (run it by clicking here: http://tinyurl.com/ohmnxfh).
> However, the same does not result from my Fuseki service - despite
> replacing tgt: with the correct URI of the graph on my server, ensuring
> that the other prerequisite PREFIXs are correctly defined, and trying to
> read up/troubleshoot.
> My server/environment is inside a private network which cannot be accessed
> from outside, therefore I'm unable to provide public access to my endpoint
> for testing. However, I am grateful for any advice in solving this problem
> and any tests or workarounds :)
> Kind Regards,
> Richard.

Reply via email to