Strabon

changeset 563:43f6b2907df8

added predefined DESCRIBE (actually CONSTRUCT) query for exporting the database in RDF. The alias name of the query is "export". Use it as follows:
strabon describe export > database.nt
author Babis Nikolaou <charnik@di.uoa.gr>
date Thu Sep 27 15:24:46 2012 +0300 (2012-09-27)
parents 942a48b43164
children 41246f8ce66e
files scripts/strabon
line diff
     1.1 --- a/scripts/strabon	Tue Sep 25 22:34:52 2012 +0300
     1.2 +++ b/scripts/strabon	Thu Sep 27 15:24:46 2012 +0300
     1.3 @@ -59,6 +59,7 @@
     1.4  QUERY_SIZE="SELECT (COUNT(*) as ?C) WHERE {?s ?p ?o}"
     1.5  QUERY_DELETEALL="DELETE {?s ?p ?o} WHERE {?s ?p ?o}"
     1.6  QUERY_HOTSPOT_SIZE="SELECT (COUNT(*) as ?C) WHERE {?h <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Hotspot>}"
     1.7 +QUERY_EXPORT="CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}"
     1.8  
     1.9  # debug option for log4j configuration:
    1.10  #-Dlog4j.debug
    1.11 @@ -153,7 +154,8 @@
    1.12  	echo
    1.13  	echo "Execute a SPARQL DESCRIBE query on Strabon."
    1.14  	echo
    1.15 -	echo "	DESCRIBE_QUERY	: the SPARQL DESCRIBE query to execute"
    1.16 +	echo "	DESCRIBE_QUERY	: the SPARQL DESCRIBE query to execute or an alias name such as the following:"
    1.17 +	echo "				export: returns all triples stored in the database"
    1.18  	echo "	RESULT_FORMAT	: the format of the result. Possible values are \`N-Triples', "
    1.19  	echo "			  \`RDM/XML', \`N3', \`TURTLE', \`TRIG', \`TRIX', and \`BinaryRDF'"
    1.20  	echo "			  (defaults to N-Triples)"
    1.21 @@ -460,6 +462,13 @@
    1.22  		QUERY="${1}"
    1.23  		shift
    1.24  
    1.25 +		# check for predefined queries
    1.26 +		case "${QUERY}" in
    1.27 +			export)
    1.28 +				QUERY="${QUERY_EXPORT}"
    1.29 +				;;
    1.30 +		esac
    1.31 +
    1.32  		# check for format of result
    1.33  		if test $# -gt 0; then
    1.34  			RESULT_FORMAT="${1}"