File tree Expand file tree Collapse file tree
src/main/java/fr/inria/corese/command/utils/coreseCoreWrapper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import fr .inria .corese .core .query .QueryProcess ;
66import fr .inria .corese .core .sparql .exceptions .EngineException ;
77import fr .inria .corese .core .sparql .triple .update .ASTUpdate ;
8+ import fr .inria .corese .core .sparql .triple .update .Composite ;
9+ import fr .inria .corese .core .sparql .triple .update .Update ;
810
911/**
1012 * Wrapper class for corese core KGRAM query
@@ -78,8 +80,25 @@ public boolean isSPARQLUpdate() {
7880 return query .getAST ().isSPARQLUpdate ();
7981 }
8082
81- public ASTUpdate getAstUpdate () {
82- return query .getAST ().getUpdate ();
83+ /**
84+ * Checks if the query contains WITH clause.
85+ *
86+ * @return true if the query contains WITH clause, false otherwise
87+ */
88+ public boolean containsWithClause () {
89+ ASTUpdate astUpdate = query .getAST ().getUpdate ();
90+ if (astUpdate != null ) {
91+ for (Update update : astUpdate .getUpdates ()) {
92+ Composite composite = update .getComposite ();
93+ if (composite != null ) {
94+ if (composite .getWith () != null ) {
95+ return true ;
96+ }
97+ }
98+ }
99+ }
100+
101+ return false ;
83102 }
84103
85- }
104+ }
You can’t perform that action at this time.
0 commit comments