Replacement of language comparisons using '=' by the 'langMatches'
function
This commit is contained in:
parent
2e682e6f38
commit
542d1c30ef
1 changed files with 403 additions and 400 deletions
|
@ -455,16 +455,20 @@ public class FakeApplicationOntologyService {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* UQAM-Optimization New query including Linguistic context
|
* UQAM-Optimization New query including Linguistic context
|
||||||
|
* and UQAM - In the filter, Case-insensitive language processing
|
||||||
*/
|
*/
|
||||||
private static String QUERY_STRING_LANG = ""
|
private static String QUERY_STRING_LANG(String lang) {
|
||||||
|
return "\n"
|
||||||
+ "PREFIX obo: <http://purl.obolibrary.org/obo/> \n"
|
+ "PREFIX obo: <http://purl.obolibrary.org/obo/> \n"
|
||||||
+ "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n"
|
+ "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n"
|
||||||
+ "SELECT ?pt \n" + "WHERE { \n"
|
+ "SELECT ?pt \n" + "WHERE { \n"
|
||||||
+ " ?uri obo:ARG_2000028 ?vIndividual . \n"
|
+ " ?uri obo:ARG_2000028 ?vIndividual . \n"
|
||||||
+ " ?vIndividual vcard:hasTitle ?vTitle . \n"
|
+ " ?vIndividual vcard:hasTitle ?vTitle . \n"
|
||||||
+ " ?vTitle vcard:title ?pt . \n"
|
+ " ?vTitle vcard:title ?pt . \n"
|
||||||
+ " FILTER (lang(?pt) = '?langCtx' ) \n"
|
// + " FILTER (lang(?pt) = '?langCtx' ) \n" old and buggy
|
||||||
|
+ " FILTER (langMatches(lang(?pt), '" + lang+"' ) ) \n"
|
||||||
+ " } LIMIT 1";
|
+ " } LIMIT 1";
|
||||||
|
}
|
||||||
private static final String FAKE_VIVO_PEOPLE_DATA_GETTER_URI = "http://FakeVivoPeopleDataGetter";
|
private static final String FAKE_VIVO_PEOPLE_DATA_GETTER_URI = "http://FakeVivoPeopleDataGetter";
|
||||||
|
|
||||||
private static OntModel fakeDisplayModel = initializeFakeDisplayModel();
|
private static OntModel fakeDisplayModel = initializeFakeDisplayModel();
|
||||||
|
@ -479,7 +483,7 @@ public class FakeApplicationOntologyService {
|
||||||
Property saveToVarProperty = m
|
Property saveToVarProperty = m
|
||||||
.getProperty(DisplayVocabulary.SAVE_TO_VAR);
|
.getProperty(DisplayVocabulary.SAVE_TO_VAR);
|
||||||
|
|
||||||
m.add(dataGetter, queryProperty, QUERY_STRING_LANG); //UQAM-Optimization Using query with linguistic context
|
m.add(dataGetter, queryProperty, QUERY_STRING_LANG("en-US")); //UQAM-Optimization Using query with linguistic context
|
||||||
m.add(dataGetter, saveToVarProperty, "extra");
|
m.add(dataGetter, saveToVarProperty, "extra");
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
@ -505,7 +509,6 @@ public class FakeApplicationOntologyService {
|
||||||
Map<String, Object> parms = new HashMap<>();
|
Map<String, Object> parms = new HashMap<>();
|
||||||
parms.put("uri", individualUri);
|
parms.put("uri", individualUri);
|
||||||
parms.put("langCtx", langCtx); //UQAM-Optimization add the linguistic context
|
parms.put("langCtx", langCtx); //UQAM-Optimization add the linguistic context
|
||||||
|
|
||||||
return super.getData(parms);
|
return super.getData(parms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue