this approach relies on the fx:command
property to transform the parquet file into csv
justin@X~/github/sparql.anything$ bash -c "python3 -c \"import pandas as pd ; pd.read_parquet(\\\"some.parquet\\\").to_csv(\\\"/dev/stdout\\\")\""
,name,age
0,bob,45
1,fred,3
then running the query below like this:
curl --silent 'http://localhost:3000/sparql.anything' \
--header "Accept: text/csv" \
--data-urlencode 'query=
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
SELECT *
WHERE
{ SERVICE <x-sparql-anything:>
{ fx:properties
fx:command "python3 -c \"import pandas as pd ; pd.read_parquet(\\\"some.parquet\\\").to_csv(\\\"/dev/stdout\\\")\"" ;
fx:media-type "text/csv" ;
fx:csv.headers "true" .
?s ?p ?o
}
}
'
produces:
NOTE:
you'll have to wait until the next release of sparql anything (the release after 0.8.2) to use this
OR
you'll have to run the docker container after this gets fixed.