Reputation: 11
I'm trying to extract the birthyear of veterans from a DBPedia database using SPARQL and order them by their birthyear.
Needless to say I'm a History student and we have to do this course, I do not have much understanding of what it is I'm supposed to do.
I tried to see if I could give some other informations, but did not manage to do a thing.
Thanks in advance for all the help I can get.
When I follow the instructions given by our professor:
PREFIX dbr: PREFIX dbp: PREFIX dbo: SELECT DISTINCT ?s ?birthDate
WHERE {
?s ?p dbr:Veteran;
dbo:birthDate ?birthDate
}
order by ?birthDate
All I get is the following error:
Virtuoso 37000 Error SP030: SPARQL compiler, line 5: Missing <namespace-iri-string> in PREFIX declaration at 'PREFIX' before 'dbp:'
SPARQL query:
#output-format:auto
define sql:signal-void-variables 1
define input:default-graph-uri <http://dbpedia.org/>
PREFIX dbr:
PREFIX dbp:
PREFIX dbo:
SELECT DISTINCT ?s ?birthDate
WHERE {
?s ?p dbr:Veteran;
dbo:birthDate ?birthDate
}
order by ?birthDate
EDIT:
I found the issue myself, I was missing the URI for dbo
, dbr
and dbp
.
Now I do however have another error. It's a syntax error, which I tried to compare to similar codes but could not find the answer.
OUTPUT:
Virtuoso 37000 Error SP030: SPARQL compiler, line 9: syntax error at 'dbo:birthDate' before '?birthDate'
Upvotes: 0
Views: 39