Re: SELECT only one predicate among many with same URI

2017-05-03 Thread Rurik Thomas Greenall
Perhaps something like:

prefix ex: 

SELECT ?title (sample(?b) as ?subject) WHERE {
  ?uri ex:title ?title ;
 ex:subject ?b ;
} GROUP BY ?uri ?title

On Thu, May 4, 2017 at 7:15 AM, Laura Morales  wrote:

> Let's say I have this simple model for a dataset of books
>
> 
> title "only 1 title" .
> topic "some topic", "another topic", "many topics" .
>
> There is one title, but several topics. I want to retrieve a list of
> books, together with their title and only one topic (any one of them is
> OK). So what I want is a list of results like this
>
>  title "title"
>  topic "some topic"
>  title "the title"
>  topic "random topic"
> ...
>
> Is there any (simple) way to do this with SPARQL?
>


Re: SELECTing s properties in the same query

2017-04-15 Thread Rurik Thomas Greenall
In a trivial way, perhaps you can specify something like:

SELECT * WHERE {
   ?property ?object
  OPTIONAL {
?object ?subProperty ?subObject .
FILTER (isBlank(?object))
  }
}

This assumes nothing about structure and may perform badly.


On Fri, Apr 14, 2017 at 4:17 PM, Laura Morales  wrote:

> If I have these nquands (in Turtle syntax)
>
>
> 
> ns:name "My name" ;
> ns:address [
> ns:street "Street name" ;
> ns:number "42" .
> ] .
>
> 
> ns:name "Another name" ;
> ns:address [
> ns:street "Another street" ;
> ns:number "24" .
> ] .
>
> etc
>
>
> here, ns:address links to blank nodes. What I'd like to do is "SELECT
> everything about ", but if I do a SELECT on  what I
> get in return is something like
>
> {
>   {
> "s": 
> "p": ns:name
> "o": "My name"
>   }
>   {
> "s": 
> "p": ns:address
> "o": "name-of-the-blank-node"
>   }
> }
>
> so I have to perform another query to retrieve the properties of
> "name-of-the-blank-node". How can I retrieve all information in one single
> query instead (= subject's name + full address instead of a blank node id)?
>


Re: Limited HTTP API

2017-03-26 Thread Rurik Thomas Greenall
Hi Laura,

Perhaps worth configuring timeouts <
https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html>,
which should prevent the situations you aim to prevent.

Regards,

Rurik

On Sun, Mar 26, 2017 at 5:49 PM, Laura Morales  wrote:

> This seems to be about securing data, or part of a graph. My data is
> actually all public, and I just want to add some limitations to make sure
> that people can use my SPARQL endpoint without overloading it at the same
> time with complex queries that suck up all the resources.
>
>
>
>
> Sent: Sunday, March 26, 2017 at 4:13 PM
> From: "A. Soroka" 
> To: users@jena.apache.org
> Subject: Re: Limited HTTP API
> There is some documentation about combining Shiro with jena-permissions
> available here:
>
> https://jena.apache.org/documentation/permissions/example.html
>
> The extent to which that will be useful to you may be limited to the
> extent to which you can fit the patterns of usage you want to control into
> the dataset/graph/triple framework over which jena-permissions works.
>
> ---
> A. Soroka
> The University of Virginia Library
>


Re: Using variable assignment with QueryBuilder

2015-03-31 Thread Rurik Thomas Greenall
Hi Andy,

Of course, that should have occurred to me.

Thanks,

Rurik

On Mon, Mar 30, 2015 at 6:51 PM, Andy Seaborne a...@apache.org wrote:

 On 24/03/15 14:25, Rurik Thomas Greenall wrote:

 Is there any way to do BIND assignments with QueryBuilder
 (ConstructBuilder)?

 I'm attempting to return plain string literals from

 PREFIX dcterms: http://purl.org/dc/terms/
 PREFIX ex: http://example.com/onto/

 CONSTRUCT {?url dcterms:date ?date }
 WHERE {
?url dcterms:date ?d
BIND (str(?d) as ?date)
 }

 Regards,

 Rurik.


 Hi Rurik,

 Claude may be able to say more; as far as I can see, the ConstructBuilder
 takes a WhereClause, and the WhereClause has no direct support for BIND,
 only FILTER.

 However, it does have subqueries so:

 CONSTRUCT {?url dcterms:date ?date }
 WHERE {
SELECT ?url (str(?d) as ?date) {
  ?url dcterms:date ?d
}
 }

 should work.

 Andy




Using variable assignment with QueryBuilder

2015-03-24 Thread Rurik Thomas Greenall
Is there any way to do BIND assignments with QueryBuilder
(ConstructBuilder)?

I'm attempting to return plain string literals from

PREFIX dcterms: http://purl.org/dc/terms/
PREFIX ex: http://example.com/onto/

CONSTRUCT {?url dcterms:date ?date }
WHERE {
  ?url dcterms:date ?d
  BIND (str(?d) as ?date)
}

Regards,

Rurik.


Re: Time series (energy data) in jena

2015-01-28 Thread Rurik Thomas Greenall
Hi Ashley,

I worked for a large Norwegian oil company on sensor readings in relation
to time-series data from data historians.

For numerous reasons (including the sheer number of triples), we planned to
move away from the idea of storing the data directly as RDF, but rather
mapped data from the historians to RDF on-the-fly, providing a simple REST
interface to serve the RDF. The PoC for this included data about the
sensors and the measurements taken as well as links to previous/subsequent
measurements.

I played with the idea of requesting period series via the interface as
well as single instants.

The PoC worked well enough to be used in a real-time 3D visualisation of
the subsea template, but I'm not sure how this ended up as I ended my
contract before the project was completed.

Regards,

Rurik

On Wed, Jan 28, 2015 at 11:02 AM, Ashley Davison-White adw...@gmail.com
wrote:

 Hi all

 I'm currently looking at the feasibility of storing time series data in
 jena (TDB); specifically energy data. In fact, right now I'm looking for a
 reason not to!-  so far, my research has shown me it is possible but there
 seems to be a lack of experimentation in doing so.

 I'm wondering if anyone is aware of previous research or projects? And if
 there are any potential advantages/disadvantages?

 From my limited experience, in-place updates are not possible, so storing a
 rollup of data (i.e. an entity of readings per day, rather than per minute)
 is not possible; so each reading would need to be it's own tuple. With a
 large data set, I can see this being a problem - especially with the
 increased verboseness of triple data vs a traditional time series database.
 However, for small scale, I don't see this as a problem.

 I'm interested to hear opinions on the topic.

 Regards,
 - Ashley



Re: ReverseProxy

2013-02-08 Thread Rurik Thomas Greenall
On Fri, Feb 8, 2013 at 9:19 AM, Andy Seaborne a...@apache.org wrote:

 On 07/02/13 21:46, Rurik Thomas Greenall wrote:

 I fixed the major issue (Apache2 required being stopped and started again
 for edits on httpd.conf to take).

 The current setup is problematic because I have to use a rewrite and this
 seems to break many things for Fuseki…


 Please say what breaks for you.  All you've said is breaks many things
 -- what exactly?


Sorry, yes. My point here was that this is a problem that has nothing to do
with Fuseki and everything to do with my setup.







 RewriteEngine on

 RewriteRule ^/data/(.*)$ http://localhost:3030/$1 [P]

 ProxyPass / ajp://localhost:8009/webapp/
 ProxyPassReverse /bml ajp://localhost:8009/webapp/

 I'm new to ProxyPass, so any help here is gratefully received.

 Rurik


 ProxyPass is better than RewriteRule[P]

 RewriteRule, by default discards the query string to allow you to put in a
 new one - you need [QSA] to pass through the query string.

We use ProxyPass e.g.

 ProxyPass /WHATEVER/sparql  
 http://localhost:3030/**WHATEVER/sparqlhttp://localhost:3030/WHATEVER/sparqlmax=3

 Andy


I have adjusted my setup and everything now works, so thanks for the
pointers






 On Tue, Feb 5, 2013 at 11:18 PM, Andy Seaborne a...@apache.org wrote:

  On 05/02/13 17:50, Rurik Greenall wrote:

  I have a small issue regarding Fuseki and a reverse proxy in Apache2 on
 Cent OS on a virtual server. I want quickly to eliminate the possibility
 the the issue is related to Fuseki.

 Are there any known limitations here?


 No (Epimorphics does this routinely).

 What's the issue?
 What is your httpd conf setup?

  Andy


  Regards,

 Rurik.








Re: ReverseProxy

2013-02-07 Thread Rurik Thomas Greenall
I fixed the major issue (Apache2 required being stopped and started again
for edits on httpd.conf to take).

The current setup is problematic because I have to use a rewrite and this
seems to break many things for Fuseki…

RewriteEngine on

RewriteRule ^/data/(.*)$ http://localhost:3030/$1 [P]

ProxyPass / ajp://localhost:8009/webapp/
ProxyPassReverse /bml ajp://localhost:8009/webapp/

I'm new to ProxyPass, so any help here is gratefully received.

Rurik



On Tue, Feb 5, 2013 at 11:18 PM, Andy Seaborne a...@apache.org wrote:

 On 05/02/13 17:50, Rurik Greenall wrote:

 I have a small issue regarding Fuseki and a reverse proxy in Apache2 on
 Cent OS on a virtual server. I want quickly to eliminate the possibility
 the the issue is related to Fuseki.

 Are there any known limitations here?


 No (Epimorphics does this routinely).

 What's the issue?
 What is your httpd conf setup?

 Andy


 Regards,

 Rurik.