am using enipedia to run SPARQL queries like the one below, I need to know how can I combine data from more than one SPARQL end point then I want to know how can I present the results in a HTML (web based application) BASE http://enipedia.tudelft.nl/wiki/ PREFIX article: http://enipedia.tudelft.nl/wiki/ PREFIX a: http://enipedia.tudelft.nl/wiki/ PREFIX property: http://enipedia.tudelft.nl/wiki/Property: PREFIX prop: http://enipedia.tudelft.nl/wiki/Property: PREFIX category: http://enipedia.tudelft.nl/wiki/Category: PREFIX cat: http://enipedia.tudelft.nl/wiki/Category: PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX fn: http://www.w3.org/2005/xpath-functions# PREFIX afn: http://jena.hpl.hp.com/ARQ/function# select ?Name ?Point ?Generation_capacity where { ?powerPlant prop:Country a:Netherlands . ?powerPlant rdfs:label ?Name . ?powerPlant prop:Point ?Point . ?powerPlant prop:Generation_capacity-23W ?Generation_capacity . } |
Have the endpoint return the results in SPARQL Query Results XML format (http://www.w3.org/TR/2008/REC-rdf-sparql-XMLres-20080115/), which is very simple and straightforward, and then use whatever tool you like to convert the XML to HTML. I like XSLT. |
Actually you are asking two questions: 1. combining two endpoints You can do this like bobdc has proposed, that is: make one query per endpoint and than combine the data yourself. You also can make ONE query using the SERVICE keyword to federate the query (see http://getthedata.org/questions/13/making-sparql-queries-against-two-data-stores?page=1#912 ) which I would prefer, but your endpoint must have implemented SPARQL1.1. 2. present HTML
You have yourself to process and present the data. You can get RDFXML from the endpoint if this is easy for you to process. You can even get JSON from many endpoints (e.g. 4store) , using the Accept-Header, i.e. using curl: |