Last active
July 14, 2017 18:28
-
-
Save dmccreary/eb8f100c5db8ccbe23a2efaef8deb9eb to your computer and use it in GitHub Desktop.
Sample Keyword Expansion SPARQL Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#> | |
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |
SELECT (str(?prefTerm) AS ?pTerm) (str(?altTerm) AS ?aTerm) | |
FROM <urn:x-evn-master:BenefitSectionDetails0> | |
FROM <urn:x-evn-master:BenefitSection> | |
WHERE { | |
?s (skosxl:prefLabel | skosxl:altLabel) / skosxl:literalForm ?allTerms . | |
FILTER (LCASE(str(?allTerms)) = LCASE('IUD')) | |
{?s skosxl:prefLabel/skosxl:literalForm ?prefTerm . | |
?s skosxl:altLabel/skosxl:literalForm ?altTerm . | |
} | |
UNION | |
{ | |
?s skos:broader* ?pConcept . | |
?pConcept skosxl:prefLabel/skosxl:literalForm ?prefTerm . | |
?pConcept skosxl:altLabel/skosxl:literalForm ?altTerm . | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment