-
Notifications
You must be signed in to change notification settings - Fork 0
/
query.sh
executable file
·41 lines (33 loc) · 1.05 KB
/
query.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# URL do servidor
backendUrl="http://localhost:8080/sparql/"
# Definir a consulta SPARQL
query='PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?students ?comment_pt ?city ?established ?name ?rector
WHERE {
?entity dbp:name "Federal University of Espírito Santo"@en ;
dbp:nativeName ?name;
dbp:students ?students ;
dbp:rector ?rector;
dbp:established ?established ;
rdfs:comment ?comment .
FILTER (LANG(?comment) = "pt")
OPTIONAL {
?entity rdfs:comment ?comment_pt .
FILTER (LANG(?comment_pt) = "pt")
}
?entity dbo:city ?city ;
dbo:country ?country .
}'
# Definir os parâmetros do formulário
format='xml'
do_adjust_for_inflation='false'
target_date=''
# Enviar o formulário usando o comando curl
curl -X POST "$backendUrl" \
-d "q=$query" \
-d "format=$format" \
-d "do_adjust_for_inflation=$do_adjust_for_inflation" \
-d "target_date=$target_date"