CREATE SERVER eudata FOREIGN DATA WRAPPER rdf_fdw OPTIONS (endpoint 'https://data.europa.eu/sparql'); /* * Get a list of all catalogues on data.europa.eu * This query retrieves a full list catalogues published on data.europa.eu. It then retrieves with an OPTIONAL * clause the catalogue's title, homepage, geographical coverage etc. * * Source: European data (https://data.europa.eu/de/about/sparql) */ CREATE FOREIGN TABLE catalogues ( parent text OPTIONS (variable '?parentCatalog'), catalog text OPTIONS (variable '?catalog'), title text OPTIONS (variable '?title'), spatial text OPTIONS (variable '?spatial'), pubtype text OPTIONS (variable '?typePublisher'), homepage text OPTIONS (variable '?homepage'), email text OPTIONS (variable '?email') ) SERVER eudata OPTIONS ( log_sparql 'true', sparql ' PREFIX dcat: PREFIX dct: PREFIX rdfs: PREFIX skos: PREFIX rdf: PREFIX xsd: SELECT * WHERE { ?catalog ?p ?o. FILTER (?o=) OPTIONAL {?catalog ?title} OPTIONAL {?parentCatalog ?catalog} OPTIONAL {?catalog ?spatial.} OPTIONAL {?catalog ?publisher. OPTIONAL {?publisher ?homepage.} OPTIONAL {?publisher ?email.} OPTIONAL {?publisher ?typePublisher.} } } '); SELECT DISTINCT catalog, title, email FROM catalogues WHERE email IS NOT NULL ORDER BY title;