Re: Software Site for Apache Jena OSGI

2020-03-19 Thread ajs6f
I'm not quite sure what you mean by "Software Site". Are you looking for a
place from which to download that artifact?

If so, I don't think we currently provide a direct download of the
jena-osgi module. We provide it via Maven repository publication. Are you
using a dependency manager as part of your work? If not, you can download
it directly here:

https://repository.apache.org/service/local/repositories/releases/content/org/apache/jena/jena-osgi/3.14.0/jena-osgi-3.14.0.jar

Adam

On Thu, Mar 19, 2020, 4:28 AM Georg Schmidt-Dumont <
georg.schmidtdumon...@gmail.com> wrote:

> Good morning,
>
> I am busy setting up an OSGI Bundle which will use Apache Jena. I have
> found the OSGI Bundle provided for Apache Jena. Unfortunately I have not
> been able to find a Software Site for it. Do you provide a Software Site
> for Jena? If so, where can I find it?
>
> kind regards,
> Georg Schmidt-Dumont
>


Re: Identify SPARQL query's type

2020-03-19 Thread Marco Neumann
excellent looking forward to the presentation Claus. would you mind if we
open this zoom event up to the public?

On Thu, Mar 19, 2020 at 6:30 PM Claus Stadler <
cstad...@informatik.uni-leipzig.de> wrote:

> Hi Marco,
>
> I will prepare a presentation of the most important features next week; I
> can't say right now which day is best, but maybe we can arrange that on
> short notice on the weekend or on Monday via direct mail. As for
> contributions to Jena directly, I am already in contact with Andy via some
> recent JIRA issues and PRs :)
>
>
> I also intend to start the discussion on contributing some relevant parts
> of our extension project to jena directly. The reason why this did not
> happen so far is mainly because it takes significantly more efforts to
> polish code up for a such a big community project and ensuring a good level
> of stability - but some parts are stable and probably of more general
> interest :)
>
>
> Cheers,
>
> Claus
>
>
> On 19.03.20 10:37, Marco Neumann wrote:
> > thank you Claus, there is obviously much more in the Jena-extensions
> > (SmartDataAnalytics / jena-sparql-api).
> >
> > if you want to contribute your work to the Jena project you will have to
> > follow up with Andy directly. But I am not sure this is necessary at the
> > moment since you already provide the code in the public domain
> conveniently
> > as an extension / add-on to the Jena project, which I think is great as
> is
> > for now. Over time we might want to learn from your work and add aspects
> to
> > the overall core Jena project I would think.
> >
> > It would be great if we could schedule a zoom session in order to give us
> > an overview of the "SmartDataAnalytics / jena-sparql-api" extensions
> >
> > could you prepare such a presentation in the coming days?
> >
> > best,
> > Marco
> >
> >
> >
> > On Wed, Mar 18, 2020 at 3:34 PM Claus Stadler <
> > cstad...@informatik.uni-leipzig.de> wrote:
> >
> >> Hi,
> >>
> >>
> >> The SparqlStmt API built against jena 3.14.0 is now available on Maven
> >> Central [1]  in case one want to give it a try (example in [2]) and give
> >> feedback and whether one thinks it would be a useful contribution to
> Jena
> >> directly - and what changes would be necessary if so.
> >>
> >>
> >> 
> >> org.aksw.jena-sparql-api
> >> jena-sparql-api-stmt
> >> 3.14.0-1
> >>
> >> 
> >>
> >>
> >> [1]
> >>
> https://search.maven.org/artifact/org.aksw.jena-sparql-api/jena-sparql-api-stmt/3.14.0-1/jar
> >>
> >> [2]
> >>
> https://github.com/SmartDataAnalytics/jena-sparql-api/blob/def0d3bdf0f4396fbf1ef0715f9697e9bb255029/jena-sparql-api-stmt/src/test/java/org/aksw/jena_sparql_api/stmt/TestSparqlStmtUtils.java#L54
> >>
> >>
> >> Cheers,
> >>
> >> Claus
> >>
> >>
> >>
> >> On 18.03.20 16:04, Andy Seaborne wrote:
> >>> Note that parsing the string as a query aborts early as soon as it
> finds
> >> an update keyword so the cost of parsing isn't very large.
> >>>  Andy
> >>>
> >>> On 18/03/2020 11:58, Marco Neumann wrote:
>  is there some utility function here in the code base now already to do
>  this, or do I still need to roll my own here?
> 
>  On Tue, Jul 30, 2013 at 4:25 PM Andy Seaborne 
> wrote:
> 
> > On 30/07/13 10:13, Arthur Vaïsse-Lesteven wrote:
> >> Hi,
> >>
> >> I would like to know if Jena offers a way to detect the type of an
> > unknow SPARQL request ?Starting from the query string.
> >> At the moment the only way I succed to code it without "basic
> parsing"
> > of the query ( sort of thing I prefer avoid, manually parsing string
> >> with
> > short function often create errors )
> >> looks like this :
> >>
> >> [...]
> >>   String queryString = "a query string, may be a select or
> an
> > update";
> >>try{
> >>Query select = QueryFactory.create(queryString);
> >>Service.process_select_query(select);//do some work
> with
> > the select
> >>}
> >>catch(QueryException e){
> >>UpdateRequest update =
> >> UpdateFactory.create(queryString);
> >>Service.process_update_query(update);//do some work
> with
> > the update
> >>}
> >>catch(ProcessException e){
> >>//handle this exception
> >>}
> >>
> >> [...]
> >>
> >> So is it possible ? Or not ?
> > Not currently.
> >
> > You could use a regexp to spot the SELECT/CONSTRUCT/DESCRIBE/ASK
> >> keyword
> > coming after BASE/PREFIXES/Comments.
> >
> >   Andy
> >
> >
> >> --
> >> Dipl. Inf. Claus Stadler
> >> Department of Computer Science, University of Leipzig
> >> Research Group: http://aksw.org/
> >> Workpage & WebID: http://aksw.org/ClausStadler
> >> Phone: +49 341 97-32260
> >>
> >>
> --
> Dipl. Inf. Claus Stadler
> Department of Computer Science, University of Leipzig
> Research 

Re: Identify SPARQL query's type

2020-03-19 Thread Claus Stadler

Hi Marco,

I will prepare a presentation of the most important features next week; I can't 
say right now which day is best, but maybe we can arrange that on short notice 
on the weekend or on Monday via direct mail. As for contributions to Jena 
directly, I am already in contact with Andy via some recent JIRA issues and PRs 
:)


I also intend to start the discussion on contributing some relevant parts of 
our extension project to jena directly. The reason why this did not happen so 
far is mainly because it takes significantly more efforts to polish code up for 
a such a big community project and ensuring a good level of stability - but 
some parts are stable and probably of more general interest :)


Cheers,

Claus


On 19.03.20 10:37, Marco Neumann wrote:

thank you Claus, there is obviously much more in the Jena-extensions
(SmartDataAnalytics / jena-sparql-api).

if you want to contribute your work to the Jena project you will have to
follow up with Andy directly. But I am not sure this is necessary at the
moment since you already provide the code in the public domain conveniently
as an extension / add-on to the Jena project, which I think is great as is
for now. Over time we might want to learn from your work and add aspects to
the overall core Jena project I would think.

It would be great if we could schedule a zoom session in order to give us
an overview of the "SmartDataAnalytics / jena-sparql-api" extensions

could you prepare such a presentation in the coming days?

best,
Marco



On Wed, Mar 18, 2020 at 3:34 PM Claus Stadler <
cstad...@informatik.uni-leipzig.de> wrote:


Hi,


The SparqlStmt API built against jena 3.14.0 is now available on Maven
Central [1]  in case one want to give it a try (example in [2]) and give
feedback and whether one thinks it would be a useful contribution to Jena
directly - and what changes would be necessary if so.



org.aksw.jena-sparql-api
jena-sparql-api-stmt
3.14.0-1




[1]
https://search.maven.org/artifact/org.aksw.jena-sparql-api/jena-sparql-api-stmt/3.14.0-1/jar

[2]
https://github.com/SmartDataAnalytics/jena-sparql-api/blob/def0d3bdf0f4396fbf1ef0715f9697e9bb255029/jena-sparql-api-stmt/src/test/java/org/aksw/jena_sparql_api/stmt/TestSparqlStmtUtils.java#L54


Cheers,

Claus



On 18.03.20 16:04, Andy Seaborne wrote:

Note that parsing the string as a query aborts early as soon as it finds

an update keyword so the cost of parsing isn't very large.

 Andy

On 18/03/2020 11:58, Marco Neumann wrote:

is there some utility function here in the code base now already to do
this, or do I still need to roll my own here?

On Tue, Jul 30, 2013 at 4:25 PM Andy Seaborne  wrote:


On 30/07/13 10:13, Arthur Vaïsse-Lesteven wrote:

Hi,

I would like to know if Jena offers a way to detect the type of an

unknow SPARQL request ?Starting from the query string.

At the moment the only way I succed to code it without "basic parsing"

of the query ( sort of thing I prefer avoid, manually parsing string

with

short function often create errors )

looks like this :

[...]
  String queryString = "a query string, may be a select or an

update";

   try{
   Query select = QueryFactory.create(queryString);
   Service.process_select_query(select);//do some work with

the select

   }
   catch(QueryException e){
   UpdateRequest update =

UpdateFactory.create(queryString);

   Service.process_update_query(update);//do some work with

the update

   }
   catch(ProcessException e){
   //handle this exception
   }

[...]

So is it possible ? Or not ?

Not currently.

You could use a regexp to spot the SELECT/CONSTRUCT/DESCRIBE/ASK

keyword

coming after BASE/PREFIXES/Comments.

  Andy



--
Dipl. Inf. Claus Stadler
Department of Computer Science, University of Leipzig
Research Group: http://aksw.org/
Workpage & WebID: http://aksw.org/ClausStadler
Phone: +49 341 97-32260



--
Dipl. Inf. Claus Stadler
Department of Computer Science, University of Leipzig
Research Group: http://aksw.org/
Workpage & WebID: http://aksw.org/ClausStadler
Phone: +49 341 97-32260



Re: Nested SELECT queries

2020-03-19 Thread Adam Davies
Thanks for the reply!

In terms of what I’m trying to get back, I was hoping to list in one row a list 
of names, and in another a list of locations (which you’ve helped me solve).

The dataset I am working with contains information about published articles and 
presentations. What I was hoping to do was to isolate all of the presentations, 
and then list where they took place and list whoever created the presentation 
to get a list of all of the creators and the locations they have visited. 
However, since the human-readable data of names is behind a reference that is 
unreadable, I was lead to the idea that nesting my queries would allow me to 
achieve this - as shown.

I’m still having trouble getting jena fuseki to list the creator’s names beside 
their respective locations. Using the code you provided, I tried to make a 
separate query (which would be the second half of the first) to do the same 
with creator names. While this seems to run, it outputs nothing:
PREFIX bibo: 
PREFIX event: 
PREFIX rdfs: 
PREFIX foaf: 
SELECT ?creatorName ?creatorCountry
WHERE
{
 ?creatorName ?predicate ?creatorCountry .
 ?creatorInfo foaf:name ?creatorName .
 ?publication  ?creatorInfo .
 ?publication bibo:presentedAt ?place .  ##1
} 
LIMIT 500

On 2020/03/18 22:25:57, Andy Seaborne  wrote: 
> Hi Adam,
> 
> PREFIX bibo: 
> PREFIX event: 
> PREFIX rdfs: 
> SELECT ?creatorName ?creatorCountry
> WHERE
> {
>  ?creatorName ?predicate ?creatorCountry .
>  ?locationName rdfs:label ?creatorCountry .
>  ?locationInfo event:place ?locationName .
>  ?publication bibo:presentedAt ?locationInfo .
>  ?publication bibo:presentedAt ?place .  ##1
> } LIMIT 500
> 
> 
> and the last part (##1) does not add anything but may cause duplication 
> of results.
> 
> The output order of rows is not fixed.
> 
> What output are trying to get back?
> 
> On 18/03/2020 21:10, Adam Davies wrote:
> > Dear all,
> > I have been attempting to use jena fuseki to perform a query on a large 
> > dataset. However, due to the nature of this dataset, and my current 
> > inexperience with jena fuseki - being a new user for a project in education 
> > - after some research into jena fuseki I found myself coming to the 
> > conclusion that I would need to nest my select queries to order my data in 
> > a human-readable fashion that I could work through efficiently. When I came 
> > to write these nested queries though, I was immediately given an error 
> > after the first nest.
> 
> > Due to my lack of experience, I have struggled to find a solution to this 
> > problem, and came here for advice. Is anyone able to help me? I have 
> > attached aforementioned code below:
> > SELECT ?creatorName ?creatorCountry
> > WHERE
> > {#BEGINMAINSELECT
> > ?creatorName ?predicate ?creatorCountry
> >{#BEGINNEST1
> > SELECT ?creatorCountry
> > WHERE
> > {
> > ?locationName 
> >  ?creatorCountry#Find out the 
> > human-readable name of the location the publication was presented at via 
> > it's reference
> > }
> > {#BEGINNEST2
> 
> There's a syntax error at line #BEGINNEST2
> 
> Was this meant? It removes the "}" on the line before #BEGINNEST2
> 
> SELECT ?a ?b ?c {
> ?a :p [] .
> { SELECT ?b { ?b :q ?x
> { SELECT ?d { ?d :q ?y
>  { SELECT ?c { ?c :q ?z
>  }}
> }}
> }}
> }
> 
> 
> 
> 
> > SELECT ?locationName
> > WHERE
> > {
> > ?locationInfo 
> >  ?locationName#Find out the name 
> > reference of the location the publication was presented at
> > }
> > {#BEGINNEST3
> > SELECT ?locationInfo
> > WHERE
> > {
> >  ?publication 
> >  ?locationInfo#Select each 
> > publication retrieved from the below query and find out where they were 
> > presented at
> > }
> > {#BEGINNEST4
> > SELECT ?publication
> > WHERE
> > {
> > ?publication 
> >  ?place#Select all publications 
> > with predicate 'presented at'
> > }
> > }#ENDNEST4
> > }#ENDNEST3
> >  }#ENDNEST2
> >}#ENDNEST1
> > }
> > LIMIT 500
> > 
> 


Re: Fuseki's Cache-Control

2020-03-19 Thread Andy Seaborne
I've been told caching proxies do not normally cache URLs with a query 
string. Sometimes it's configurable, but that only works if you control 
the intermediate. And an intermediate may be remapping from resource to 
query string.


That gets us to Adrian's point about being up-to-date and that the ideal 
cache setup is going to involve application semantics.


Whatever cache control Fuseki has must work for everyone by default. 
Conditional GET would be better, using epochs to note updates (that is 
e-tags). That isn't there ATM, and anyway it assumes a more 
sophisticated client.


Also, knowing about read-only data service could influence the caching 
... when the application use case is tolerant of stale data should the 
backing data be updated out-of-band.


Andy

On 19/03/2020 14:08, Martynas Jusevičius wrote:

Adrian,

indeed, I'm asking because I'm looking at using Varnish as a proxy
cache in front of Fuseki.

However, best practices [1] say:

6.2 Cache policy

Define a cache policy
A cache / expiration policy is the rationale behind cache control for
every resource served by HTTP/1.1 servers.. Content managers should
decide, globally and/or locally, what can or can not be cached, how
long caches should keep the document before trying to get a new
version, etc. These decisions may be made depending on the frequency
at which the documents may be updated.

Allow the Content Manager to set up cache control according to a Cache Policy
The content manager should be able to set the max-age parameter for
any resource served according to a cache policy.

6.3: Caching generated content

Provide actual caching information for content generated dynamically
Most dynamic content generation systems act as if the documents they
generate and serve were "fresh" (i.e as if the resource was last
modified at the date it is served), whether the information itself is,
or not.
This is a harmful lie for caching engines and should be avoided.
Regardless of the technology used, it should be possible to provide
age information by retrieving the actual information from whatever
source is used to generate the dynamic content: file,database, etc.

https://www.w3.org/TR/chips/#gl6

On Thu, Mar 19, 2020 at 2:50 PM Adrian Gschwend  wrote:


On 19.03.20 12:05, Martynas Jusevičius wrote:


Cache-Control: must-revalidate,no-cache,no-store
Pragma: no-cache


YMMV, but my take here is:

- a SPARQL endpoint should always return the latest results
- If caching is needed, it should be transparent for the user, as in the
SPARQL endpoint can have its caching indexes internally
- it is the middleware/developers job to add HTTP caching layers where
appropriate

We do that with our SPARQL proxy for example, the middleware there sets
caching headers that are configurable.

And as usual, cache invalidation is the hard part :)

regards

Adrian


Re: Fuseki's Cache-Control

2020-03-19 Thread Martynas Jusevičius
Adrian,

indeed, I'm asking because I'm looking at using Varnish as a proxy
cache in front of Fuseki.

However, best practices [1] say:

6.2 Cache policy

Define a cache policy
A cache / expiration policy is the rationale behind cache control for
every resource served by HTTP/1.1 servers.. Content managers should
decide, globally and/or locally, what can or can not be cached, how
long caches should keep the document before trying to get a new
version, etc. These decisions may be made depending on the frequency
at which the documents may be updated.

Allow the Content Manager to set up cache control according to a Cache Policy
The content manager should be able to set the max-age parameter for
any resource served according to a cache policy.

6.3: Caching generated content

Provide actual caching information for content generated dynamically
Most dynamic content generation systems act as if the documents they
generate and serve were "fresh" (i.e as if the resource was last
modified at the date it is served), whether the information itself is,
or not.
This is a harmful lie for caching engines and should be avoided.
Regardless of the technology used, it should be possible to provide
age information by retrieving the actual information from whatever
source is used to generate the dynamic content: file,database, etc.

https://www.w3.org/TR/chips/#gl6

On Thu, Mar 19, 2020 at 2:50 PM Adrian Gschwend  wrote:
>
> On 19.03.20 12:05, Martynas Jusevičius wrote:
>
> > Cache-Control: must-revalidate,no-cache,no-store
> > Pragma: no-cache
>
> YMMV, but my take here is:
>
> - a SPARQL endpoint should always return the latest results
> - If caching is needed, it should be transparent for the user, as in the
> SPARQL endpoint can have its caching indexes internally
> - it is the middleware/developers job to add HTTP caching layers where
> appropriate
>
> We do that with our SPARQL proxy for example, the middleware there sets
> caching headers that are configurable.
>
> And as usual, cache invalidation is the hard part :)
>
> regards
>
> Adrian


Re: Fuseki's Cache-Control

2020-03-19 Thread Adrian Gschwend
On 19.03.20 12:05, Martynas Jusevičius wrote:

> Cache-Control: must-revalidate,no-cache,no-store
> Pragma: no-cache

YMMV, but my take here is:

- a SPARQL endpoint should always return the latest results
- If caching is needed, it should be transparent for the user, as in the
SPARQL endpoint can have its caching indexes internally
- it is the middleware/developers job to add HTTP caching layers where
appropriate

We do that with our SPARQL proxy for example, the middleware there sets
caching headers that are configurable.

And as usual, cache invalidation is the hard part :)

regards

Adrian


Fuseki's Cache-Control

2020-03-19 Thread Martynas Jusevičius
Hi,

why is Fuseki sending these headers by default?

Cache-Control: must-revalidate,no-cache,no-store
Pragma: no-cache

They effectively disable HTTP caching, as I understand.

Can they be configured somewhere?


Re: Identify SPARQL query's type

2020-03-19 Thread Marco Neumann
thank you Claus, there is obviously much more in the Jena-extensions
(SmartDataAnalytics / jena-sparql-api).

if you want to contribute your work to the Jena project you will have to
follow up with Andy directly. But I am not sure this is necessary at the
moment since you already provide the code in the public domain conveniently
as an extension / add-on to the Jena project, which I think is great as is
for now. Over time we might want to learn from your work and add aspects to
the overall core Jena project I would think.

It would be great if we could schedule a zoom session in order to give us
an overview of the "SmartDataAnalytics / jena-sparql-api" extensions

could you prepare such a presentation in the coming days?

best,
Marco



On Wed, Mar 18, 2020 at 3:34 PM Claus Stadler <
cstad...@informatik.uni-leipzig.de> wrote:

> Hi,
>
>
> The SparqlStmt API built against jena 3.14.0 is now available on Maven
> Central [1]  in case one want to give it a try (example in [2]) and give
> feedback and whether one thinks it would be a useful contribution to Jena
> directly - and what changes would be necessary if so.
>
>
> 
>org.aksw.jena-sparql-api
>jena-sparql-api-stmt
>3.14.0-1
>
> 
>
>
> [1]
> https://search.maven.org/artifact/org.aksw.jena-sparql-api/jena-sparql-api-stmt/3.14.0-1/jar
>
> [2]
> https://github.com/SmartDataAnalytics/jena-sparql-api/blob/def0d3bdf0f4396fbf1ef0715f9697e9bb255029/jena-sparql-api-stmt/src/test/java/org/aksw/jena_sparql_api/stmt/TestSparqlStmtUtils.java#L54
>
>
> Cheers,
>
> Claus
>
>
>
> On 18.03.20 16:04, Andy Seaborne wrote:
> > Note that parsing the string as a query aborts early as soon as it finds
> an update keyword so the cost of parsing isn't very large.
> >
> > Andy
> >
> > On 18/03/2020 11:58, Marco Neumann wrote:
> >> is there some utility function here in the code base now already to do
> >> this, or do I still need to roll my own here?
> >>
> >> On Tue, Jul 30, 2013 at 4:25 PM Andy Seaborne  wrote:
> >>
> >>> On 30/07/13 10:13, Arthur Vaïsse-Lesteven wrote:
>  Hi,
> 
>  I would like to know if Jena offers a way to detect the type of an
> >>> unknow SPARQL request ?Starting from the query string.
> 
>  At the moment the only way I succed to code it without "basic parsing"
> >>> of the query ( sort of thing I prefer avoid, manually parsing string
> with
> >>> short function often create errors )
>  looks like this :
> 
>  [...]
>   String queryString = "a query string, may be a select or an
> >>> update";
> 
>    try{
>    Query select = QueryFactory.create(queryString);
>    Service.process_select_query(select);//do some work with
> >>> the select
>    }
>    catch(QueryException e){
>    UpdateRequest update =
> UpdateFactory.create(queryString);
>    Service.process_update_query(update);//do some work with
> >>> the update
>    }
>    catch(ProcessException e){
>    //handle this exception
>    }
> 
>  [...]
> 
>  So is it possible ? Or not ?
> >>>
> >>> Not currently.
> >>>
> >>> You could use a regexp to spot the SELECT/CONSTRUCT/DESCRIBE/ASK
> keyword
> >>> coming after BASE/PREFIXES/Comments.
> >>>
> >>>  Andy
> >>>
> >>>
> >>
> --
> Dipl. Inf. Claus Stadler
> Department of Computer Science, University of Leipzig
> Research Group: http://aksw.org/
> Workpage & WebID: http://aksw.org/ClausStadler
> Phone: +49 341 97-32260
>
>

-- 


---
Marco Neumann
KONA


Software Site for Apache Jena OSGI

2020-03-19 Thread Georg Schmidt-Dumont
Good morning,

I am busy setting up an OSGI Bundle which will use Apache Jena. I have
found the OSGI Bundle provided for Apache Jena. Unfortunately I have not
been able to find a Software Site for it. Do you provide a Software Site
for Jena? If so, where can I find it?

kind regards,
Georg Schmidt-Dumont