Thursday, 21 April 2011

A simple SPARQL query

And oh so simple it is too.

PREFIX owl: <>
PREFIX xsd: <>
PREFIX rdfs: <>
PREFIX rdf: <>
PREFIX foaf: <>
PREFIX dc: <>
PREFIX dbpedia2: <>
PREFIX dbpedia: <>
PREFIX skos: <>

PREFIX dbpedia-owl: <>
SELECT * WHERE { ?s dbpedia-owl:genus :Corydoras }

All but the last prefix are included in SNORQL queries, and it was the matter of prefixes that was actually confusing me all last night through to this morning.

A big frustration for me has been that many of the examples of SPARQL queries I've found online don't work for one reason or another.

I finally broke down and asked in Freenode's Semantic Web Interest Group IRC channel (#swig) what I was doing wrong, and was quickly enlightened.

Thank you lawd! (And William Waites AKA ww on Freenode!)