Adventures in SPARQL

If this blog post seems different than usual, it’s because I’m actually using it to get tech support via Twitter for an issue I’m having.  One of my tasks for my current project has me generating data for use in a test database. DBPedia is the data source, and I’ve been running SPARQL queries to retrieve RDF/XML-formatted data against their Virtuoso endpoint.  For some reason though, the resulting data doesn’t validate.

For example, the following query:

PREFIX owl: <>
PREFIX xsd: <>
PREFIX rdfs: <>
PREFIX rdf: <>
PREFIX foaf: <>
PREFIX dc: <>
PREFIX dbpedia2: <>
PREFIX dbpedia: <>
PREFIX skos: <>
SELECT ?property ?hasValue ?isValueOf
{ <> ?property ?hasValue FILTER (LANG(?hasValue) = ‘en’) .}
{ ?isValueOf ?property <> }

generates the RDF/XML output here.  If I try to parse the file with an RDF validator (like this one, for example), validation fails.  Removing the attributes from the output takes care of the validation issues, but what I’m not sure of is why the node ids are added in the first place.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.