SPARQL examples
From MBI
Companies
Companies with labels, inception, Postscheckkonto, Fernruf and Drahtanschrift
SELECT DISTINCT ?company ?companyLabel (year(?inc) as ?inception) ?POSTSCHECKKONTO ?FERNRUF ?DRAHTANSCHRIFT WHERE {
?company rdfs:label ?companyLabel;
wdt:P3 wd:Q1.
OPTIONAL { ?company wdt:P46 ?inc. }
OPTIONAL { ?company wdt:P7 ?POSTSCHECKKONTO. }
OPTIONAL { ?company wdt:P8 ?FERNRUF. }
OPTIONAL { ?company wdt:P9 ?DRAHTANSCHRIFT. }
FILTER((LANG(?companyLabel)) = "de")
}
Companies with labels, Inhaber, Geschäftsführer and Bankverbindungen
SELECT DISTINCT ?company ?companyLabel ?INHABER ?GESCHÄFTSFÜHRER ?BANKVERBINDUNGEN WHERE {
?company rdfs:label ?companyLabel;
wdt:P3 wd:Q1.
OPTIONAL { ?company wdt:P12 ?INHABER. }
OPTIONAL { ?company wdt:P18 ?GESCHÄFTSFÜHRER. }
OPTIONAL { ?company wdt:P10 ?BANKVERBINDUNGEN. }
FILTER((LANG(?companyLabel)) = "de")
}
Companies with labels, raw texts and file segments
SELECT DISTINCT ?company ?companyLabel ?RAW_TEXT ?FILE_SEGMENT WHERE {
?company rdfs:label ?companyLabel;
wdt:P3 wd:Q1;
wdt:P4 ?RAW_TEXT;
wdt:P5 ?FILE_SEGMENT.
FILTER((LANG(?companyLabel)) = "de")
}
Entities
Entities with labels
SELECT DISTINCT ?entity ?entityLabel WHERE {
?entity rdfs:label ?entityLabel.
FILTER((LANG(?entityLabel)) = "en")
}
Properties
Properties with labels, aliases, descriptions and datatypes
SELECT DISTINCT ?propertyWikibase ?propertyLabel ?propertyAlias ?propertyDescription ?propertyType WHERE {
?propertyWikibase wikibase:directClaim ?p;
wikibase:propertyType ?propertyType;
schema:description ?propertyDescription;
rdfs:label ?propertyLabel.
OPTIONAL { ?propertyWikibase skos:altLabel ?propertyAlias. }
}