Authority SPARQL Examples

From Library Linked Data
Revision as of 01:37, 20 May 2011 by Jyoung4 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
WHERE {
   ?concept foaf:focus ?thing ;
            skos:inScheme <http://viaf.org/authorityScheme/LC> ;
            skos:prefLabel ?prefLabel .
   ?thing owl:sameAs <http://dbpedia.org/resource/Jane_Austen> ;
}

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
WHERE {
   ?concept skos:prefLabel ?prefLabel ;
            skos:inScheme ?conceptScheme ;
            foaf:focus ?thing.
   ?thing owl:sameAs <http://dbpedia.org/resource/Jane_Austen> .
}

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
 WHERE  {
   {
     ?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
 LIMIT 10