Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement #176] Implement MEMBER OF in SOQL.
- Loading branch information
Showing
8 changed files
with
129 additions
and
8 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
jopa-impl/src/main/java/cz/cvut/kbss/jopa/exception/SoqlException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package cz.cvut.kbss.jopa.exception; | ||
|
||
import cz.cvut.kbss.jopa.exceptions.OWLPersistenceException; | ||
|
||
/** | ||
* Indicates an error during parsing and translation of SOQL to SPARQL. | ||
*/ | ||
public class SoqlException extends OWLPersistenceException { | ||
|
||
public SoqlException(String message) { | ||
super(message); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
jopa-impl/src/main/java/cz/cvut/kbss/jopa/query/soql/MemberOfOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cz.cvut.kbss.jopa.query.soql; | ||
|
||
/** | ||
* SOQL ({@code NOT}) {@code MEMBER OF} operator. | ||
*/ | ||
public class MemberOfOperator implements FilterableExpression { | ||
|
||
private final boolean isNot; | ||
|
||
private MemberOfOperator(boolean isNot) { | ||
this.isNot = isNot; | ||
} | ||
|
||
@Override | ||
public String toFilterExpression(String parameter, String value) { | ||
// TODO FILTER NOT EXISTS | ||
return ""; | ||
} | ||
|
||
@Override | ||
public boolean requiresFilterExpression() { | ||
return isNot; | ||
} | ||
|
||
static MemberOfOperator memberOf() { | ||
return new MemberOfOperator(false); | ||
} | ||
|
||
static MemberOfOperator notMemberOf() { | ||
return new MemberOfOperator(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
jopa-impl/src/main/java/cz/cvut/kbss/jopa/query/sparql/SparqlConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package cz.cvut.kbss.jopa.query.sparql; | ||
|
||
/** | ||
* Constants of SPARQL. | ||
*/ | ||
public class SparqlConstants { | ||
|
||
/** | ||
* The {@literal SELECT} keyword. | ||
*/ | ||
public static final String SELECT = "SELECT"; | ||
|
||
/** | ||
* The {@literal WHERE} keyword. | ||
*/ | ||
public static final String WHERE = "WHERE"; | ||
|
||
/** | ||
* The {@literal a} keyword representing the rdf:type IRI. | ||
*/ | ||
public static final String RDF_TYPE_SHORTCUT = "a"; | ||
|
||
private SparqlConstants() { | ||
throw new AssertionError(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters