From 12578c804a1f35224b494d340bbbe509a499115b Mon Sep 17 00:00:00 2001 From: Owen Reynolds Date: Thu, 19 Dec 2024 09:32:06 +0000 Subject: [PATCH] Removed local lang pref list, added calls to get list from rdfmodel --- .../src/org/eclipse/epsilon/emc/rdf/RDFResource.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bundles/org.eclipse.epsilon.emc.rdf/src/org/eclipse/epsilon/emc/rdf/RDFResource.java b/bundles/org.eclipse.epsilon.emc.rdf/src/org/eclipse/epsilon/emc/rdf/RDFResource.java index b037e16..21270d0 100644 --- a/bundles/org.eclipse.epsilon.emc.rdf/src/org/eclipse/epsilon/emc/rdf/RDFResource.java +++ b/bundles/org.eclipse.epsilon.emc.rdf/src/org/eclipse/epsilon/emc/rdf/RDFResource.java @@ -36,9 +36,6 @@ public class RDFResource extends RDFModelElement { protected static final String LITERAL_SUFFIX = "_literal"; - - // TODO should be moved to the model, and parsed only once when the model loads - protected List preferredLanguageTagList; enum LiteralMode { RAW, VALUES_ONLY @@ -49,8 +46,6 @@ enum LiteralMode { public RDFResource(Resource resource, RDFModel rdfModel) { super(rdfModel); this.resource = resource; - preferredLanguageTagList = rdfModel.getLanguagePreference(); - preferredLanguageTagList.add(""); } public Resource getResource() { @@ -84,7 +79,7 @@ public Collection getProperty(String property, IEolContext context) { private Collection filterByPreferredLanguage(Collection value, LiteralMode literalMode) { // If no preferred languages are specified, don't do any filtering - if (preferredLanguageTagList.isEmpty()) { + if (super.getModel().getLanguagePreference().isEmpty()) { switch (literalMode) { case RAW: return value; @@ -108,7 +103,7 @@ private Collection filterByPreferredLanguage(Collection value, L } } - for (String tag : preferredLanguageTagList) { + for (String tag : super.getModel().getLanguagePreference()) { if (literalsByTag.containsKey(tag)) { switch (literalMode) { case RAW: