Skip to content
Snippets Groups Projects
Commit a0a2afd1 authored by alvaro's avatar alvaro
Browse files

Fixed lodspk.sh errors

parent 22aa5847
No related branches found
No related tags found
No related merge requests found
......@@ -40,19 +40,21 @@ if [[ $currentOperation == "create" || $currentOperation == "delete" ]]; then
fi
currentUnit=$3
if [[ ${formats[@]} =~ $4 ]]; then
currentFormat=$4
else
if [ -z "$4" ]; then
currentFormat="all"
currentFormat="html"
if [ ! -z "$4" ]; then
if [[ ${formats[@]} =~ $4 ]]; then
currentFormat=$4
else
echo "Format \"$4\" not valid"
echo $USAGE
exit 1
fi
else
if [[ $currentOperation == "delete" ]]; then
currentFormat="all"
fi
fi
$DIR/modules/create-$currentModule.sh "$currentUnit" "$currentFormat"
$DIR/modules/$currentOperation-$currentModule.sh "$currentUnit" "$currentFormat"
fi
## Debug
......
......@@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
initToken='service'
modelHtml=$(cat <<QUERY
modelHtml=`cat <<QUERY
{%for h in base.header %}
PREFIX {{h.prefix}}: <{{h.ns}}>
{%endfor%}
......@@ -13,9 +13,9 @@ SELECT DISTINCT ?resource WHERE {
[] a ?resource .
{%if base.args.arg0 %} } {%endif%}
}
QUERY)
QUERY`
viewHtml=$(cat <<VIEW
viewHtml=`cat <<VIEW
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
......@@ -34,17 +34,17 @@ viewHtml=$(cat <<VIEW
</ul>
</body>
</html>
VIEW)
VIEW`
modelRdf=$(cat <<QUERY
modelRdf=`cat <<QUERY
DESCRIBE ?resource WHERE {
[] a ?resource .
}
QUERY)
QUERY`
viewRdf=$(cat <<QUERY
viewRdf=`cat <<QUERY
{{r|safe}}
QUERY)
QUERY`
modelTtl=$modelRdf
viewTtl=$viewRdf
......
......@@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
initToken='type'
modelHtml=$(cat <<QUERY
modelHtml=`cat <<QUERY
SELECT ?s2 ?p2 ?s1 ?p1 WHERE {
{
GRAPH ?g{
......@@ -22,11 +22,10 @@ SELECT ?s2 ?p2 ?s1 ?p1 WHERE {
}
}
}
QUERY
)
QUERY`
viewHtml=$(cat <<VIEW
viewHtml=`cat <<VIEW
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
......@@ -79,17 +78,17 @@ viewHtml=$(cat <<VIEW
</div>
</body>
</html>
VIEW)
VIEW`
modelRdf=$(cat <<QUERY
modelRdf=`cat <<QUERY
DESCRIBE ?resource WHERE {
[] a ?resource .
}
QUERY)
QUERY`
viewRdf=$(cat <<VIEW
viewRdf=`cat <<VIEW
{{models.main|safe}}
VIEW)
VIEW`
modelTtl=$modelRdf
viewTtl=$viewRdf
......
......@@ -4,19 +4,20 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
initToken='uri'
modelHtml=$(cat <<QUERY
modelHtml=`cat <<QUERY
SELECT ?s2 ?p2 ?s1 ?p1 WHERE {
GRAPH ?g{
{
<{{uri}}> ?s1 ?p1 .
}UNION{
?s2 ?p2 <{{uri}}> .
}
}
}
QUERY
)
QUERY`
viewHtml=$(cat <<VIEW
viewHtml=`cat <<VIEW
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
......@@ -67,17 +68,17 @@ viewHtml=$(cat <<VIEW
</div>
</body>
</html>
VIEW)
VIEW`
modelRdf=$(cat <<QUERY
modelRdf=`cat <<QUERY
DESCRIBE ?resource WHERE {
[] a ?resource .
}
QUERY)
QUERY`
viewRdf=$(cat <<VIEW
viewRdf=`cat <<VIEW
{{r|safe}}
VIEW)
VIEW`
modelTtl=$modelRdf
viewTtl=$viewRdf
......
......@@ -7,6 +7,7 @@ initToken='service'
#Check models
mainModelDir=$DIR/../../models/$initToken.$1
mainViewDir=$DIR/../../views/$initToken.$1
if [ ! -e "$mainModelDir" ]
then
......@@ -17,7 +18,10 @@ fi
obj=( )
if [ "$2" == "all" ]
then
obj=( html rdf ttl nt json )
rm -rf $mainModelDir
rm -rf $mainViewDir
echo $initToken.$1 deleted >&2
exit
else
obj=( $2 )
fi
......@@ -32,7 +36,6 @@ done
#Check views
mainViewDir=$DIR/../../views/$initToken.$1
if [ ! -e "$mainViewDir" ]
then
......@@ -62,4 +65,4 @@ else
rm -rf $mainViewDir/$i.template
done
fi
echo $initToken.$1 deleted successfully! >&2
echo $initToken.$1 deleted >&2
......@@ -7,6 +7,7 @@ initToken='type'
#Check models
mainModelDir=$DIR/../../models/$initToken.$1
mainViewDir=$DIR/../../views/$initToken.$1
if [ ! -e "$mainModelDir" ]
then
......@@ -17,7 +18,10 @@ fi
obj=( )
if [ "$2" == "all" ]
then
obj=( html rdf ttl nt json )
rm -rf $mainModelDir
rm -rf $mainViewDir
echo $initToken.$1 deleted >&2
exit
else
obj=( $2 )
fi
......@@ -32,7 +36,6 @@ done
#Check views
mainViewDir=$DIR/../../views/$initToken.$1
if [ ! -e "$mainViewDir" ]
then
......
......@@ -7,6 +7,7 @@ initToken='uri'
#Check models
mainModelDir=$DIR/../../models/$initToken.$1
mainViewDir=$DIR/../../views/$initToken.$1
if [ ! -e "$mainModelDir" ]
then
......@@ -17,7 +18,10 @@ fi
obj=( )
if [ "$2" == "all" ]
then
obj=( html rdf ttl nt json )
rm -rf $mainModelDir
rm -rf $mainViewDir
echo $initToken.$1 deleted >&2
exit
else
obj=( $2 )
fi
......@@ -32,7 +36,6 @@ done
#Check views
mainViewDir=$DIR/../../views/$initToken.$1
if [ ! -e "$mainViewDir" ]
then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment