Strabon

changeset 213:e7b0603d21f9

added predefined query for getting the number of triples for a repository. Now the user instead of writing the query, she may use the alias "size"
author Babis Nikolaou <charnik@di.uoa.gr>
date Thu May 31 18:28:00 2012 +0300 (2012-05-31)
parents 00487d7d2849
children 63af6b450dbf
files scripts/endpoint
line diff
     1.1 --- a/scripts/endpoint	Thu May 31 15:42:04 2012 +0300
     1.2 +++ b/scripts/endpoint	Thu May 31 18:28:00 2012 +0300
     1.3 @@ -23,7 +23,9 @@
     1.4  	echo "Usage: `basename ${0}` query ENDPOINT SPARQL_QUERY"
     1.5  	echo
     1.6  	echo "	ENDPOINT     : the URL of Strabon Endpoint (e.g., http://localhost:8080/StrabonEndpoint/)"
     1.7 -	echo "	SPARQL_QUERY : the SPARQL query to execute"
     1.8 +	echo "	SPARQL_QUERY : the SPARQL query to execute or the alias name corresponding to a"
     1.9 +	echo "		       predefined query such as:"
    1.10 +	echo "				\`size': SELECT (count(*) as ?c) WHERE {?s ?p ?o}"
    1.11  }
    1.12  
    1.13  function help_update() {
    1.14 @@ -86,6 +88,12 @@
    1.15  		URL="${1}/Query"
    1.16  		QUERY="${2}"
    1.17  
    1.18 +		case "${QUERY}" in
    1.19 +			size)
    1.20 +				QUERY="SELECT (count(*) as ?c) WHERE {?s ?p ?o}"
    1.21 +				;;
    1.22 +		esac
    1.23 +
    1.24  		# TODO: make it an argument
    1.25  		FORMAT="XML"
    1.26