Dear all,
I use heredoc in a bash script to run sparql queries and it works fine except when I use the character “+” inside of a heredoc block. It seems that the character “+” is removed by the exec parameter before to run the query. The bash script is this:
#!/bin/bash
/usr/local/virtuoso-opensource/bin/isql-v 1111 dba dba <<'EOF' exec="
select ?s ?t year(?d) as ?enroll_year count(distinct ?tst) as ?nb_test
where {?e sides:correspond_to_student ?s.
?e sides:correspond_to_training ?t.
?e sides:has_for_registration_date ?d.
?ata sides:done_during ?tst.
?ata sides:is_part_of ?a.
?a sides:done_by ?s.
?a sides:has_for_timestamp ?ds.
filter(year(?ds)=year(?d)+1).
}
group by ?s ?e ?t year(?d)
order by ?s ?t
" > /download/output.txt
EOF
When I run the bash script, the query
select ?s ?t year(?d) as ?enroll_year count(distinct ?tst) as ?nb_test
where {?e sides:correspond_to_student ?s.
?e sides:correspond_to_training ?t.
?e sides:has_for_registration_date ?d.
?ata sides:done_during ?tst.
?ata sides:is_part_of ?a.
?a sides:done_by ?s.
?a sides:has_for_timestamp ?ds.
filter(year(?ds)=year(?d)+1).
}
group by ?s ?e ?t year(?d)
order by ?s ?t
becomes
select ?s ?t year(?d) as ?enroll_year count(distinct ?tst) as ?nb_test
where {?e sides:correspond_to_student ?s.
?e sides:correspond_to_training ?t.
?e sides:has_for_registration_date ?d.
?ata sides:done_during ?tst.
?ata sides:is_part_of ?a.
?a sides:done_by ?s.
?a sides:has_for_timestamp ?ds.
filter(year(?ds)=year(?d) 1).
}
group by ?s ?e ?t year(?d)
order by ?s ?t
as you notice, the character “+” is removed in the second query.
Any idea about this?
Thanks in advance
Adam