Discussion:
Fuseki / ARQ DESCRIBE query to include ?s ?p <incoming resource>
Beetz, J.
2017-03-03 10:13:12 UTC
Permalink
Dear community,

I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/ frontend to allow dereferencing/content-negotiation/browser-navigation of a vocabulary served by Fuseki 2.4.1 .
As per the SPARQL standard, the default behavior of DESCRIBE queries that are sent by the frontend to Fuseki is left to the implementation. Fusekis default behavior is to send back the graph containing all triples where <incoming resource> is the subject (<incoming resource> ?p ?o). I would also like to include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).

From the list archive I have seen that I can probably implement my own execDescribe() similar to this thread from some time ago:
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak34g+state:results

I wonder whether there is another (easier) way through a configuration setting or similar which allows me to achieve this.

Thank you very much in advance for your help

Jakob

_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247
A. Soroka
2017-03-03 14:22:23 UTC
Permalink
I'm not sure what you mean by such triples as "(?s ?p <incoming resource> and probably (?s <incoming resource> ?o). "

Can you give some concrete examples?

---
A. Soroka
The University of Virginia Library
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/ frontend to allow dereferencing/content-negotiation/browser-navigation of a vocabulary served by Fuseki 2.4.1 .
As per the SPARQL standard, the default behavior of DESCRIBE queries that are sent by the frontend to Fuseki is left to the implementation. Fusekis default behavior is to send back the graph containing all triples where <incoming resource> is the subject (<incoming resource> ?p ?o). I would also like to include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak34g+state:results
I wonder whether there is another (easier) way through a configuration setting or similar which allows me to achieve this.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
Beetz, J.
2017-03-03 15:14:07 UTC
Permalink
Dear A. Soroka,
Thank you for the quick reply.
Post by A. Soroka
I'm not sure what you mean by such triples as "(?s ?p <incoming resource> and
probably (?s <incoming resource> ?o). "
Can you give some concrete examples?
Suppose I have a graph:

@prefix foo: <http://foo.bar/vocab/foo#>

foo:Foo a owl:Class ;
rdfs:label "The Foo concept"@en .

foo:Bar a owl:Class ;
rdfs:label "The Bar concept"@en ;
foo:has_part foo:Foo .

foo:has_part a owl:ObjectProperty ;

When doing a standard

DESCRIBE <http://foo.bar/vocab/foo#Foo>

on the my Fuseki SPARQL endpoint, I get the answer

foo:Foo rdf:type owl:Class .
foo:Foo rdfs:label "The Foo concept"@en .

but not

foo:Bar foo:has_part foo:Foo .

since only triples are returned where the <http://foo.bar/vocab/foo#Foo> resource is the subject (<res> ?p ?o) not where it is the object (?s ?p <res>) or predicate (?s <res> ?o)

I could navigate to foo:Bar by inserting foo:part_of as a reverse relationship to foo:has_part but do would like to avoid these additional triples in the 70k triple data set.

I hope my question became somewhat clearer.

Thanks
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
Post by A. Soroka
---
A. Soroka
The University of Virginia Library
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/
frontend to allow dereferencing/content-negotiation/browser-navigation of a
vocabulary served by Fuseki 2.4.1 .
Post by Beetz, J.
As per the SPARQL standard, the default behavior of DESCRIBE queries that are
sent by the frontend to Fuseki is left to the implementation. Fusekis default
behavior is to send back the graph containing all triples where <incoming
resource> is the subject (<incoming resource> ?p ?o). I would also like to
include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).
Post by Beetz, J.
From the list archive I have seen that I can probably implement my own
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3
Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak3
4g+state:results
Post by Beetz, J.
I wonder whether there is another (easier) way through a configuration
setting or similar which allows me to achieve this.
Post by Beetz, J.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
Martynas Jusevičius
2017-03-03 14:37:36 UTC
Permalink
Isn't Fuseki already doing the same as Pubby?
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/ frontend to allow dereferencing/content-negotiation/browser-navigation of a vocabulary served by Fuseki 2.4.1 .
As per the SPARQL standard, the default behavior of DESCRIBE queries that are sent by the frontend to Fuseki is left to the implementation. Fusekis default behavior is to send back the graph containing all triples where <incoming resource> is the subject (<incoming resource> ?p ?o). I would also like to include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak34g+state:results
I wonder whether there is another (easier) way through a configuration setting or similar which allows me to achieve this.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
A. Soroka
2017-03-03 14:39:28 UTC
Permalink
No, Pubby [1] is designed to present a simple "Linked Data" representation of resources the data for which are recorded in some SPARQL-equipped service (e.g. Fuseki).

You set up Pubby aimed at your SPARQL endpoint, and then when people make requests for a particular resource from Pubby, it gives them the results of a DESCRIBE query on that resource.

---
A. Soroka
The University of Virginia Library

[1]
Post by Martynas Jusevičius
Isn't Fuseki already doing the same as Pubby?
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/ frontend to allow dereferencing/content-negotiation/browser-navigation of a vocabulary served by Fuseki 2.4.1 .
As per the SPARQL standard, the default behavior of DESCRIBE queries that are sent by the frontend to Fuseki is left to the implementation. Fusekis default behavior is to send back the graph containing all triples where <incoming resource> is the subject (<incoming resource> ?p ?o). I would also like to include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak34g+state:results
I wonder whether there is another (easier) way through a configuration setting or similar which allows me to achieve this.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
Andy Seaborne
2017-03-04 18:59:33 UTC
Permalink
Minor clarification:

Fuseki's default behaviour is the calculate the blank node closure based
on the "subject (<incoming resource> ?p ?o)".


There's a registry DescribeHandlerRegistry and a context key for setting
it (ARQConstants.registryDescribeHandlers).

The registry keeps a list of DescribeHandlerFactory and calls each one
on the list.

Adding to that list or setting per query is doable but it's Java - in
Fuseki from just configuring, it's not doable.

Adding a context setting to set the DescribeHandle policy by name would
achieve that.

Andy

e.g.
https://gist.github.com/shellac/1313924
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/ frontend to allow dereferencing/content-negotiation/browser-navigation of a vocabulary served by Fuseki 2.4.1 .
As per the SPARQL standard, the default behavior of DESCRIBE queries that are sent by the frontend to Fuseki is left to the implementation. Fusekis default behavior is to send back the graph containing all triples where <incoming resource> is the subject (<incoming resource> ?p ?o). I would also like to include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak34g+state:results
I wonder whether there is another (easier) way through a configuration setting or similar which allows me to achieve this.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
Beetz, J.
2017-03-06 12:19:35 UTC
Permalink
Hi Andy,

Thanks a lot, this are exactly the pointers I had whished for!

I will give this a try.

Thank you for your quick and helpful answer,
Jakob

_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
-----Original Message-----
Sent: zaterdag 4 maart 2017 20:00
Subject: Re: Fuseki / ARQ DESCRIBE query to include ?s ?p <incoming resource>
Fuseki's default behaviour is the calculate the blank node closure based
on the "subject (<incoming resource> ?p ?o)".
There's a registry DescribeHandlerRegistry and a context key for setting
it (ARQConstants.registryDescribeHandlers).
The registry keeps a list of DescribeHandlerFactory and calls each one
on the list.
Adding to that list or setting per query is doable but it's Java - in
Fuseki from just configuring, it's not doable.
Adding a context setting to set the DescribeHandle policy by name would
achieve that.
Andy
e.g.
https://gist.github.com/shellac/1313924
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.uni-mannheim.de/pubby/
frontend to allow dereferencing/content-negotiation/browser-navigation of a
vocabulary served by Fuseki 2.4.1 .
Post by Beetz, J.
As per the SPARQL standard, the default behavior of DESCRIBE queries that are
sent by the frontend to Fuseki is left to the implementation. Fusekis default
behavior is to send back the graph containing all triples where <incoming
resource> is the subject (<incoming resource> ?p ?o). I would also like to
include (?s ?p <incoming resource> and probably (?s <incoming resource> ?o).
Post by Beetz, J.
From the list archive I have seen that I can probably implement my own
http://jena.markmail.org/message/5thzze4xhqhak34g?q=describe+query+%3Fs+%3Fp+%3
Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+page:2+mid:5thzze4xhqhak3
4g+state:results
Post by Beetz, J.
I wonder whether there is another (easier) way through a configuration
setting or similar which allows me to achieve this.
Post by Beetz, J.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288
Conal Tuohy
2017-03-06 12:34:53 UTC
Permalink
Jakob, you may also be able to tweak Pubby to use a SPARQL CONSTRUCT query
instead of DESCRIBE, in which case you can implement your Linked Data pages
in SPARQL. Note that you may find that listing all the triples in which a
given resource appears as the object or predicate will yield a very large
number of triples. You may find you need to implement some kind of
pagination mechanism.
Post by Beetz, J.
Hi Andy,
Thanks a lot, this are exactly the pointers I had whished for!
I will give this a try.
Thank you for your quick and helpful answer,
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
-----Original Message-----
Sent: zaterdag 4 maart 2017 20:00
Subject: Re: Fuseki / ARQ DESCRIBE query to include ?s ?p <incoming
resource>
Fuseki's default behaviour is the calculate the blank node closure based
on the "subject (<incoming resource> ?p ?o)".
There's a registry DescribeHandlerRegistry and a context key for setting
it (ARQConstants.registryDescribeHandlers).
The registry keeps a list of DescribeHandlerFactory and calls each one
on the list.
Adding to that list or setting per query is doable but it's Java - in
Fuseki from just configuring, it's not doable.
Adding a context setting to set the DescribeHandle policy by name would
achieve that.
Andy
e.g.
https://gist.github.com/shellac/1313924
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.
uni-mannheim.de/pubby/
frontend to allow dereferencing/content-negotiation/browser-navigation
of a
vocabulary served by Fuseki 2.4.1 .
Post by Beetz, J.
As per the SPARQL standard, the default behavior of DESCRIBE queries
that are
sent by the frontend to Fuseki is left to the implementation. Fusekis
default
behavior is to send back the graph containing all triples where <incoming
resource> is the subject (<incoming resource> ?p ?o). I would also like
to
include (?s ?p <incoming resource> and probably (?s <incoming resource>
?o).
Post by Beetz, J.
From the list archive I have seen that I can probably implement my own
http://jena.markmail.org/message/5thzze4xhqhak34g?q=
describe+query+%3Fs+%3Fp+%3
Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+
page:2+mid:5thzze4xhqhak3
4g+state:results
Post by Beetz, J.
I wonder whether there is another (easier) way through a configuration
setting or similar which allows me to achieve this.
Post by Beetz, J.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
--
Conal Tuohy
http://conaltuohy.com/
@conal_tuohy
+61-466-324297
Beetz, J.
2017-03-06 12:43:14 UTC
Permalink
Conal, thanks!

This might even be the better option, also since the "Client" (Pubby in this case) is much more lightweight...

While browsing the pubby source, I think I found an even easier way in
https://github.com/cygri/pubby/blob/f819ac1a8e1f6ba5a2434347cc6510300d95f375/doc/config.ttl

# Queries for describing a resource denoted by "?__this__".
# Multiple queries can be specified, results will be merged.
# conf:resourceDescriptionQuery "CONSTRUCT { ?__this__ ?p ?o } WHERE { ?__this__ ?p ?o }";
# conf:resourceDescriptionQuery "CONSTRUCT { ?s ?p ?__this__ } WHERE { ?s ?p ?__this__ }";

This very much looks as if it were exactly what I've been looking in the first place... just at the wrong end of the tool chain.
I'll give this a try and get back to the list in case someone in future has similar issues (even though it becomes somewhat off-topic and non ARQ/Fuseki/Jena specific)....

Thanks again for the help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
-----Original Message-----
Sent: maandag 6 maart 2017 13:35
To: Jena Users
Subject: Re: Fuseki / ARQ DESCRIBE query to include ?s ?p <incoming resource>
Jakob, you may also be able to tweak Pubby to use a SPARQL CONSTRUCT query
instead of DESCRIBE, in which case you can implement your Linked Data pages
in SPARQL. Note that you may find that listing all the triples in which a
given resource appears as the object or predicate will yield a very large
number of triples. You may find you need to implement some kind of
pagination mechanism.
Post by Beetz, J.
Hi Andy,
Thanks a lot, this are exactly the pointers I had whished for!
I will give this a try.
Thank you for your quick and helpful answer,
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
-----Original Message-----
Sent: zaterdag 4 maart 2017 20:00
Subject: Re: Fuseki / ARQ DESCRIBE query to include ?s ?p <incoming
resource>
Fuseki's default behaviour is the calculate the blank node closure based
on the "subject (<incoming resource> ?p ?o)".
There's a registry DescribeHandlerRegistry and a context key for setting
it (ARQConstants.registryDescribeHandlers).
The registry keeps a list of DescribeHandlerFactory and calls each one
on the list.
Adding to that list or setting per query is doable but it's Java - in
Fuseki from just configuring, it's not doable.
Adding a context setting to set the DescribeHandle policy by name would
achieve that.
Andy
e.g.
https://gist.github.com/shellac/1313924
Post by Beetz, J.
Dear community,
I have set up a Pubby http://wifo5-03.informatik.
uni-mannheim.de/pubby/
frontend to allow dereferencing/content-negotiation/browser-navigation
of a
vocabulary served by Fuseki 2.4.1 .
Post by Beetz, J.
As per the SPARQL standard, the default behavior of DESCRIBE queries
that are
sent by the frontend to Fuseki is left to the implementation. Fusekis
default
behavior is to send back the graph containing all triples where <incoming
resource> is the subject (<incoming resource> ?p ?o). I would also like
to
include (?s ?p <incoming resource> and probably (?s <incoming resource>
?o).
Post by Beetz, J.
From the list archive I have seen that I can probably implement my own
http://jena.markmail.org/message/5thzze4xhqhak34g?q=
describe+query+%3Fs+%3Fp+%3
Fo&page=2#query:describe%20query%20%3Fs%20%3Fp%20%3Fo+
page:2+mid:5thzze4xhqhak3
4g+state:results
Post by Beetz, J.
I wonder whether there is another (easier) way through a configuration
setting or similar which allows me to achieve this.
Post by Beetz, J.
Thank you very much in advance for your help
Jakob
_______________________________________________________________
Dr. Jakob Beetz - Assistant Professor
Information Systems in the Built Environment (ISBE) Group
Department of the Built Environment | Bouwkunde
Eindhoven University of Technology, The Netherlands
phone: +31 (0)40 247 2288 on-campus location: VRT 9.J06
--
Conal Tuohy
http://conaltuohy.com/
@conal_tuohy
Loading...