Re: [Virtuoso-users] Is there a way to send SPARQL queries via curl (over HTTP) to Openlink Virtuoso and obtain the results in JSON format.

2019-07-02 Thread Hugh Williams
Hi Allan,

The are various ways to send curl commands to Virtuoso to perform SPARQL / 
SPARUL queries like:

curl --request POST 'http://localhost:8890/sparql/?' --data-urlencode 
'query=select * from   where {?s ?p ?o} limit 5’

cat query.rq 
select * from   where {?s ?p ?o} limit 5

curl --request POST http://localhost:8890/sparql --data-urlencode 
"format=csv" --data-urlencode qu...@query.rq

curl --request POST 'http://localhost:8890/sparql-auth/?' --digest 
--user dba:dba --data-urlencode 'query=INSERT INTO GRAPH  { 
<1> <2> <3> }'

See also:

http://vos.openlinksw.com/owiki/wiki/VOS/VirtRDFInsert 


Best Regards
Hugh Williams
Professional Services
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 

LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers




> On 2 Jul 2019, at 08:41, Allan Kamau  wrote:
> 
> It seems there is no complete working example on how to do this on the 
> Openlink Virtuoso documentation.
> 
> Below is the solution I have composed with the help of others. I hope this 
> helps other not to spend days coming a solution for this like I have.
> 
> date;time curl -X POST "http://localhost:8890/sparql 
> " -H "Content-Type: 
> application/x-www-form-urlencoded" -H 
> "Accept:application/sparql-results+json" --data-urlencode 'format=json' 
> --data-urlencode 'default-graph-uri=http://www.example.com/ABC 
> ' --data-urlencode 'query=SELECT * FROM 
> > WHERE { ?s ?p ?o } 
> LIMIT 5' \
>  --write-out 
> '%{url_effective};%{http_code};%{time_total};%{time_namelookup};%{time_connect};%{size_download};%{speed_download}\n';date;
> 
> On Mon, Jul 1, 2019 at 6:37 PM Allan Kamau  > wrote:
> I am looking for extensive "sparql-graph-crud" documentation or other 
> mechanism which details how to submit queries to Openlink Virtuoso SPARQL 
> endpoint.
> In short, I would like to learn how to send SPARQL queries (with WHERE 
> clauses) via curl (over HTTP) to Openlink Virtuoso and obtain the results in 
> JSON.
> For example, I would like to submit a query such as "SELECT * FROM 
> http://www.example.com/ABC  where { ?s ?p ?o } 
> LIMIT 100" to Openlink Virtuoso at localhost.
> 
> The example (below) provided on the OpenLink Virtuoso page is not sufficient 
> for my needs.
> 
> curl --verbose --url 
> "http://localhost:8890/sparql-graph-crud?graph-uri=urn:graph:urn:graph:update:test:post
>  
> "
> 
> 
> Allan.
> 
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users

___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Is there a way to send SPARQL queries via curl (over HTTP) to Openlink Virtuoso and obtain the results in JSON format.

2019-07-02 Thread Allan Kamau
It seems there is no complete working example on how to do this on the
Openlink Virtuoso documentation.

Below is the solution I have composed with the help of others. I hope this
helps other not to spend days coming a solution for this like I have.

date;time curl -X POST "http://localhost:8890/sparql; -H "Content-Type:
application/x-www-form-urlencoded" -H
"Accept:application/sparql-results+json" --data-urlencode 'format=json'
--data-urlencode 'default-graph-uri=http://www.example.com/ABC'
--data-urlencode 'query=SELECT * FROM  WHERE {
?s ?p ?o } LIMIT 5' \
 --write-out
'%{url_effective};%{http_code};%{time_total};%{time_namelookup};%{time_connect};%{size_download};%{speed_download}\n';date;

On Mon, Jul 1, 2019 at 6:37 PM Allan Kamau  wrote:

> I am looking for extensive "sparql-graph-crud" documentation or other
> mechanism which details how to submit queries to Openlink Virtuoso SPARQL
> endpoint.
> In short, I would like to learn how to send SPARQL queries (with WHERE
> clauses) via curl (over HTTP) to Openlink Virtuoso and obtain the results
> in JSON.
> For example, I would like to submit a query such as "SELECT * FROM
> http://www.example.com/ABC where { ?s ?p ?o } LIMIT 100" to Openlink
> Virtuoso at localhost.
>
> The example (below) provided on the OpenLink Virtuoso page is not
> sufficient for my needs.
>
> curl --verbose --url "
> http://localhost:8890/sparql-graph-crud?graph-uri=urn:graph:urn:graph:update:test:post
> "
>
>
> Allan.
>
>
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users