Demo: Fine-tunning ChatGPT for Natural Language -> SPARQL Query Generation & Execution

All,

Another demo showcasing how SPARQL query execution, courtesy of solution 
page links, brings powerful query execution to ChatGPT .


  Generating clickable DBpedia SPARQL Query Solution Page Link using
  Bing+ChatGPT Service

Here’s a transcript for a variant of this exercise using the Bing + GPT 
service.

    Q: Given the following template.

What is the county of |<A>;select ?a where { <A> 
<http://dbpedia.org/ontology/county> ?a };select ?a where { ?a 
<http://dbpedia.org/ontology/county> [] . ?a a 
<http://dbpedia.org/ontology/Place> }| Find the country of London using 
SPARQL.

A:

|PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: 
<http://dbpedia.org/resource/> SELECT ?country WHERE { dbr:London 
dbo:country ?country. } |

    Q: Can you generate a clickable sparql url for that query? Just say
    yes or no.

A:

Here is the clickable link for the SPARQL query:

https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+dbr%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0A%0D%0ASELECT+%3Fcountry+WHERE+%7B%0D%0A++dbr%3ALondon+dbo%3Acountry+%3Fcountry.%0D%0A%7D&format=text/html&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on 
<https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+dbr%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0A%0D%0ASELECT+%3Fcountry+WHERE+%7B%0D%0A++dbr%3ALondon+dbo%3Acountry+%3Fcountry.%0D%0A%7D&format=text/html&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on>

Bing Answer Link <https://sl.bing.net/4TuYfD86QC> .

    Q: That isn’t a clickable link since I need to copy and paste it to
    a browser for resolution.

A:

I apologize for the confusion. Here is the clickable link for the SPARQL 
query:

https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+dbr%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0A%0D%0ASELECT+%3Fcountry+WHERE+%7B%0D%0A++dbr%3ALondon+dbo%3Acountry+%3Fcountry.%0D%0A%7D&format=text/html&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on 
<https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+dbr%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0A%0D%0ASELECT+%3Fcountry+WHERE+%7B%0D%0A++dbr%3ALondon+dbo%3Acountry+%3Fcountry.%0D%0A%7D&format=text/html&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on>

Bing Anwser Link <https://sl.bing.net/ezgIQA1ALN6>

    Q: Yes, that’s much better. Use “SPARQL Query Response” as the label
    applied to the clikcable link.

A:

Here is the clickable link for the SPARQL query:

SPARQL Query Response 
<https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+dbr%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0A%0D%0ASELECT+%3Fcountry+WHERE+%7B%0D%0A++dbr%3ALondon+dbo%3Acountry+%3Fcountry.%0D%0A%7D&format=text/html&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on>

Bing Answer Link <https://sl.bing.net/hHOawrSUCCy>

Note:

I also incorporated some Bing Answer links, but these (at the current 
time) only resolve properly if you are using Edge.

-- 
Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Home Page:http://www.openlinksw.com
Community Support:https://community.openlinksw.com
Weblogs (Blogs):
Company Blog:https://medium.com/openlink-software-blog
Virtuoso Blog:https://medium.com/virtuoso-blog
Data Access Drivers Blog:https://medium.com/openlink-odbc-jdbc-ado-net-data-access-drivers

Personal Weblogs (Blogs):
Medium Blog:https://medium.com/@kidehen
Legacy Blogs:http://www.openlinksw.com/blog/~kidehen/
               http://kidehen.blogspot.com

Profile Pages:
Pinterest:https://www.pinterest.com/kidehen/
Quora:https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter:https://twitter.com/kidehen
Google+:https://plus.google.com/+KingsleyIdehen/about
LinkedIn:http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal:http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
         :http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this

Received on Tuesday, 9 May 2023 18:03:55 UTC