Skip to content

Instantly share code, notes, and snippets.

@danielhmills
Created February 24, 2021 14:31
Show Gist options
  • Save danielhmills/dfb3e1c097b48e89071e860e8cef0718 to your computer and use it in GitHub Desktop.
Save danielhmills/dfb3e1c097b48e89071e860e8cef0718 to your computer and use it in GitHub Desktop.
CREATE VIEW demo.dbpedia.company
AS
(
SPARQL
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT *
WHERE
{
SERVICE <http://dbpedia.org/sparql/>
{
?company dbp:type <http://dbpedia.org/resource/Public_company>;
rdfs:label ?companyName;
dbo:industry dbr:Automobile;
dbo:product/rdfs:label ?product.
FILTER(lang(?companyName)= 'en' && lang(?product) = 'en').
}
}
LIMIT 10
);
GRANT SELECT ON demo.dbpedia.company to vdb;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment