summaryrefslogtreecommitdiff
path: root/web/doapheader.sh
blob: ca2b5f98ba2c11fe1c23c33d071b850f2860f623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

test $# -ne 1 && echo "usage: $0 doap" && exit 1

rdf="$1"

q="PREFIX doap: <http://usefulinc.com/ns/doap#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?desc
WHERE {
?p a doap:Project;
   doap:name ?name;
   doap:description ?desc.
}"

roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \
| while read r; do
	name=`echo $r | awk -F , '{print $2}'| sed -e 's/"\(.*\)"/\1/'`
	desc=`echo $r | awk -F , '{print $3}'| sed -e 's/"\(.*\)"/\1/'`

	cat <<- _EOF_
$name
=======================================================================

About
-----

$desc
_EOF_
done