Search code examples
rdfsparqlendpointopendata

How to get rdf file from sparql endpoint


I am new in opendata and need some help. Wikipedia have their sparql endpoint in this url: http://dbpedia.org/sparql Now I need to write webservice to get some rdf file from dbpedia. What should I send to this endpoint to get rdf file ?


Solution

  • Send a CONSTRUCT query. A little example:

    CONSTRUCT { ?s ?p ?o }
    WHERE { ?s ?p ?o }
    LIMIT 10
    

    The WHERE clause works just like that of SELECT only the values fill the CONSTRUCT block as a kind of template. It's very flexible - you can either copy statements as here or transform them into a completely different shape.