You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Enrico Daga <en...@gmail.com> on 2011/03/11 15:15:51 UTC

Do Stanbol have a global SPARQL endpoint?

Hi all,
I know stanbol.enhancer expose a /sparql path to access a sarql
endpoint for the enhancements graph.
It would be useful, expecially for use cases related to RDF access and
management, to provide it within stanbol.
What do you think?

Enrico

-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Alessandro Adamou <ad...@cs.unibo.it>.
On 3/11/11 5:59 PM, Enrico Daga wrote:
> My point is that we need a SPARQL endpoint compliant web
> interface/rest to deal with RDF graphs managed by Stanbol in general,

And possibly one which can be queried by GET methods entirely, both 
plain and from a Web interface form.

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
On 18 March 2011 14:30, Olivier Grisel <ol...@ensta.org> wrote:
> 2011/3/18 Enrico Daga <en...@gmail.com>:
>>
>>> I am sure they would appreciate to review patches should you want to
>>> implement those improvements.
>> Actually it looks like named graphs are supported.
>
> Ok great.
>
>> Thank you for the
>> analysis, I've seen it in the clerezza dev list.
>> About the performance issue (I didn't get this because of a very
>> limited dataset), this is only a problem of the TDB triple store, if I
>> understood correctly, and should not happen with other storage, such
>> sesame, right?
>
> It will happen on any other triple stores since currently the sparql
> engine talks to the store through a set of generic clerezza wrappers
> for the jena classes (TcDataset, JenaGraphAdaptor and so on).
>
> This way you can use the jena sparql engine (ARQ) on a store that does
> not support sparql by going through the clerezza wrapper: however when
> the store is able to perform sparql queries optimization by itself,
> the jena sparql does not see it and uses instead a naive iterator /
> filtering strategy that works everywhere albeit without using any
> indexing optimization provided by the store (and will furthermore put
> a high pressure on the GC with the collection of many clerezza
> transient wrapping objects).
Oh! Now it's clearer to me :)  Thanks!
>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Olivier Grisel <ol...@ensta.org>.
2011/3/18 Enrico Daga <en...@gmail.com>:
>
>> I am sure they would appreciate to review patches should you want to
>> implement those improvements.
> Actually it looks like named graphs are supported.

Ok great.

> Thank you for the
> analysis, I've seen it in the clerezza dev list.
> About the performance issue (I didn't get this because of a very
> limited dataset), this is only a problem of the TDB triple store, if I
> understood correctly, and should not happen with other storage, such
> sesame, right?

It will happen on any other triple stores since currently the sparql
engine talks to the store through a set of generic clerezza wrappers
for the jena classes (TcDataset, JenaGraphAdaptor and so on).

This way you can use the jena sparql engine (ARQ) on a store that does
not support sparql by going through the clerezza wrapper: however when
the store is able to perform sparql queries optimization by itself,
the jena sparql does not see it and uses instead a naive iterator /
filtering strategy that works everywhere albeit without using any
indexing optimization provided by the store (and will furthermore put
a high pressure on the GC with the collection of many clerezza
transient wrapping objects).

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
On 18 March 2011 12:21, Olivier Grisel <ol...@ensta.org> wrote:
> 2011/3/17 Enrico Daga <en...@gmail.com>:
>>>
>>> It seems to me by reading the source code of
>>> TcManager#executeSparqlQuery and JenaSparqlEngine#execute and
>>> TcDataset#getNamedGraph that the clerezza sparql execution should be
>>> able to perform queries accross several graphs. The second argument of
>>> TcManager#executeSparqlQuery is just the default named graph used when
>>> the sparql query does not have FROM clause.
>>>
>>> Please try to build a SPARQL query with an explicit FROM clause
>>> pointing to a graph id used by kres to check this assertion. If it
>>> works, try another query that mixes triples from both graphs
>>> (reengineer and enhancer) using the GRAPH keyword in the body of the
>>> SPARQL query as in
>>> http://www.w3.org/TR/rdf-sparql-query/#restrictByLabel for instance.
>>>
>>> If it does not work, i think we should ask the question on the
>>> clerezza mailing list directly instead.
>> Thank you Olivier. Yes, it looks like it should support this.
>> So I can assume that the answer to my question is YES, Stanbol has a
>> Sparql endpoint which should cover all graphs in the store. So we
>> don't need additional components for that, just use the /sparql path
>> and maybe improve it, if needed.
>> I'll do more test about it.
>
> If your tests don't work as expected, or the performance is too poor,
> this might be the consequence of some design limitations of the
> current TdbTcProvider / JenaSparqlEngine implementation that is overly
> generic. I have discussed this issue with the clerezza developers on
> the best way to improve upon this and the results is available in
> these two issues:
>
> https://issues.apache.org/jira/browse/CLEREZZA-466
> https://issues.apache.org/jira/browse/CLEREZZA-467
>
> I am sure they would appreciate to review patches should you want to
> implement those improvements.
Actually it looks like named graphs are supported. Thank you for the
analysis, I've seen it in the clerezza dev list.
About the performance issue (I didn't get this because of a very
limited dataset), this is only a problem of the TDB triple store, if I
understood correctly, and should not happen with other storage, such
sesame, right?
Ok to implement this for clerezza/tdb.

Enrico
>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Olivier Grisel <ol...@ensta.org>.
2011/3/17 Enrico Daga <en...@gmail.com>:
>>
>> It seems to me by reading the source code of
>> TcManager#executeSparqlQuery and JenaSparqlEngine#execute and
>> TcDataset#getNamedGraph that the clerezza sparql execution should be
>> able to perform queries accross several graphs. The second argument of
>> TcManager#executeSparqlQuery is just the default named graph used when
>> the sparql query does not have FROM clause.
>>
>> Please try to build a SPARQL query with an explicit FROM clause
>> pointing to a graph id used by kres to check this assertion. If it
>> works, try another query that mixes triples from both graphs
>> (reengineer and enhancer) using the GRAPH keyword in the body of the
>> SPARQL query as in
>> http://www.w3.org/TR/rdf-sparql-query/#restrictByLabel for instance.
>>
>> If it does not work, i think we should ask the question on the
>> clerezza mailing list directly instead.
> Thank you Olivier. Yes, it looks like it should support this.
> So I can assume that the answer to my question is YES, Stanbol has a
> Sparql endpoint which should cover all graphs in the store. So we
> don't need additional components for that, just use the /sparql path
> and maybe improve it, if needed.
> I'll do more test about it.

If your tests don't work as expected, or the performance is too poor,
this might be the consequence of some design limitations of the
current TdbTcProvider / JenaSparqlEngine implementation that is overly
generic. I have discussed this issue with the clerezza developers on
the best way to improve upon this and the results is available in
these two issues:

https://issues.apache.org/jira/browse/CLEREZZA-466
https://issues.apache.org/jira/browse/CLEREZZA-467

I am sure they would appreciate to review patches should you want to
implement those improvements.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
On 16 March 2011 18:39, Olivier Grisel <ol...@ensta.org> wrote:
> 2011/3/16 Enrico Daga <en...@gmail.com>:
>> On 16 March 2011 17:22, Olivier Grisel <ol...@ensta.org> wrote:
>>> One should probably extend / adapt the JAX-RS SPARQL resource of the
>>> enhancers to point to other graph ids as needed. One could make a new
>>> JAX-RS resources such as /graph/{graphId}/sparql to build dynamically
>>> sparql endpoint for all the clerezza graphs registered in stanbol for
>>> instance:
>>>
>>> In the class SparqlQueryResource, instead of the hard-coded:
>>>
>>>        Object result = tcManager.executeSparqlQuery(query,
>>>                store.getEnhancementGraph());
>>>
>>> One could have something like:
>>>
>>>        Object result = tcManager.executeSparqlQuery(query,
>>>                tcManager.getGraph(new UriRef("urn:graph:" + graphId)));
>> But what happens if I want to query multiple graphs?
>> I need for instance to query the enhancement graph and the result of
>> my /kres/reengineer process (another graph) together. This would open
>> to a variety of use cases, and in general this is how sparql endpoints
>> work.
>
> It seems to me by reading the source code of
> TcManager#executeSparqlQuery and JenaSparqlEngine#execute and
> TcDataset#getNamedGraph that the clerezza sparql execution should be
> able to perform queries accross several graphs. The second argument of
> TcManager#executeSparqlQuery is just the default named graph used when
> the sparql query does not have FROM clause.
>
> Please try to build a SPARQL query with an explicit FROM clause
> pointing to a graph id used by kres to check this assertion. If it
> works, try another query that mixes triples from both graphs
> (reengineer and enhancer) using the GRAPH keyword in the body of the
> SPARQL query as in
> http://www.w3.org/TR/rdf-sparql-query/#restrictByLabel for instance.
>
> If it does not work, i think we should ask the question on the
> clerezza mailing list directly instead.
Thank you Olivier. Yes, it looks like it should support this.
So I can assume that the answer to my question is YES, Stanbol has a
Sparql endpoint which should cover all graphs in the store. So we
don't need additional components for that, just use the /sparql path
and maybe improve it, if needed.
I'll do more test about it.

Thank you
Enrico

>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Olivier Grisel <ol...@ensta.org>.
2011/3/16 Enrico Daga <en...@gmail.com>:
> On 16 March 2011 17:22, Olivier Grisel <ol...@ensta.org> wrote:
>> One should probably extend / adapt the JAX-RS SPARQL resource of the
>> enhancers to point to other graph ids as needed. One could make a new
>> JAX-RS resources such as /graph/{graphId}/sparql to build dynamically
>> sparql endpoint for all the clerezza graphs registered in stanbol for
>> instance:
>>
>> In the class SparqlQueryResource, instead of the hard-coded:
>>
>>        Object result = tcManager.executeSparqlQuery(query,
>>                store.getEnhancementGraph());
>>
>> One could have something like:
>>
>>        Object result = tcManager.executeSparqlQuery(query,
>>                tcManager.getGraph(new UriRef("urn:graph:" + graphId)));
> But what happens if I want to query multiple graphs?
> I need for instance to query the enhancement graph and the result of
> my /kres/reengineer process (another graph) together. This would open
> to a variety of use cases, and in general this is how sparql endpoints
> work.

It seems to me by reading the source code of
TcManager#executeSparqlQuery and JenaSparqlEngine#execute and
TcDataset#getNamedGraph that the clerezza sparql execution should be
able to perform queries accross several graphs. The second argument of
TcManager#executeSparqlQuery is just the default named graph used when
the sparql query does not have FROM clause.

Please try to build a SPARQL query with an explicit FROM clause
pointing to a graph id used by kres to check this assertion. If it
works, try another query that mixes triples from both graphs
(reengineer and enhancer) using the GRAPH keyword in the body of the
SPARQL query as in
http://www.w3.org/TR/rdf-sparql-query/#restrictByLabel for instance.

If it does not work, i think we should ask the question on the
clerezza mailing list directly instead.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
On 16 March 2011 17:22, Olivier Grisel <ol...@ensta.org> wrote:
> One should probably extend / adapt the JAX-RS SPARQL resource of the
> enhancers to point to other graph ids as needed. One could make a new
> JAX-RS resources such as /graph/{graphId}/sparql to build dynamically
> sparql endpoint for all the clerezza graphs registered in stanbol for
> instance:
>
> In the class SparqlQueryResource, instead of the hard-coded:
>
>        Object result = tcManager.executeSparqlQuery(query,
>                store.getEnhancementGraph());
>
> One could have something like:
>
>        Object result = tcManager.executeSparqlQuery(query,
>                tcManager.getGraph(new UriRef("urn:graph:" + graphId)));
But what happens if I want to query multiple graphs?
I need for instance to query the enhancement graph and the result of
my /kres/reengineer process (another graph) together. This would open
to a variety of use cases, and in general this is how sparql endpoints
work.

Enrico

>
> --
> Olivier
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Olivier Grisel <ol...@ensta.org>.
One should probably extend / adapt the JAX-RS SPARQL resource of the
enhancers to point to other graph ids as needed. One could make a new
JAX-RS resources such as /graph/{graphId}/sparql to build dynamically
sparql endpoint for all the clerezza graphs registered in stanbol for
instance:

In the class SparqlQueryResource, instead of the hard-coded:

        Object result = tcManager.executeSparqlQuery(query,
                store.getEnhancementGraph());

One could have something like:

        Object result = tcManager.executeSparqlQuery(query,
                tcManager.getGraph(new UriRef("urn:graph:" + graphId)));

-- 
Olivier

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
If you, guys, agree I would add this to Jira.

Enrico

On 14 March 2011 14:56, Enrico Daga <en...@gmail.com> wrote:
> Hi Fabian,
> I add stanbol-dev because I guess you missed to add it to the
> recipient in your reply ;)
>
> On 13 March 2011 18:49, Fabian Christ <ch...@googlemail.com> wrote:
>> Hi,
>>
>> I just would like to understand this.
>>
>> 2011/3/11 Enrico Daga <en...@gmail.com>:
>>> AFAIK, the interface provided at /sparql allows queries for the
>>> enhancer graph only at the moment.
>>> My point is that we need a SPARQL endpoint compliant web
>>> interface/rest to deal with RDF graphs managed by Stanbol in general,
>>> because this is the standard way to deal with RDF by remote clients.
>>
>> So at the moment you can query Stanbol enhancements by using SPARQL.
>> But you can not query other graphs?
> Exactly
>> Which other graphs do you mean?
>> Would it be possible to make other graphs queryable just by using the
>> same mechanism that we use for the enhancement? I guess SPARQL queries
>> are supported by Clerezza?
> KReS and the Persistencestore both uses the Clerezza TCManager object
> to store/retrieve ontologies.
> In this context Ontologies are a special kind of RDF graphs, compliant
> to the OWL specification. At the moment there is no way to query such
> knowledge with SPARQL.
> Another use case is related to the KReS reengineering components,
> which both can store the output in RDF graphs, which at the moment
> cannot be queried/retrieve from Stanbol.
> So there is a missing step in Stanbol wrt knowledge access.
> Additionally, the kres/rules module can operate on RDF graphs, so
> creating new graphs or modifiyng existing ones. This is another case
> where we need SPARQL querying capabilities.
> I think this is possible by simply setup a JAX-RS class which bind a
> Jena SPARQL processor to the TCManager instance.
>
> Bests
> Enrico
>>
>> Best,
>>  - Fabian
>>
>
>
>
> --
> Enrico Daga
>
> --
> http://www.enridaga.net
> skype: enri-pan
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
Hi Fabian,
I add stanbol-dev because I guess you missed to add it to the
recipient in your reply ;)

On 13 March 2011 18:49, Fabian Christ <ch...@googlemail.com> wrote:
> Hi,
>
> I just would like to understand this.
>
> 2011/3/11 Enrico Daga <en...@gmail.com>:
>> AFAIK, the interface provided at /sparql allows queries for the
>> enhancer graph only at the moment.
>> My point is that we need a SPARQL endpoint compliant web
>> interface/rest to deal with RDF graphs managed by Stanbol in general,
>> because this is the standard way to deal with RDF by remote clients.
>
> So at the moment you can query Stanbol enhancements by using SPARQL.
> But you can not query other graphs?
Exactly
> Which other graphs do you mean?
> Would it be possible to make other graphs queryable just by using the
> same mechanism that we use for the enhancement? I guess SPARQL queries
> are supported by Clerezza?
KReS and the Persistencestore both uses the Clerezza TCManager object
to store/retrieve ontologies.
In this context Ontologies are a special kind of RDF graphs, compliant
to the OWL specification. At the moment there is no way to query such
knowledge with SPARQL.
Another use case is related to the KReS reengineering components,
which both can store the output in RDF graphs, which at the moment
cannot be queried/retrieve from Stanbol.
So there is a missing step in Stanbol wrt knowledge access.
Additionally, the kres/rules module can operate on RDF graphs, so
creating new graphs or modifiyng existing ones. This is another case
where we need SPARQL querying capabilities.
I think this is possible by simply setup a JAX-RS class which bind a
Jena SPARQL processor to the TCManager instance.

Bests
Enrico
>
> Best,
>  - Fabian
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Enrico Daga <en...@gmail.com>.
Hi Suat, Fabian, all,


On 11 March 2011 17:10, Suat Gonul <su...@gmail.com> wrote:
> Hi Fabian,
>
> It is provided by the bundle at [1]. Currently, main entry point is
> accessible on /persistencestore/ontologies after the launcher of
> persistencestore is run.
>
> Suat
>
> [1] http://bit.ly/faVdMD
>
>
> Fabian Christ wrote:
>>
>> Hi Suat,
>>
>> which web interface do you mean here?
>>
>> - Fabian
>>
>> 2011/3/11 Suat Gonul <su...@gmail.com>:
>>
>>>
>>> Hi Enrico,
>>>
>>> We are planning to provide a sparql endpoint in [1] for stored ontologies
>>> and then update web interface accordingly. What do you think?
Actually the clerezza mediator is used to access the graph store (can
be sesame, others).
We can do sparql queries on it using jena, since it is supported by clerezza.
What we do not have is a sparql endpoint, which means something that
implements the sparql protocol (and, of course, a web interface for
it).
AFAIK, the interface provided at /sparql allows queries for the
enhancer graph only at the moment.
My point is that we need a SPARQL endpoint compliant web
interface/rest to deal with RDF graphs managed by Stanbol in general,
because this is the standard way to deal with RDF by remote clients.
I know use cases related to ontologies, rules and reengineering would
benefit from that, since with a SPARQL query you can easily test the
result of a reasoning process, for instance.
I was expecting this to be provided by clerezza (on top of jena), but
I did not found it as ready to plug osgi bundle with jax-rs service
configured (I did not asked in the list... anyway).
I am not sure that extending that interface would be the best solution.
Maybe we could wrap the jena sparql engine (or the [2] of clerezza,
better...) on a jax-rs service pointing to /sparql, and, yes, a web
interface for it.

[1] http://www.w3.org/TR/rdf-sparql-protocol/
[2] http://svn.apache.org/repos/asf/incubator/clerezza/trunk/parent/rdf.jena.sparql/

>>>
>>> Best,
>>> Suat
>>>
>>> [1] http://bit.ly/gxADMP
>>>
>>> Enrico Daga wrote:
>>>
>>>>
>>>> Hi all,
>>>> I know stanbol.enhancer expose a /sparql path to access a sarql
>>>> endpoint for the enhancements graph.
>>>> It would be useful, expecially for use cases related to RDF access and
>>>> management, to provide it within stanbol.
>>>> What do you think?
>>>>
>>>> Enrico
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>



-- 
Enrico Daga

--
http://www.enridaga.net
skype: enri-pan

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Suat Gonul <su...@gmail.com>.
Hi Fabian,

It is provided by the bundle at [1]. Currently, main entry point is 
accessible on /persistencestore/ontologies after the launcher of 
persistencestore is run.

Suat

[1] http://bit.ly/faVdMD


Fabian Christ wrote:
> Hi Suat,
>
> which web interface do you mean here?
>
> - Fabian
>
> 2011/3/11 Suat Gonul <su...@gmail.com>:
>   
>> Hi Enrico,
>>
>> We are planning to provide a sparql endpoint in [1] for stored ontologies
>> and then update web interface accordingly. What do you think?
>>
>> Best,
>> Suat
>>
>> [1] http://bit.ly/gxADMP
>>
>> Enrico Daga wrote:
>>     
>>> Hi all,
>>> I know stanbol.enhancer expose a /sparql path to access a sarql
>>> endpoint for the enhancements graph.
>>> It would be useful, expecially for use cases related to RDF access and
>>> management, to provide it within stanbol.
>>> What do you think?
>>>
>>> Enrico
>>>
>>>
>>>       
>>     
>
>
>
>   


Re: Do Stanbol have a global SPARQL endpoint?

Posted by Fabian Christ <ch...@googlemail.com>.
Hi Suat,

which web interface do you mean here?

- Fabian

2011/3/11 Suat Gonul <su...@gmail.com>:
> Hi Enrico,
>
> We are planning to provide a sparql endpoint in [1] for stored ontologies
> and then update web interface accordingly. What do you think?
>
> Best,
> Suat
>
> [1] http://bit.ly/gxADMP
>
> Enrico Daga wrote:
>>
>> Hi all,
>> I know stanbol.enhancer expose a /sparql path to access a sarql
>> endpoint for the enhancements graph.
>> It would be useful, expecially for use cases related to RDF access and
>> management, to provide it within stanbol.
>> What do you think?
>>
>> Enrico
>>
>>
>
>



-- 
Fabian

Re: Do Stanbol have a global SPARQL endpoint?

Posted by Suat Gonul <su...@gmail.com>.
Hi Enrico,

We are planning to provide a sparql endpoint in [1] for stored 
ontologies and then update web interface accordingly. What do you think?

Best,
Suat

[1] http://bit.ly/gxADMP

Enrico Daga wrote:
> Hi all,
> I know stanbol.enhancer expose a /sparql path to access a sarql
> endpoint for the enhancements graph.
> It would be useful, expecially for use cases related to RDF access and
> management, to provide it within stanbol.
> What do you think?
>
> Enrico
>
>