AtomGraph / LinkedDataHub

The low-code Knowledge Graph application platform. Apache license.
https://atomgraph.github.io/LinkedDataHub/
Apache License 2.0
483 stars 120 forks source link

Missing CSV/TSV writers for SPARQL results #176

Closed namedgraph closed 1 year ago

namedgraph commented 1 year ago

CSV fails:

curl 'https://linkeddatahub.com/demo/northwind-traders/sparql?query=select%20*%0A%7B%0A%3Fs%20%3Fp%20%3Fo%0A%7D' -H 'User-Agent: python urllib/3.3.0' -H "Accept: text/csv"
<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Internal Server Error</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><hr class="line" /><h3>Apache Tomcat/9.0.59</h3></body></html>%    

TSV fails:

curl 'https://linkeddatahub.com/demo/northwind-traders/sparql?query=select%20*%0A%7B%0A%3Fs%20%3Fp%20%3Fo%0A%7D' -H 'User-Agent: python urllib/3.3.0' -H "Accept: text/tab-separated-values"
<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Internal Server Error</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><hr class="line" /><h3>Apache Tomcat/9.0.59</h3></body></html>% 

XML works:

curl 'https://linkeddatahub.com/demo/northwind-traders/sparql?query=select%20*%0A%7B%0A%3Fs%20%3Fp%20%3Fo%0A%7D' -H 'User-Agent: python urllib/3.3.0' -H "Accept: application/sparql-results+xml"
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="s"/>
    <variable name="p"/>
    <variable name="o"/>
  </head>
  <results>
  </results>
</sparql>
namedgraph commented 1 year ago

However it works on KGDN which runs a newer LDH version 🤷‍♂️

curl 'https://kgdev.net/sparql?query=select%20*%0A%7B%0A%3Fs%20%3Fp%20%3Fo%0A%7D' -H 'User-Agent: python urllib/3.3.0' -H "Accept: text/csv"