From fb51e598d95c35b7d035ffe095dc4901f8c92f48 Mon Sep 17 00:00:00 2001 From: anquetil Date: Tue, 18 Nov 2025 16:39:24 +0100 Subject: [PATCH 1/2] QuerySolver : commented 39 methods --- .../core/compiler/eval/QuerySolver.java | 69 +++++++++++++++---- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java b/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java index 4bdf77505..7922025c0 100755 --- a/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java +++ b/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java @@ -11,7 +11,6 @@ import fr.inria.corese.core.kgram.event.EventManager; import fr.inria.corese.core.kgram.event.ResultListener; import fr.inria.corese.core.kgram.tool.MetaProducer; -import fr.inria.corese.core.sparql.api.IDatatype; import fr.inria.corese.core.sparql.datatype.DatatypeMap; import fr.inria.corese.core.sparql.exceptions.EngineException; import fr.inria.corese.core.sparql.triple.function.term.Binding; @@ -110,9 +109,11 @@ public static void setPlanDefault(int n) { QUERY_PLAN = n; } +/* --- dead code removal --- public static void defaultNamespaces(String ns) { NAMESPACES = ns; } + --- dead code removal --- */ public static void definePrefix(String pref, String ns) { if (NAMESPACES == null) { @@ -162,9 +163,11 @@ public ContextLog getLog() { return getCreateBinding().getCreateLog(); } +/* --- dead code removal --- public ContextLog getCreateLog() { return getCreateBinding().getCreateLog(); } + --- dead code removal --- */ public void setVisitor(QueryVisitor v) { addVisitor(v); @@ -177,9 +180,11 @@ public void addVisitor(QueryVisitor v) { visit.add(v); } +/* --- dead code removal --- public boolean hasVisitor() { return visit != null && !visit.isEmpty(); } + --- dead code removal --- */ public List getVisitorList() { return visit; @@ -189,17 +194,21 @@ public void set(Provider p) { provider = p; } +/* --- dead code removal --- public Provider getProvider() { return provider; } + --- dead code removal --- */ public void setDefaultBase(String str) { setBase(str); } +/* --- dead code removal --- public String getBase() { return defaultBase; } + --- dead code removal --- */ public void setBase(String str) { defaultBase = str; @@ -385,6 +394,7 @@ public Environment getEnvironment() { return getCurrentEval().getEnvironment(); } +/* --- dead code removal --- public Context getContext() { return getCreateBinding().getCreateContext(); } @@ -394,6 +404,7 @@ public void finish() { current.finish(); } } + --- dead code removal --- */ public Mappings modifier(Query q, Mappings map) throws SparqlException { if (getCurrentEval() == null) { @@ -483,10 +494,12 @@ public Eval createEval(Query q) throws EngineException { return kgram; } +/* --- dead code removal --- @Deprecated public IDatatype eval(String q) { return DatatypeMap.TRUE; } + --- dead code removal --- */ void init(Query q) { // use case: OWL RL kg:sparql(query) in a rule @@ -525,9 +538,11 @@ public Interpreter getEvaluator() { return evaluator; } +/* --- dead code removal --- public Interpreter getInterpreter() { return evaluator; } + --- dead code removal --- */ public ASTQuery getAST(Query q) { return q.getAST(); @@ -553,10 +568,12 @@ public Query compile(String squery) throws EngineException { return compile(squery, null); } +/* --- dead code removal --- // rule: construct where public Query compileRule(String squery) throws EngineException { return compileRule(squery, null); } + --- dead code removal --- */ void setParameter(Transformer transformer) { transformer.setGenerateMain(isGenerateMain()); @@ -581,6 +598,7 @@ public Query compile(String squery, Dataset ds) throws EngineException { return transformer.transform(squery); } +/* --- dead code removal --- public ASTQuery parse(String q) throws EngineException { return parse(q, (Dataset) null); } @@ -589,6 +607,7 @@ public ASTQuery parse(String q, Dataset ds) throws EngineException { Transformer transformer = createTransformer(ds); return transformer.parse(q); } + --- dead code removal --- */ Transformer createTransformer(Dataset ds) { Transformer transformer = transformer(); @@ -645,6 +664,7 @@ void pragma(Eval kgram, Query query) { } } +/* --- dead code removal --- public void addPragma(String subject, String property, String value) { Triple t = Triple.create(Constant.create(subject), Constant.create(property), Constant.create(value)); getPragma().add(t); @@ -666,6 +686,7 @@ public void addPragma(Atom subject, Atom property, Atom value) { } getPragma().add(Triple.create(subject, property, value)); } + --- dead code removal --- */ public void setListGroup(boolean b) { isListGroup = b; @@ -675,22 +696,27 @@ public void setListPath(boolean b) { isListPath = b; } +/* --- dead code removal --- public void setCountPath(boolean b) { isCountPath = b; } + --- dead code removal --- */ public void setPathLoop(boolean b) { isCheckLoop = !b; } +/* --- dead code removal --- boolean isSPARQLCompliant() { return isSPARQLCompliant; } + --- dead code removal --- */ public void setSPARQLCompliant(boolean isSPARQLCompliant) { this.isSPARQLCompliant = isSPARQLCompliant; } +/* --- dead code removal --- public boolean isDebug() { return isDebug; } @@ -706,6 +732,7 @@ public void setOptimize(boolean b) { public void setSlice(int n) { slice = n; } + --- dead code removal --- */ public BasicGraphPattern getPragma() { return pragma; @@ -715,6 +742,7 @@ public void setPragma(BasicGraphPattern pragma) { this.pragma = pragma; } +/* --- dead code removal --- public boolean isDetail() { return isDetail; } @@ -722,6 +750,7 @@ public boolean isDetail() { public void setDetail(boolean isDetail) { this.isDetail = isDetail; } + --- dead code removal --- */ /** * @return the isSkolem @@ -730,26 +759,28 @@ public boolean isSkolem() { return isSkolem; } +/* --- dead code removal --- /** * @param isSkolem the isSkolem to set - */ + *_/ public void setSkolem(boolean isSkolem) { this.isSkolem = isSkolem; } - + /** * @return the isMatchBlank - */ + *_/ public boolean isMatchBlank() { return isMatchBlank; } /** * @param isMatchBlank the isMatchBlank to set - */ + *_/ public void setMatchBlank(boolean isMatchBlank) { this.isMatchBlank = isMatchBlank; } + --- dead code removal --- */ /** * @return the planner @@ -758,40 +789,42 @@ public int getPlanProfile() { return planner; } +/* --- dead code removal --- /** * @param planner the planner to set - */ + *_/ public void setPlanProfile(int planner) { this.planner = planner; } /** * @return the isPathType - */ + *_/ public boolean isPathType() { return isPathType; } /** * @param isPathType the isPathType to set - */ + *_/ public void setPathType(boolean isPathType) { this.isPathType = isPathType; } /** * @return the isStorePath - */ + *_/ public boolean isStorePath() { return isStorePath; } /** * @param isStorePath the isStorePath to set - */ + *_/ public void setStorePath(boolean isStorePath) { this.isStorePath = isStorePath; } + --- dead code removal --- */ /** * @return the isCachePath @@ -800,12 +833,14 @@ public boolean isCachePath() { return isCachePath; } +/* --- dead code removal --- /** * @param isCachePath the isCachePath to set - */ + *_/ public void setCachePath(boolean isCachePath) { this.isCachePath = isCachePath; } + --- dead code removal --- */ // true = skip Lock ; false = with Lock @Override @@ -823,17 +858,21 @@ public boolean isUseBind() { return isUseBind; } +/* --- dead code removal --- public void setUseBind(boolean isUseBind) { this.isUseBind = isUseBind; } + --- dead code removal --- */ public boolean isGenerateMain() { return isGenerateMain; } +/* --- dead code removal --- public void setGenerateMain(boolean isGenerateMain) { this.isGenerateMain = isGenerateMain; } + --- dead code removal --- */ public Query parseQuery(String path) throws EngineException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. @@ -859,6 +898,7 @@ public void setMetadata(Metadata metadata) { this.metadata = metadata; } +/* --- dead code removal --- public void set(Metadata metadata) { this.metadata = metadata; } @@ -866,6 +906,7 @@ public void set(Metadata metadata) { public boolean isRule() { return isRule; } + --- dead code removal --- */ public void setRule(boolean rule) { this.isRule = rule; @@ -875,22 +916,26 @@ public boolean isAlgebra() { return algebra; } +/* --- dead code removal --- /** * BGP must be set to true * * @param algebra the algebra to set - */ + *_/ public void setAlgebra(boolean algebra) { this.algebra = algebra; } + --- dead code removal --- */ public boolean isBGP() { return isBGP; } +/* --- dead code removal --- public void setBGP(boolean BGP) { this.isBGP = BGP; } + --- dead code removal --- */ @Override public void getLinkedFunction(String uri) throws EngineException { From 386538a41d08b5521f99c646518c20067653c9cb Mon Sep 17 00:00:00 2001 From: Pierre Maillot Date: Wed, 19 Nov 2025 14:56:06 +0100 Subject: [PATCH 2/2] Deleting commented dead code --- .../core/compiler/eval/QuerySolver.java | 245 ------------------ 1 file changed, 245 deletions(-) diff --git a/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java b/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java index 7922025c0..efb59c27b 100755 --- a/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java +++ b/src/main/java/fr/inria/corese/core/compiler/eval/QuerySolver.java @@ -109,12 +109,6 @@ public static void setPlanDefault(int n) { QUERY_PLAN = n; } -/* --- dead code removal --- - public static void defaultNamespaces(String ns) { - NAMESPACES = ns; - } - --- dead code removal --- */ - public static void definePrefix(String pref, String ns) { if (NAMESPACES == null) { NAMESPACES = ""; @@ -163,12 +157,6 @@ public ContextLog getLog() { return getCreateBinding().getCreateLog(); } -/* --- dead code removal --- - public ContextLog getCreateLog() { - return getCreateBinding().getCreateLog(); - } - --- dead code removal --- */ - public void setVisitor(QueryVisitor v) { addVisitor(v); } @@ -180,12 +168,6 @@ public void addVisitor(QueryVisitor v) { visit.add(v); } -/* --- dead code removal --- - public boolean hasVisitor() { - return visit != null && !visit.isEmpty(); - } - --- dead code removal --- */ - public List getVisitorList() { return visit; } @@ -194,22 +176,10 @@ public void set(Provider p) { provider = p; } -/* --- dead code removal --- - public Provider getProvider() { - return provider; - } - --- dead code removal --- */ - public void setDefaultBase(String str) { setBase(str); } -/* --- dead code removal --- - public String getBase() { - return defaultBase; - } - --- dead code removal --- */ - public void setBase(String str) { defaultBase = str; } @@ -394,18 +364,6 @@ public Environment getEnvironment() { return getCurrentEval().getEnvironment(); } -/* --- dead code removal --- - public Context getContext() { - return getCreateBinding().getCreateContext(); - } - - public void finish() { - if (current != null) { - current.finish(); - } - } - --- dead code removal --- */ - public Mappings modifier(Query q, Mappings map) throws SparqlException { if (getCurrentEval() == null) { logger.info("Undefined Eval"); @@ -494,13 +452,6 @@ public Eval createEval(Query q) throws EngineException { return kgram; } -/* --- dead code removal --- - @Deprecated - public IDatatype eval(String q) { - return DatatypeMap.TRUE; - } - --- dead code removal --- */ - void init(Query q) { // use case: OWL RL kg:sparql(query) in a rule // query is evaluated as a Rule @@ -538,12 +489,6 @@ public Interpreter getEvaluator() { return evaluator; } -/* --- dead code removal --- - public Interpreter getInterpreter() { - return evaluator; - } - --- dead code removal --- */ - public ASTQuery getAST(Query q) { return q.getAST(); } @@ -568,13 +513,6 @@ public Query compile(String squery) throws EngineException { return compile(squery, null); } -/* --- dead code removal --- - // rule: construct where - public Query compileRule(String squery) throws EngineException { - return compileRule(squery, null); - } - --- dead code removal --- */ - void setParameter(Transformer transformer) { transformer.setGenerateMain(isGenerateMain()); transformer.setNamespaces(NAMESPACES); @@ -598,17 +536,6 @@ public Query compile(String squery, Dataset ds) throws EngineException { return transformer.transform(squery); } -/* --- dead code removal --- - public ASTQuery parse(String q) throws EngineException { - return parse(q, (Dataset) null); - } - - public ASTQuery parse(String q, Dataset ds) throws EngineException { - Transformer transformer = createTransformer(ds); - return transformer.parse(q); - } - --- dead code removal --- */ - Transformer createTransformer(Dataset ds) { Transformer transformer = transformer(); setParameter(transformer); @@ -664,30 +591,6 @@ void pragma(Eval kgram, Query query) { } } -/* --- dead code removal --- - public void addPragma(String subject, String property, String value) { - Triple t = Triple.create(Constant.create(subject), Constant.create(property), Constant.create(value)); - getPragma().add(t); - } - - public void addPragma(String subject, String property, int value) { - Triple t = Triple.create(Constant.create(subject), Constant.create(property), Constant.create(value)); - getPragma().add(t); - } - - public void addPragma(String subject, String property, boolean value) { - Triple t = Triple.create(Constant.create(subject), Constant.create(property), Constant.create(value)); - getPragma().add(t); - } - - public void addPragma(Atom subject, Atom property, Atom value) { - if (getPragma() == null) { - setPragma(BasicGraphPattern.create()); - } - getPragma().add(Triple.create(subject, property, value)); - } - --- dead code removal --- */ - public void setListGroup(boolean b) { isListGroup = b; } @@ -696,44 +599,14 @@ public void setListPath(boolean b) { isListPath = b; } -/* --- dead code removal --- - public void setCountPath(boolean b) { - isCountPath = b; - } - --- dead code removal --- */ - public void setPathLoop(boolean b) { isCheckLoop = !b; } -/* --- dead code removal --- - boolean isSPARQLCompliant() { - return isSPARQLCompliant; - } - --- dead code removal --- */ - public void setSPARQLCompliant(boolean isSPARQLCompliant) { this.isSPARQLCompliant = isSPARQLCompliant; } -/* --- dead code removal --- - public boolean isDebug() { - return isDebug; - } - - public void setDebug(boolean b) { - isDebug = b; - } - - public void setOptimize(boolean b) { - isOptimize = b; - } - - public void setSlice(int n) { - slice = n; - } - --- dead code removal --- */ - public BasicGraphPattern getPragma() { return pragma; } @@ -742,16 +615,6 @@ public void setPragma(BasicGraphPattern pragma) { this.pragma = pragma; } -/* --- dead code removal --- - public boolean isDetail() { - return isDetail; - } - - public void setDetail(boolean isDetail) { - this.isDetail = isDetail; - } - --- dead code removal --- */ - /** * @return the isSkolem */ @@ -759,29 +622,6 @@ public boolean isSkolem() { return isSkolem; } -/* --- dead code removal --- - /** - * @param isSkolem the isSkolem to set - *_/ - public void setSkolem(boolean isSkolem) { - this.isSkolem = isSkolem; - } - - /** - * @return the isMatchBlank - *_/ - public boolean isMatchBlank() { - return isMatchBlank; - } - - /** - * @param isMatchBlank the isMatchBlank to set - *_/ - public void setMatchBlank(boolean isMatchBlank) { - this.isMatchBlank = isMatchBlank; - } - --- dead code removal --- */ - /** * @return the planner */ @@ -789,43 +629,6 @@ public int getPlanProfile() { return planner; } -/* --- dead code removal --- - /** - * @param planner the planner to set - *_/ - public void setPlanProfile(int planner) { - this.planner = planner; - } - - /** - * @return the isPathType - *_/ - public boolean isPathType() { - return isPathType; - } - - /** - * @param isPathType the isPathType to set - *_/ - public void setPathType(boolean isPathType) { - this.isPathType = isPathType; - } - - /** - * @return the isStorePath - *_/ - public boolean isStorePath() { - return isStorePath; - } - - /** - * @param isStorePath the isStorePath to set - *_/ - public void setStorePath(boolean isStorePath) { - this.isStorePath = isStorePath; - } - --- dead code removal --- */ - /** * @return the isCachePath */ @@ -833,15 +636,6 @@ public boolean isCachePath() { return isCachePath; } -/* --- dead code removal --- - /** - * @param isCachePath the isCachePath to set - *_/ - public void setCachePath(boolean isCachePath) { - this.isCachePath = isCachePath; - } - --- dead code removal --- */ - // true = skip Lock ; false = with Lock @Override public boolean isSynchronized() { @@ -858,22 +652,10 @@ public boolean isUseBind() { return isUseBind; } -/* --- dead code removal --- - public void setUseBind(boolean isUseBind) { - this.isUseBind = isUseBind; - } - --- dead code removal --- */ - public boolean isGenerateMain() { return isGenerateMain; } -/* --- dead code removal --- - public void setGenerateMain(boolean isGenerateMain) { - this.isGenerateMain = isGenerateMain; - } - --- dead code removal --- */ - public Query parseQuery(String path) throws EngineException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @@ -898,16 +680,6 @@ public void setMetadata(Metadata metadata) { this.metadata = metadata; } -/* --- dead code removal --- - public void set(Metadata metadata) { - this.metadata = metadata; - } - - public boolean isRule() { - return isRule; - } - --- dead code removal --- */ - public void setRule(boolean rule) { this.isRule = rule; } @@ -916,27 +688,10 @@ public boolean isAlgebra() { return algebra; } -/* --- dead code removal --- - /** - * BGP must be set to true - * - * @param algebra the algebra to set - *_/ - public void setAlgebra(boolean algebra) { - this.algebra = algebra; - } - --- dead code removal --- */ - public boolean isBGP() { return isBGP; } -/* --- dead code removal --- - public void setBGP(boolean BGP) { - this.isBGP = BGP; - } - --- dead code removal --- */ - @Override public void getLinkedFunction(String uri) throws EngineException { }