Changeset 34736


Ignore:
Timestamp:
2021-01-29T14:48:41+13:00 (3 years ago)
Author:
davidb
Message:

Development of bash scripts to run combined local and federated (SERVICE dbpedia.org) queries

Location:
main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/GET-ESC-LOD.sh

    r34645 r34736  
    2121
    2222
    23 
    24 # How to deal with 2 entrants specifying 2 songs ???
    25 # Could be an issue with SPARQL: e.g., see discussion
    26 
    27 # "Constructing containers and collections"
    28 #   https://www.w3.org/2009/sparql/wiki/Feature:Constructing_containers_and_collections
    29 
    30 
    31 # Adapted from:
    32 #  https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command
    33 
    34 rawurlencode() {
    35     local string="${1}"
    36     local strlen=${#string}
    37     local encoded=""
    38     local pos c o
    39 
    40     for (( pos=0 ; pos<strlen ; pos++ )); do
    41     c=${string:$pos:1}
    42     case "$c" in
    43         [-_.~a-zA-Z0-9\(\)] ) o="${c}"
    44         ;;
    45 
    46         " " ) o="+"
    47         ;;
    48        
    49         * )   printf -v o '%%%02X' "'$c"
    50     esac
    51     encoded+="${o}"
    52     done
    53     echo "${encoded}"
    54 }
    55 
     23source ./_lod_utils.bash
    5624
    5725sparql_url="https://dbpedia.demo.openlinksw.com/sparql/"
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/LOCAL-LOD-QUERY.sh

    r34698 r34736  
    11#!/bin/bash
    22
     3input_sparql_query_file=${1:-problem-songs--using-errata.sparql}
    34
    4 s-query --service http://localhost:3030/greenstone/query "SELECT * WHERE {?s ?p ?o} $*"
     5sparql_query=`cat "$input_sparql_query_file"`
     6
     7
     8s-query --service http://localhost:3030/greenstone/query \
     9    "$sparql_query $*"
Note: See TracChangeset for help on using the changeset viewer.