return this.selectedScheme;
}
@Override
public Graph retrieveConcepts(String searchTerm) {
QueryParser queryParser = QueryParser.getInstance();
String query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " +
"PREFIX skos: <http://www.w3.org/2008/05/skos#> " +
"CONSTRUCT {?concept a skos:Concept; skos:prefLabel ?prefLabel; " +
"rdfs:comment ?comment; owl:sameAs ?sameConcept .} " +
"WHERE {?concept skos:inScheme " + selectedScheme.toString() +
"; skos:prefLabel ?prefLabel . " +
"OPTIONAL { ?concept skos:altLabel ?altLabel .} " +
"OPTIONAL { ?concept rdfs:comment ?comment .} " +
"OPTIONAL { ?concept owl:sameAs ?sameConcept .} " +
"FILTER (REGEX(STR(?prefLabel), '" +
searchTerm + "', 'i') || REGEX(STR(?altLabel), '" +
searchTerm + "', 'i'))}";
ConstructQuery constructQuery;
try {
constructQuery = (ConstructQuery) queryParser.parse(query);
} catch (ParseException ex) {
throw new RuntimeException(ex);
}
MGraph defaultGraph = contentGraphProvider.getContentGraph();