From b0659cf2523776df0bba023e2a54f1d8d3afda4e Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 24 Oct 2010 13:39:20 +0100 Subject: Fix doap and improve summary output --- doap.ttl | 2 +- summary.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doap.ttl b/doap.ttl index 8f5eb68..f01a3ce 100644 --- a/doap.ttl +++ b/doap.ttl @@ -1,7 +1,7 @@ @prefix rdf: . @prefix doap: . @prefix foaf: . -@prefix : . +@prefix : . :p a doap:Project; doap:name "Readable"; diff --git a/summary.sh b/summary.sh index 0298d4d..c274443 100644 --- a/summary.sh +++ b/summary.sh @@ -6,7 +6,7 @@ rdf="$1" q="PREFIX doap: PREFIX foaf: -SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang +SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang ?repotype WHERE { ?p a doap:Project; doap:homepage ?home; @@ -14,7 +14,8 @@ WHERE { doap:license ?license; doap:programming-language ?lang; doap:maintainer ?m. -?r doap:location ?repo. +?r a ?repotype; + doap:location ?repo. ?m foaf:name ?maintainer; foaf:homepage ?maintainerhome. }" @@ -30,10 +31,12 @@ roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \ test "$licenseuri" = "http://www.gnu.org/licenses/gpl.html" && license="GPL" test "$licenseuri" = "http://www.gnu.org/licenses/agpl.html" && license="AGPL" test "$licenseuri" = "http://creativecommons.org/licenses/MIT/" && license="MIT" + repotype=`echo $r | awk -F , '{print $8}'| sed -e 's/uri(\(.*\))/\1/'` + test "$repotype" = "http://usefulinc.com/ns/doap#GitRepository" && repocmd="git clone" cat <<- _EOF_ - Project homepage: [$home]($home) -- Code repository: git clone $repo +- Code repository: $repocmd $repo - Maintainer: [$maint]($mainthome) - Language: $lang - License: [$license]($licenseuri) -- cgit v1.2.3