Authority SPARQL Examples

From Library Linked Data
Jump to: navigation, search

Selecting an LC authority preferred label for a DBpedia entity using VIAF

SPARQL query for selecting the Library of Congress preferred label for a person identified in DBpedia (Jane Austen):

SELECT ?prefLabel
   ?concept foaf:focus ?thing ;
            skos:inScheme <> ;
            skos:prefLabel ?prefLabel .
   ?thing owl:sameAs <> ;

Listing available preferred labels for a DBpedia entity using VIAF

SPARQL query for listing all available preferred labels for DBpedia's Jane Austen:

SELECT ?conceptScheme ?prefLabel
   ?concept skos:prefLabel ?prefLabel ;
            skos:inScheme ?conceptScheme ;
            foaf:focus ?thing.
   ?thing owl:sameAs <> .

Thesaurus Concept Lookup

Thesaurus concept lookup, with hints from alt labels to (english) pref labels (query underlying stw-ws /suggest service)

 SELECT DISTINCT ?term ?concept ?prefLabel
     ?concept skos:prefLabel ?term .
   } UNION {
     ?concept skos:altLabel ?term .
   } UNION {
     ?concept skos:hiddenLabel ?term .
   } .
   FILTER (regex(str(?term), "^acc", "i")) .
   ?concept skos:prefLabel ?prefLabel .
   FILTER (langMatches(lang(?prefLabel), "en")) .
 ORDER BY ?term