Skip to content

Commit

Permalink
try to get the "en" values first, fallback to the untagged values.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenR-York committed Dec 19, 2024
1 parent f58b965 commit e722372
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ public void getNamesWithoutPrefixUsingPreferredLanguageTagEN() throws Exception
setupModel(LANGUAGE_PREFERENCE_EN_STRING);
RDFResource res = (RDFResource) model.getElementById(SPIDERMAN_URI);
Set<String> names = new HashSet<>((Collection<String>) pGetter.invoke(res, "name", context));
assertEquals("Should return all when language preference cant be matched",SPIDERMAN_NAMES, names);
assertEquals("Should return untagged when language preference cant be matched",Collections.singleton(SPIDERMAN_NAME), names);
}

@Test
public void getNamesWithPrefixUsingPreferredLanguageTagEN() throws Exception {
setupModel(LANGUAGE_PREFERENCE_EN_STRING);
RDFResource res = (RDFResource) model.getElementById(SPIDERMAN_URI);
Set<String> names = new HashSet<>((Collection<String>) pGetter.invoke(res, "foaf:name", context));
assertEquals("Should return all when language preference cant be matched",SPIDERMAN_NAMES, names);
assertEquals("Should return untagged when language preference cant be matched",Collections.singleton(SPIDERMAN_NAME), names);
}

@Test
Expand All @@ -151,7 +151,7 @@ public void getNameLiteralWithPrefixUsingPreferredLanguageTagEN() throws Excepti
for (RDFLiteral l : (Collection<RDFLiteral>) pGetter.invoke(res, "foaf:name_literal", context)) {
names.add((String) l.getValue());
}
assertEquals("Should return all when language preference cant be matched",SPIDERMAN_NAMES, names);
assertEquals("Should return untagged when language preference cant be matched",Collections.singleton(SPIDERMAN_NAME), names);
}

@Test
Expand All @@ -162,10 +162,9 @@ public void getNameLiteralWithoutPrefixUsingPreferredLanguageTagEN() throws Exce
for (RDFLiteral l : (Collection<RDFLiteral>) pGetter.invoke(res, "name_literal", context)) {
names.add((String) l.getValue());
}
assertEquals("Should return all when language preference cant be matched",SPIDERMAN_NAMES, names);
assertEquals("Should return untagged when language preference cant be matched",Collections.singleton(SPIDERMAN_NAME), names);
}


// JA preferred and available

@Test
Expand Down

0 comments on commit e722372

Please sign in to comment.